I am trying to set up an integration test for a workflow that uses Accept.JS but have run into an issue. Since the dataDescriptor and dataValue are retrieved using Accept.JS, I can't seem to figure out how to run a test transaction to our sandbox strictly using PHP.
Has anyone had any success settong up testing for an Accept.JS workflow?
Solved! Go to Solution.
03-11-2017 07:53 PM
This might be too late, but I would add a response for clarity.
securePaymentContainerRequest does not create a transaction.
When data type is passed as TOKEN (see request above), it generates a token that can be used for creating transactions by any of the APIs that allow tokens in payment field in the request. For example: Create an Accept Payment Transaction
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>{same-login-id as the one used to create the token}</name> <transactionKey>{same-transaction-key}</transactionKey> </merchantAuthentication> <refId>123456</refId> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>5</amount> <payment>
<opaqueData> <dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor> <dataValue>{sample-data-value} 1234567890ABCDEF1111AAAA2222BBBB3333CCCC4444DDDD5555EEEE6666FFFF7777888899990000</dataValue> </opaqueData> </payment> <lineItems> <lineItem> <itemId>1</itemId> <name>vase</name> <description>Cannes logo </description> <quantity>18</quantity> <unitPrice>45.00</unitPrice> </lineItem> </lineItems> <poNumber>456654</poNumber> <billTo> <firstName>Ellen</firstName> <lastName>Johnson</lastName> <company>Souveniropolis</company> <address>14 Main Street</address> <city>Pecan Springs</city> <state>TX</state> <zip>44628</zip> <country>USA</country> </billTo> <shipTo> <firstName>China</firstName> <lastName>Bayles</lastName> <company>Thyme for Tea</company> <address>12 Main Street</address> <city>Pecan Springs</city> <state>TX</state> <zip>44628</zip> <country>USA</country> </shipTo> <customerIP>192.168.1.1</customerIP> </transactionRequest> </createTransactionRequest>
You would normally use the entire opaqueData element from the response of securePaymentContainerRequet, which includes the dataDescriptor (is the value for Accept) and the dataValue (the token) for the purpose of making the next API call for the transaction.
06-19-2018 10:27 AM