Skip to Content
author's profile photo Former Member
Former Member

DI: Create a Credit Card Payment

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"

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2004 at 07:40 PM

    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).

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.



  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2004 at 08:46 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.