Getting Started PHP

PHP code samples for sending requests to Payscout Gateway API

This plugin is released under the GPL license.

**If you have any questions or issues, feel free to contact our technical support: it@payscout.com. You can also contact our 24/7 phone support - Tel: 1.888.689.6088

General request structure

Each request will need to specify the list of parameters in the POST body in the JSON format. The key used to send this is ‘data’ and the content type is ‘application/x-www-form-urlencoded’. Some of them need to have a value specified, and some of them can be left blank. The mandatory fields are client_username, client_password, client_token, format, displayBillingFields, displayShippingFields, amount, currency.

  1. Auth Example PHP

A pre-auth just requests an authorization. This means that if the transaction is approved, it will not be funded until a settle message is sent to capture it. This transaction type is common in environments such as physical product purchases, where payment is not captured until a product ships.

Auth Example PHP

Capture Example PHP

A capture transaction is designed to refer back to a previously processed Preauthorization transaction. The capture transaction will appear on the cardholder’s statement. Once a capture transaction is processed, the transaction proceeds will be settled into the merchant’s bank account following batch close.

Capture Example PHP

Credit Example PHP

A credit is giving funds directly to a card.

Transaction credits apply an amount to the cardholder’s card that was not originally processed through the Gateway.

This is generally discouraged, as the refund is much safer.

Credit Example PHP

Void Example PHP

A void cancels a transaction in the current open batch. The transaction may be an authorization or credit. When an authorization is voided, the Payment Gateway will attempt to issue a reversal to the issuing bank, which can free up the cardholder’s open-to-buy (making them much happier).

Void Example PHP

Sale Example PHP

A sale requests an authorization, then captures it upon approval. This means that so long as the transaction is approved, it will be funded once the day’s batch closes. This transaction type is common in environments such as digital downloads, fees / payments, and for goods that will ship immediately.

Sale Example PHP

Refund Example PHP

A refund will void a transaction (if the authorization is in the current batch), or issue a credit (if the authorization has been settled/funded). It is an easy and safe way to cancel a transaction, or give money back to a cardholder. It accepts a transaction_id from a previous Sale or Settle, meaning you don’t have to store sensitive card information for returns.

Refund Example PHP

Vault - Add Token

PHP code snippet on adding a token to the customer vault.

Vault - Add Token

Vault - Sale with Token

PHP code snippet of a sale using a token.

Vault - Sale with Token

Vault - Update Token

PHP code snippet of updating an already existing token in the vault.

Vault - Update Token

Vault Delete Token

PHP code snippet on deleting a token in the vault.

Vault Delete Token

Vault - Get Token Info

PHP code snippet of requesting token information from the gateway vault.

Vault - Get Token Info