How to save order with credit card payment data via SData?

SUGGESTED

Hello!

I am trying to create an order completely with SData and Paya.

I have no problems with it when I am trying to create an order with PaymentType = Check.

Here is the XML for such example:

<entry
xmlns:atom="">http://www.w3.org/2005/Atom"
xmlns:xs="">www.w3.org/.../XMLSchema"
xmlns:cf="">www.microsoft.com/.../2005"
xmlns="">http://www.w3.org/2005/Atom"
xmlns:sdata="">schemas.sage.com/.../1"
xmlns:xsi="">www.w3.org/.../XMLSchema-instance"
xmlns:opensearch="">a9.com/.../"
xmlns:sync="
">schemas.sage.com/.../1"
xmlns:sme="">schemas.sage.com/.../2007"
xmlns:http="">schemas.sage.com/.../1">
<sdata:payload>
<SO_SalesOrderHeaderSPECIAL
xmlns="">

<ARDivisionNo>00</ARDivisionNo>
<CustomerNo>0280010</CustomerNo>
<SalesOrderNo>TMP1264</SalesOrderNo>
<OrderStatus>H</OrderStatus>
<Comment>WEB ORDER</Comment>
<PaymentType>Check</PaymentType>
<ShipToCode>PICK</ShipToCode>
<ShipVia>PICK UP</ShipVia>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0625</ItemCode>
<QuantityOrdered>1</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0835</ItemCode>
<QuantityOrdered>2</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

</SO_SalesOrderHeaderSPECIAL>
</sdata:payload>
</entry>

But when I choose to use PaymentType = V/MC and put no payment XML fields I am getting an error: "You must enter credit card information in the following fields to accept the transaction.ŠŠPayment TypeŠExpiration Date YearŠExpiration Date MonthŠLast 4 Unencrypted Credit Card NumbersŠCredit Card Authorization Number"

Here is the XML for such example:

<entry
xmlns:atom="">http://www.w3.org/2005/Atom"
xmlns:xs="">www.w3.org/.../XMLSchema"
xmlns:cf="">www.microsoft.com/.../2005"
xmlns="">http://www.w3.org/2005/Atom"
xmlns:sdata="">schemas.sage.com/.../1"
xmlns:xsi="">www.w3.org/.../XMLSchema-instance"
xmlns:opensearch="">a9.com/.../"
xmlns:sync="
">schemas.sage.com/.../1"
xmlns:sme="">schemas.sage.com/.../2007"
xmlns:http="">schemas.sage.com/.../1">
<sdata:payload>
<SO_SalesOrderHeaderSPECIAL
xmlns="">

<ARDivisionNo>00</ARDivisionNo>
<CustomerNo>0280010</CustomerNo>
<SalesOrderNo>TMP1264</SalesOrderNo>
<OrderStatus>H</OrderStatus>
<Comment>WEB ORDER</Comment>
<PaymentType>V/MC</PaymentType>
<ShipToCode>PICK</ShipToCode>
<ShipVia>PICK UP</ShipVia>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0625</ItemCode>
<QuantityOrdered>1</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0835</ItemCode>
<QuantityOrdered>2</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

</SO_SalesOrderHeaderSPECIAL>
</sdata:payload>
</entry>

But when I choose to use PaymentType = V/MC and add payment XML fields (of course previously I add card to Paya vault and then preauthorize it from vault, so I have these fields data) I am getting an error: "Resource already exists" and such order is not being created (if I check for such order existence - I get no results too).

Here is the XML for such example:

<entry
xmlns:atom="">http://www.w3.org/2005/Atom"
xmlns:xs="">www.w3.org/.../XMLSchema"
xmlns:cf="">www.microsoft.com/.../2005"
xmlns="">http://www.w3.org/2005/Atom"
xmlns:sdata="">schemas.sage.com/.../1"
xmlns:xsi="">www.w3.org/.../XMLSchema-instance"
xmlns:opensearch="">a9.com/.../"
xmlns:sync="
">schemas.sage.com/.../1"
xmlns:sme="">schemas.sage.com/.../2007"
xmlns:http="">schemas.sage.com/.../1">
<sdata:payload>
<SO_SalesOrderHeaderSPECIAL
xmlns="">

<SO_SalesOrderPayment>
<SalesOrderNo>TMP1264</SalesOrderNo>
<PaymentType>V/MC</PaymentType>
<PaymentTypeCategory>P</PaymentTypeCategory>
<CreditCardGUID>1f2eb2a5d0dejs6fad0136e5496bf275</CreditCardGUID>
<CreditCardTransactionID>A5YHASKJHP</CreditCardTransactionID>
<CreditCardAuthorizationNo>019420</CreditCardAuthorizationNo>
<AuthorizationDateTime>2019-01-08T19:10:45-05:00</AuthorizationDateTime>
<TransactionAmt>1.00</TransactionAmt>
</SO_SalesOrderPayment>

