Purchasing Tokens Through Netbilling
NATS lets surfers purchase tokens through NetBilling. The surfer only needs to enter their payment information once to purchase an unlimited number of tokens.
Explanation
In Sites Admin, on the Site Templates, the _ex_gateway_join_token template contains an example for purchasing tokens through Netbilling. This example records the surfer's customer identification code the first time they purchase a token and automatically sends the customer identification code back to Netbilling on subsequent visits. To do this, five changes must be made to the gateway_join template:
- The gateway_join template must be wrapped in <html></html> (and must also have <head></head> and <body></body> sections
- The sign-up form must have a name parameter
- Smarty code must check for the surfer's customer identification code
- If the Smarty code doesn't find the identification code, it must have the surfer fill in their billing information
- If the Smarty code does find the identification code, it should use that code and automatically submit the form using Javascript
For example:
{* 1. The gateway_join template must be wrapped in <HTML></HTML> (and must also have <head></head> and <body></body> sections *} <html> <head></head> <body> {* 2. The sign-up form must have a name field *} <form action="signup.php" method="POST" name="purchase_netbilling_token"> {* 3. Smarty code must check for the surfer's customer identification code * 4. If the Smarty code doesn't find the identification code, it must have the surfer fill in their billing information *} {nats_get_gateway_token} {if !$gateway_token} <input type="hidden" name="nextra[NETBILLING][cisp_storage]" value="1"> <input type="hidden" name="signup[set_gateway_token]" value="1"> .... {* 5. If the Smarty code does find the identification code, it should use that code and automatically submit the form using Javascript *} {else} <input type="hidden" name="signup[cc]" value="CS:{$gateway_token}"> </form> <script language="JavaScript"> document.purchase_netbilling_token.submit(); </script> {/if} </body> </html>
Please note: the example above is not complete; please see the _ex_gateway_join_token template for a complete example.
Instructions
Go to Sites Admin, add and setup a new site, and edit its site templates. Use the description above to modify your gateway_join template or replace the gateway_join template contents with the _ex_gateway_join_token template contents.