Hi,
I am a Java developer. We are trying to integrate Authorize.net to our application. We are planning to use Authorize.net payment page (used "getHostedPaymentPageRequest" API service). It's redirecting me to Payment page successfully, done the payment successfully. Got to see TransactionID and Authorization Code on Receipt page. But how do i get those details(TransactionID and AuthorizationCode) back to my server on click on 'Continue' button ?
I need TransactionID and AuthorizationCode desperately to store in my local database for corresponding Order.
I am using (test.authorize.net)
Please help, I am completely stuck.
Below is the code i am using:
https://apitest.authorize.net/xml/v1/request.api <getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>xxxx</name> <transactionKey>yyyy</transactionKey> </merchantAuthentication> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>20.00</amount> </transactionRequest> <hostedPaymentSettings> <setting> <settingName>hostedPaymentBillingAddressOptions</settingName> <settingValue>{"show": true, "required":true}</settingValue> </setting> <setting> <settingName>hostedPaymentButtonOptions</settingName> <settingValue>{"text": "Pay"}</settingValue> </setting> <setting> <settingName>hostedPaymentReturnOptions</settingName> <settingValue>{"url":"https://www.mystore.com/good","urlText":"Continue","cancelUrl":"https://www.mystore.com/cancel","cancelUrlText":"Cancel"}</settingValue> </setting> </hostedPaymentSettings> </getHostedPaymentPageRequest>
HTML page:
<FORM METHOD=POST ACTION= "https://test.authorize.net/payment/payment"> <input type="hidden" name="token" value="zzzzzz"/> <INPUT TYPE=SUBMIT VALUE="Click here for the secure payment form" /> </form>
Thanks,
David
Solved! Go to Solution.
02-07-2017 04:45 AM
Couple of suggestions:
If you embed the hosted page as an iFrame, you can use the iFrameCommunicator to get the transactionId, AuthCode, etc. See sample code at https://github.com/AuthorizeNet/accept-sample-app/blob/master/index.php line 208 "transactResponse".
If you want to use a standard redirect (as it sounds like you're doing) you can register a webhook and get notified asynchronously of the transaction details: http://developer.authorize.net/api/reference/features/webhooks.html
Hope this helps,
Brian
02-07-2017 11:35 PM
Any suggestions please ?
02-07-2017 06:51 PM
Couple of suggestions:
If you embed the hosted page as an iFrame, you can use the iFrameCommunicator to get the transactionId, AuthCode, etc. See sample code at https://github.com/AuthorizeNet/accept-sample-app/blob/master/index.php line 208 "transactResponse".
If you want to use a standard redirect (as it sounds like you're doing) you can register a webhook and get notified asynchronously of the transaction details: http://developer.authorize.net/api/reference/features/webhooks.html
Hope this helps,
Brian
02-07-2017 11:35 PM
Thanks for the suggestion. Webhook rocks!
02-08-2017 08:04 PM