Reputation: 21
We having integration with Authorize.net and we are implementing Accept.js to support credit card payments. The only issue is, it seems like in the API reference (http://developer.authorize.net/api/reference/features/acceptjs.html) there is no fields/method to take Customer's Billing Information and pass it to Authorize.net so the same will be available in transaction details.
Can any one help us i.e how to use Accept.js with asking Customer Billing Information as well?
Upvotes: 0
Views: 1382
Reputation: 353
It is very simple, you just replace the payment data in a regular API call with the XML below including the payment nonce you received from using Accept.js ...
<payment>
<opaqueData>
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
<dataValue>PAYMENT_NONCE</dataValue >
</opaqueData>
</payment>
instead of:
<payment>
<creditCard>
<cardNumber>5424000000000015</cardNumber>
<expirationDate>1220</expirationDate>
<cardCode>999</cardCode>
</creditCard>
</payment>
in a regular API call, like below:
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>YOUR_API_LOGIN</name>
<transactionKey>YOUR_TRANSACTION_KEY</transactionKey>
</merchantAuthentication>
<refId>123456</refId>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>10</amount>
<payment>
<opaqueData>
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
<dataValue>PAYMENT_NONCE</dataValue >
</opaqueData>
</payment>
<order>
<invoiceNumber>INV-12345</invoiceNumber>
<description>Product Description</description>
</order>
<lineItems>
<lineItem>
<itemId>1</itemId>
<name>vase</name>
<description>Nice Vase </description>
<quantity>1</quantity>
<unitPrice>45.00</unitPrice>
</lineItem>
</lineItems>
<shipping>
<amount>4.26</amount>
<name>level2 tax name</name>
<description>level2 tax</description>
</shipping>
<poNumber>456654</poNumber>
<customer>
<id>99999456654</id>
</customer>
<billTo>
<firstName>Sue</firstName>
<lastName>Smith</lastName>
<company>ACME Vases</company>
<address>102 Main Street</address>
<city>Palm Springs</city>
<state>CA</state>
<zip>92234</zip>
<country>USA</country>
</billTo>
</transactionRequest>
</createTransactionRequest>
Upvotes: 2