Adding a new Credit Card Processor

This section details how to add a credit card payment processor to the Gazoop System.

How do we enable an integration with Gazoop?

We have provided a template PHP Class file that we use for all our card processors. This class file will need to be adjusted for your specific payment processor, ensuring you do all the requests you need using technologies such as cURL. We do not support using any frameworks, nor including any additional files except for the single file we provide.

📘

Where is the PHP Class File?

You can find the file here: https://docs.gazoop.com/docs/php-class-template

What methods of card processing does Gazoop support?

Gazoop supports any number of payment processors and can support them via two methods.

  1. Tokenization
  2. Stored Card Details

We highly recommend sticking with Tokenization where possible.

How do I customise the variables we need to send payment requests?

In the class construct we will send an array of configuration variables as is required. This can include login details, API keys, authentication details, etc. For example, if you want the customer to provide a Login Name and API Key just comment in the __construct API

public function __construct($configuration){
 		$this->configuration['Login_Name'] = $configuration['Login_Name']; 
 		$this->configuration['API_Key'] = $configuration['API_Key'];
}

If you require Gazoop to complete an oAuth2 authentication to obtain client tokens, please ensure you provide us the documentation and relevant API keys to do this as easily as possible. Please also ensure you specify $configuration['Client_Token'] and use it as reference in the remaining functions.

How do I implement it using stored card details?

Ensure that the method getToken is removed or commented out. If this method does not exist when Gazoop goes to store or process a charge, we will continue to provide and store all card details in the chargeCard method call.

Note: We only provide the CVV2 code on the first transaction, you should make sure the requirement to give a CVV2 is disabled for future payments as we are not permitted to store this information.

How do I implement it using tokenization?

Ensure the method getToken exists and is populated to return a token that can be used for future charges. If getToken exists, we will only store the last 4 digits of the card, the card type, and the expiration date, along with the returned token. We will not store any other information including the full card number.

We will always check for getToken and call this before processing any chargeCard call.

How do I test this is working?

You can use the class locally to test all is as it seems by using code like below as an example:

<?php

include("CardProvider.class.php");
$cardprocessor = new CreditCardModule(array("APIKey"=>"Test"));
$cardprocessor->applyCardDetails("4242424242424242","Mastercard","0122","123");
$cardprocessor->applyPersonalDetails("Jack","Jones","123 Street","","New York","NY","US","12345","[email protected]");
// $cardProcessor->getToken();
$cardprocessor->chargeCard("1.00","USD");

?>

Once you have completed above, please send your completed PHP Class file to Gazoop who will conduct any final tests you require.

What are the available variables and its format?

Variable NameFormatDescriptionExample
$card_numberintThis is the full card number given by the customer with no spaces or special characters.4242424242424242
$card_typestringThis is the type of card being provided as detected by our system. The casing and format in the examples are valid results we send.Mastercard
Visa
Discover
Amex
Bankcard
JCB
Maestro
VisaElectron
Diners
Solo
Laser
$expirystring(4)This is a 4 digit representation of the expiration date. Months are prefix with 0 where below 10. The example is May 2025 expiration.0525
$cvvstring(4)This is a 3/4 digit security code provided by the customer when storing their card. We will only provide this on the first interaction, this information is never stored. Future card payments this variable will be blank.123
$valid_fromstring(4)This is a 4 digit representation of the valid from date. Months are prefix with 0 where below 10. The example is May 2015 expiration.0515
$issueintThis is the issue number of the card.1
$first_namestring(100)This is the card holders first name.Jack
$last_namestring(100)This is the card holders last name.Jones
$address1string(200)This is the first line of the billing address.123 High Street
$address2string(200)This is the second line of the billing address.The House Building
$citystring(100)This is the city of the billing address.New York
$statestring(100)This is the state/county of the billing address.NY
$countrystring(2)This is the 2 letter country code for the country in Alpha-2 format.US
$postcodestring(50)This is the ZIP or Postal code for the billing address.12345
$emailstring(200)This is the email address for the card holder.[email protected]

What information should I return with the ChargeCard method?

We require three variables to be set when we submit a request to the chargeCard method.

$this->transactionNotes
This should include any relevant notes about the transaction, such as error messages, or details about reference numbers or payment processing times if required. This can also be left blank.

$this->reference
This should include the transaction reference number that the customer can reference to pull up this specific payment. This is included in the receipts and invoices we store.

$this->status
This is the result of the payment request and it should be either "Authorized" or "NotAuthorized". We do not currently accept any other result, details of any errors can be given in the transactionNotes above.