Credit Card
If credit card payment is selected, this API call is used:
Call w3HTMLeComCCInfo(CHID,ATSID,"MTPayment.html",Email,CCInfo,Price,FormName) |
The FormName parameter is only required if the PreCCcheck flag is set to 1.
In this example, we use our own template instead of the default MT.Template.
18 <!--MT.CC-Required--> 19 <p> 20 <CENTER> 21 You have chosen to pay with your credit card. Please enter the Card information below. 22 <p> 23 <TABLE BORDER=1> 24 <tr><td>Name on Card</td> 25 <td><input type=text name=ccname value="#NAME#"></td></tr> 26 <tr><td>Credit Card Number</td> 27 <td><input type=text size=16 maxlenth=16 name=ccnum value="#CCNUM#"></td></tr> |
28 <tr><td>Expiration Month</td> 29 <td> 30 <select name="expmon"> 31 <option value="1" selected>January …February, March, April, May, June, July, August, September, October, November 42 <option value="12">December 43 </select> 44 </td> 45 <tr><td>Expiration Year</td> 46 <td><input type=text size=4 maxlength=4 name=expyear value="#EXPYEAR#"></td></tr> 47 <tr><td>Card Type</td> |
48 <td> 49 <select name="CardType"> 50 <option value="AMEXCARD">American Express 51 <option value="DINERSCLUBCARD">Diners Club 52 <option value="DISCOVERCARD">Discover 53 <option value="ENROUTECARD">enRoute 54 <option value="JCBCARD">JCB 55 <option value="MASTERCARD">MasterCard 56 <option value="VISACARD">Visa 57 </select> |
58 </td> 59 </TABLE> 60 <input type=hidden name=amount value="#AMOUNT#"> 61 <input type=hidden name=accepturl value="#AcceptURL#"> 62 <input type=hidden name=declineurl value="#DeclineURL#"> 63 <input type=hidden name=AuthOnly value="#AuthOnly#"> 64 <input type=hidden name=PostOnly value="#PostOnly#"> 65 <input type=hidden name=action value="#ACTION#"> 66 </CENTER> 67 <!--/MT.CC-Required--> |
The substitution values of line 61 to line 65 are read from the configuration files. The other values are user input or retrieved from previous pages.
Electronic Check
If Electronic Check is selected, the following API is called:
Call w3HTMLeComCKInfo(CHID,ATSID,"MTPayment.html",Email,CKInfo,Price) |
Again, we use our own template. (for example: MTPayment.html)
42 <!--MT.CK-Required--> 43 <p><CENTER> 44 You have chosen to pay using electronic check. Please enter the Account information below. 45 <p> 46 <TABLE BORDER=1 47 <tr><td>Name on Account</td> 48 <td><input type=text name=Ckname value="#Name#"></td></tr> 49 <tr><td>Account Number</td> 50 <td><input type=text name=CkAcct value="#CKACCT#"></td></tr> 51 <tr><td>ABA Number</td> |
52 <td><input type=text name=Ckaba value="#CKAba#"></td></tr> 53 </TABLE> 54 <input type=hidden name=amount value="#AMOUNT#"> 55 <input type=hidden name=accepturl value="#AcceptURL#"> 56 <input type=hidden name=declineurl value="#DeclineURL#"> 57 <input type=hidden name=action value="#ACTION#"> 58 </CENTER> 59 <!--/MT.CK-Required--> |
The substitution values of line 55 to line 57 are read from the configuration files. The other values are user input or retrieved from previous pages.
The AcceptURL and the DeclineURL specify the URL of the accept and decline pages that are sent to the customer’s browser after the transaction is processed. These URLs can specify a CGI application that will generate these pages.
Below is the HTML code generated by the MTDemo application.
<input type=hidden name=accepturl value="http://www.MyServer.com/cgi-bin/fccgi.exe?w3exec=CC.Driver&submit=accept"> <input type=hidden name=declineurl value="http://www.MyServer.com/cgi-bin/fccgi.exe?w3exec=CC.Driver&submit=decline"> |
Notice that the accept and decline URLs run the CC.Driver application by providing the appropriate value for the submit parameter. Once again, the MTDemo application has only one entry point.