Once you properly configure your merchant account, you can quickly and easily process payment transactions.
You must provide the following information for a credit card payment transaction:
- merchant account name (this might also be known as a store id)
- transaction key (this might also be known as a password or token)
- dollar amount
- credit card number
- credit card expiration date (Format the expiration date as MMYY or MM/YY or MM/DD/YY)
The CCProcessPayment function will process a transaction and return a transaction ID. This function returns a transaction ID if the transaction is successful or the word ERROR if the transaction fails. For detailed information about the most recent transaction failure, call the CCLastError function before calling any other transaction-processing function.
In your script, you would then have a second line after setting the gateway.
Set Variable [$result Value: CCProcessPayment( merchantAccount; transactionKey; chargeAmount; cardNumber; expDate)]
Returns: a verification code from the payment gateway service if the order is successful, or "ERROR" if there was a problem
Note: It is important to store the resulting transaction ID because you may need it later to void the transaction, issue a refund or capture a previously authorized transaction.
You may submit optional parameters to most of Plastic's payment-transaction processing functions. These parameters will be submitted to the payment gateway along with the basic transaction information. Although they are not usually required to process an order, these parameters can be useful for tasks such as address verification or linking a transaction to a customer id or an invoice number. To supply additional parameters to a function call, add them to the end of the parameter list after the last required parameter, using a "key=value" syntax.
Set Variable [$result Value: CCProcessPayment( merchantAccount; transactionKey; chargeAmount; cardNumber; expDate; "chargeDescription=" & Payment::description; "verificationCode=" & $securityCode)]