trying implement worldpay integration. docs @ https://online.worldpay.com/docs/take-card-details-templates mention token. have tested page , dont token. wandering how can token.
<%@ page language="c#" autoeventwireup="true" codefile="payment2.aspx.cs" inherits="payment2" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src= "https://cdn.worldpay.com/v1/worldpay.js"> </script> <script type='text/javascript'> window.onload = function () { worldpay.setclientkey('t_c_a453a70e-c5e6-4618-9c7b-96f787f0fa04'); worldpay.reusable = false; worldpay.usetemplate('payment-form', 'my_payment_section', 'inline'); } </script> </head> <body> <form action="/complete" id="payment-form" method="post"> <!— other fields want collect, e.g. name , shipping address --> <div id='my_payment_section'></div> <div> <input type="submit" value="place order" /> </div> </form> </body> </html>
when window.onload executes, puts worldpay card capture form on page. looks of it, haven't disabled save payment button, trying use own submit button?? if trying use submit button, should add onclick attribute submit worldpay template.
<input type="submit" value="place order" /> <form action="/complete" id="payment-form" method="post"> <div id="my_payment_section"></div> <div> <input id="submitcard" onclick="worldpay.submittemplateform()" value="confirm payment" /> </div> </form> once form submits, worldpay.js takes over, , handle sensitive card information, validate , if ok, replace carddetails div single hidden input field token.
if happens correctly, no errors, after token input has been placed in dom, form submit action "/complete", , token part of submitted values of form.
hope helps.
Comments
Post a Comment