How to process a credit card payment
Anchor has provided a simple API for processing credit card payments. All that should be required is copying the example code for your preferred language into the relevant section of your code. The 'Integration guide' is recommended reading if you haven't used a payment gateway before.
Sample PHP codeAnchor has gone to some lengths to simplify the processing of credit card payments. There are two ways to process transactions:
An advanced method which takes the same arguments as the simple method but returns more detailed information about the transaction. This is the recommended method as it will allow you to inform your customers about recoverable problems such as a lack of funds in their account.
The transaction reference is a string of text that will appear on your bank statement for that payment. In general it is good practice to ensure that it is something that will uniquely identify
the payment to your accounting system. Invoice numbers make excellent transaction references.
NOTE. The transaction reference must be less than 16 characters or difficult to find errors will occur.
To use the simple method, use code like this:
To use the advanced method, use code like this:The advanced method will return an associative array containing the following information about the transaction:
authResponse. The receipt number of the transaction from the bank's server.
If you are logging payments to a database, we recommend recording the date, the amount, the orderNumber and responseCode values.Source: www.anchor.com.au