Showing results for 
Search instead for 
Did you mean: 

DI: Create a Credit Card Payment

Former Member
0 Kudos

I can create Cash and Check payments however I can't get a credit card transaction through.

I am getting this error message:

code: -5002

message: Credit Total does not match payments total [OCRP]

Thanks for your help,


Set m_oPayment = vCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)

'Assign Payment Header Information

m_oPayment.ApplyVAT = tNO

m_oPayment.CardCode = RollUpRec!CUSTID ' B1 CardCode

m_oPayment.DocCurrency = "USD"

m_oPayment.DocDate = CDate(RollUpRec!RECMODDATE) 'Transaction Date

m_oPayment.DocTypte = rCustomer 'SAPbobsCOM.BoRcptTypes.rCustomer

m_oPayment.HandWritten = tNO ' SAPbobsCOM.BoYesNoEnum.tNO

m_oPayment.JournalRemarks = "Incoming Payment"

m_oPayment.LocalCurrency = tYES 'SAPbobsCOM.BoYesNoEnum.tYES

'Payment body

Call m_oPayment.CreditCards.Add

m_oPayment.CreditCards.AdditionalPaymentSum = CDbl(0)

m_oPayment.CreditCards.CardValidUntil = CDate("10/04/2004")

'm_oPayment.CreditCards.CreditAcct = "295000"

m_oPayment.CreditCards.CreditCard = 1

m_oPayment.CreditCards.CreditCardNumber = "884848448"

'm_oPayment.CreditCards.CreditCur = "USD"

m_oPayment.CreditCards.CreditSum = CDbl(RollUpRec!PAIDAMOUNT)

m_oPayment.CreditCards.CreditType = 1

m_oPayment.CreditCards.FirstPaymentSum = CDbl(RollUpRec!PAIDAMOUNT)

m_oPayment.CreditCards.NumOfCreditPayments = 1

m_oPayment.CreditCards.NumOfPayments = 1

m_oPayment.CreditCards.OwnerIdNum = "3993939"

m_oPayment.CreditCards.OwnerPhone = "383838888"

m_oPayment.CreditCards.PaymentMethodCode = 1

m_oPayment.CreditCards.VoucherNum = "1234"

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The reason for my error was: I did not have the add-ons loaded on to my machine. I had the SDK but that was not enouch for me to process the CC payments.

Former Member
0 Kudos

I don't know if this is the cause of your problem, but the one step that looks incorrect to me is adding the credit card line before filling it in. You get one line for free that you should fill in without any adds. You need to add additional lines before filling them in. The example in the help file shows this (at least in 6.5).

Former Member
0 Kudos

Thanks for the reply bruce...I tried removing that line, however it still is giving me the same error.

0 Kudos

I have the same problem. Can sb help us / give a working example for a credit card payment ?

Former Member
0 Kudos

I'm just started playing with this so don't take my word as gospel but I just tested the above code and it works with little modification. Credit Cards and Credit Card Payments must first be setup in SBO (Administration->Definitions->Banking). After defining those you can lookup the CreditCard ID in the OCRC table and the following code works with one issue - my Incoming Payment total always sets to $227,637 regardless of the payment amount. Anyone know what I'm missing?


Dim vPay As SAPbobsCOM.Payments

Dim vCCard As SAPbobsCOM.Payments_CreditCards

Set vPay = vCmp.GetBusinessObject(oIncomingPayments)

vPay.Remarks = "Payday!"

vPay.TransferDate = Now

vPay.CardCode = "1001"

Call vPay.CreditCards.Add

vPay.CreditCards.CardValidUntil = "10/2004"

vPay.CreditCards.CreditCard = 1

vPay.CreditCards.CreditCardNumber = "93242323452436"

vPay.CreditCards.CreditSum = CDbl(53.95)

vPay.CreditCards.FirstPaymentSum = CDbl(53.95)

vPay.CreditCards.NumOfCreditPayments = 1

vPay.CreditCards.NumOfPayments = 1

vPay.CreditCards.AdditionalPaymentSum = CDbl(0)




0 Kudos

Hi Matt !

Thanks for the sample code, it works fine for me. Now I'll try to figure out what is wrong with my code, maybe it's some conversion issue (using C++).

Regarding your payment amount, I have no explanation for this. When I looked up the payment in my system, the amount was correct. (Using 6.5.52 SP00 EF12)

I would recommend you to upgrade to the latest patch / EF available on Service Marketplace, you should get more accurate results then, hopefully.