<ARDivisionNo>00</ARDivisionNo>
<CustomerNo>0280010</CustomerNo>
<SalesOrderNo>TMP1264</SalesOrderNo>
<OrderStatus>H</OrderStatus>
<Comment>WEB ORDER</Comment>
<PaymentType>V/MC</PaymentType>
<ShipToCode>PICK</ShipToCode>
<ShipVia>PICK UP</ShipVia>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0625</ItemCode>
<QuantityOrdered>1</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

<SO_SalesOrderHeaderSPECIALSECOND>
<ItemCode>0835</ItemCode>
<QuantityOrdered>2</QuantityOrdered>
</SO_SalesOrderHeaderSPECIALSECOND>

</SO_SalesOrderHeaderSPECIAL>
</sdata:payload>
</entry>

Can you advice me please, what I am doing wrong, and maybe there is some other way to store credit card payment information with SData?

Thanks a lot.

Dmitry

  • 0
    SUGGESTED

    Greetings,

    I have not done much with SData lately as we are moving away from SData for integration with Sage 100.  However, here are some old SData examples of working with Credit Cards.

    Since these are older examples, it is possible that there have been changes to Sage 100 CC processing that are not accounted for.  As noted, I haven’t worked with these examples in quite some time and at the moment, I am not able to setup and test this.  I recommend testing this with an existing Credit Card that is already in the vault.  If this doesn't work for you, then please open a case with Customer Support for the issue.

    Create a Sales Order and pay with a credit card:

     

    <SO_SalesOrderHeaderSPECIAL sdata:uri="http://localhost/sdata/MasApp/MasContract/ABC/SO_SalesOrderHeaderSPECIAL(TESTCC2)" xmlns="">

                    <SalesOrderNo>TESTCC2</SalesOrderNo>

                    <ARDivisionNo>01</ARDivisionNo>

                   <CustomerNo>ABF</CustomerNo>

                   <SO_SalesOrderHeaderSPECIALSECOND>

                                   <SalesOrderNo>TESTCC2</SalesOrderNo>

                                   <LineKey>000001</LineKey>

                                   <LineSeqNo>00000100000000</LineSeqNo>

                                   <ItemCode>1001-HON-H252</ItemCode>

                                   <QuantityOrdered>1</QuantityOrdered>

                   </SO_SalesOrderHeaderSPECIALSECOND>

                   <SO_SalesOrderPayment>

                                   <CreditCardGUID>075fad5e38bb4a6aaf4cc2a0b06fa719</CreditCardGUID>

                                   <TransactionAmt>84</TransactionAmt>

                   </SO_SalesOrderPayment>

    </SO_SalesOrderHeaderSPECIAL>

    </sdata:payload>

    </entry>

     

    Create a credit card payment on an existing Sales Order:

     

    <SO_SalesOrderPayment sdata:uri="http://localhost/sdata/MasApp/MasContract/ABC/SO_SalesOrderPayment(TESTCC3)" xmlns="">

                    <SalesOrderNo>TESTCC3</SalesOrderNo>

                    <CreditCardGUID>075fad5e38bb4a6aaf4cc2a0b06fa719</CreditCardGUID>

                    <TransactionAmt>84</TransactionAmt>

    </SO_SalesOrderPayment>


    Thank you,

    Kent Mackall

  • 0 in reply to Kent Mackall

    Thanks Kent!

    You are right that if I remove some extra fields from my XML (like CreditCardAuthorizationNo, CreditCardTransactionId etc) and leave only your listed fields, it become working differently.

    I tried both your ways and got another error: "b3f32c12344d4745b628706cb1296b18 is not on file."

    So I figured out that I need to link this Credit Card with customer 0280010 in AR_CustomerCreditCard.

    I added Credit Card to GUID and now I am getting new error: "The credit card transaction request to Sage Exchange cannot be processed." in both of your proposed ways (at the moment of creating order and at the moment of adding payment to existing order).

    Here is what I am getting:

    <?xml version="1.0" encoding="utf-8"?>
    <sdata:diagnoses xmlns="http://schemas.sage.com/sdata/2008/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sync="http://schemas.sage.com/sdata/sync/2008/1" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:http="http://schemas.sage.com/sdata/http/2008/1">
     <sdata:diagnosis>
       <sdata:severity>error</sdata:severity>
       <sdata:sdataCode>ApplicationDiagnosis</sdata:sdataCode>
       <sdata:applicationCode />
       <sdata:message> The credit card transaction request to Sage Exchange cannot be processed. </sdata:message>
       <sdata:stackTrace />
       <sdata:payloadPath />
     </sdata:diagnosis>
    </sdata:diagnoses>

    Can you advice?

    Also, Kent, looks like your offered solutions are trying to additionally process this credit card at the moment when called (not just add to sales order). That may work too in theory, but we tried to save already processed transaction - do you know is it possible (with transaction id, authorization number etc), because we didnt have any success with it also?

    Thanks!

  • 0 in reply to Dmitry

    As I mentioned in my original reply, I am not able to do any testing of this at the moment and if this doesn't work for you, please open a case with Customer Support for the issue.  

    Thank You,

    Kent

  • 0 in reply to Kent Mackall

    Okay, but here is a question about second way I am trying (I asked about it too) - to save payment information after it processed on Paya directly:

    Maybe you know if we can save order with payment information without processing credit card via Sage Exchange (for example, processed directly with Paya and having in result GUID, TransactionID, AuthorizationNo etc)?

    I tried initially to submit such fields like:

    <SO_SalesOrderPayment>
    <SalesOrderNo>TMP1264</SalesOrderNo>
    <PaymentType>V/MC</PaymentType>
    <PaymentTypeCategory>P</PaymentTypeCategory>
    <CreditCardGUID>1f2eb2a5d0dejs6fad0136e5496bf275</CreditCardGUID>
    <CreditCardTransactionID>A5YHASKJHP</CreditCardTransactionID>
    <CreditCardAuthorizationNo>019420</CreditCardAuthorizationNo>
    <AuthorizationDateTime>2019-01-08T19:10:45-05:00</AuthorizationDateTime>
    <TransactionAmt>1.00</TransactionAmt>
    </SO_SalesOrderPayment>

    When i am trying this I am getting:

    <?xml version="1.0" encoding="utf-8"?>
    <sdata:diagnoses xmlns="http://schemas.sage.com/sdata/2008/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sync="http://schemas.sage.com/sdata/sync/2008/1" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:http="http://schemas.sage.com/sdata/http/2008/1">
     <sdata:diagnosis>
       <sdata:severity>error</sdata:severity>
       <sdata:sdataCode>ApplicationDiagnosis</sdata:sdataCode>
       <sdata:applicationCode />
       <sdata:message>You cannot set Credit Card Transaction ID when Credit Card Authorization Code is not set.</sdata:message>
       <sdata:stackTrace />
       <sdata:payloadPath />
     </sdata:diagnosis>
    </sdata:diagnoses>

    Can you advice here?

    Found similar issue without solution here but for BOI: https://sagecity.na.sage.com/support_communities/sage100_erp/f/sage-100-business-object-interface/106980/order-creation-with-authorized-credit-card-details-from-3rd-party-system

    Sorry for all these questions, but maybe you know? Maybe someone else know who will visit this forum...

  • 0 in reply to Dmitry

    I GOT STRANGE SUCCESS!!!!!

    Sales Order was saved once I removed CreditCardTransactionID field from SO_SalesOrderPayment:

    So instead of:

    <SO_SalesOrderPayment>
    <SalesOrderNo>TMP1264</SalesOrderNo>
    <PaymentType>V/MC</PaymentType>
    <PaymentTypeCategory>P</PaymentTypeCategory>
    <CreditCardGUID>1f2eb2a5d0dejs6fad0136e5496bf275</CreditCardGUID>
    <CreditCardTransactionID>A5YHASKJHP</CreditCardTransactionID>
    <CreditCardAuthorizationNo>019420</CreditCardAuthorizationNo>
    <AuthorizationDateTime>2019-01-08T19:10:45-05:00</AuthorizationDateTime>
    <TransactionAmt>1.00</TransactionAmt>
    </SO_SalesOrderPayment>

    I used:

    <SO_SalesOrderPayment>
    <SalesOrderNo>TMP1264</SalesOrderNo>
    <PaymentType>V/MC</PaymentType>
    <PaymentTypeCategory>P</PaymentTypeCategory>
    <CreditCardGUID>1f2eb2a5d0dejs6fad0136e5496bf275</CreditCardGUID>
    <CreditCardAuthorizationNo>019420</CreditCardAuthorizationNo>
    <AuthorizationDateTime>2019-01-08T19:10:45-05:00</AuthorizationDateTime>
    <TransactionAmt>1.00</TransactionAmt>
    </SO_SalesOrderPayment>

    AND IT WAS SAVED!!!!! Even more, lots of other fields (like Exp. Year and Exp. Month, AVS data etc) were populated automatically.

    Except one - CreditCardTransactionID. Is it ok???

    What do you think guys about it? Why it worked with CreditCardTransactionID stripped?

    Thanks!