cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize net hosted payment form integration in javascript

im trying to integrate hosted payment form in jsp with javascript to generate token using struts. to open payment form using the redirect method. payment page opened and payment made successfully. but after payment want to do call action to update the application data after update redirect into my custom confirmation page that will print the user and transaction details. when i use the hostedPaymentSettings url to pass action url "https://s2.aithent.com/paymentResponseSave.alice"  getting request data as null. please suggest how i can call some action and open my custom confirmation page instead of default receipt page.

 

  <form method="post" action="https://test.authorize.net/payment/payment" id="formAuthorizeNetTestPage" name="formAuthorizeNetTestPage">
<input type="hidden" id="redirectToken" name="token" value="" />
</form>

token request:

<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
            "<getHostedPaymentPageRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">" +
            "<merchantAuthentication>" +
            "<name>" + apiLoginId + "</name>" +
            "<transactionKey>" + transactionKey + "</transactionKey>" +
            "</merchantAuthentication>" +
            "<transactionRequest>" +
            "<transactionType>authCaptureTransaction</transactionType>" +
            "<amount>" + amount + "</amount>" +
            "<order>" +
            "<invoiceNumber>" + invoiceNo + "</invoiceNumber>" +
            //"<description>Custom transaction</description>" +
            "</order>" +
            //"<customer>" +
           // "<id>1001</id>" +
            //"</customer>" +
            "<userFields>" +  
            "<userField>" +
            "<name>customData</name>" +
            "<value>" + customData + "</value>" +
            "</userField>" +
            "</userFields>" +
            "</transactionRequest>" +
            "<hostedPaymentSettings>" +
            "<setting><settingName>hostedPaymentReturnOptions</settingName>" +
            "<settingValue>{\"showReceipt\": true, " +
                            "\"url\": \"https://s2.aithent.com/paymentResponseSave.alice\", " +
                            "\"urlText\": \"Redirecting...\"}</settingValue>" +
            "</setting>" +
            "</hostedPaymentSettings>" +
            "</getHostedPaymentPageRequest>";

 

vijayTech
Member
0 REPLIES 0

Type a product name