PHP code example of asciisd / gate-to-pay

1. Go to this page and download the library: Download asciisd/gate-to-pay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

asciisd / gate-to-pay example snippets


use ASCIISD\GateToPay\Facades\GateToPay;

$cards = GateToPay::getCustomerCards($customerId);

use ASCIISD\GateToPay\Facades\GateToPay;

$response = GateToPay::cardCashOut([
    'customerId' => 'customer-id',
    'cardId' => 'card-id',
    'depositAmount' => 100.00,
    'transactionId' => 'unique-transaction-id',
    'cardExpiryDate' => '09/25',
]);

use ASCIISD\GateToPay\Facades\GateToPay;

$response = GateToPay::cardCashIn([
    'customerId' => 'customer-id',
    'cardId' => 'card-id',
    'withdrawalAmount' => 100.00,
    'transactionId' => 'unique-transaction-id',
    'cardExpiryDate' => '09/25',
]);

use ASCIISD\GateToPay\Facades\GateToPayCMS;

$response = GateToPayCMS::createNewProfile([
    'gender' => 'M',
    'firstName' => 'John',
    'lastName' => 'Doe',
    'birthDate' => '1990-01-01',
    'nationalNumberOrPassport' => 'AB123456',
    'cardType' => 'VISA',
    'nationality' => 'US',
    'address' => '123 Main St, New York, NY',
    'phoneNumber' => '+1234567890',
    'nameOnCard' => 'JOHN DOE',
    'email' => '[email protected]'
]);

use ASCIISD\GateToPay\Facades\GateToPayCMS;

$customerId = GateToPayCMS::generateCustomerId();

use ASCIISD\GateToPay\Facades\GateToPay;

// These methods delegate to the CMSApiService internally
$response = GateToPay::createNewProfile([/* ... */]);
$customerId = GateToPay::generateCustomerId();
bash
php artisan vendor:publish --provider="ASCIISD\GateToPay\GateToPayServiceProvider"
bash
php artisan vendor:publish --provider="ASCIISD\GateToPay\GateToPayServiceProvider" --tag="migrations"
bash
php artisan migrate
xml
<!-- Trade API Credentials -->
<env name="GATE_TO_PAY_TRADE_API_KEY" value="your-trade-api-key-here"/>
<env name="GATE_TO_PAY_TRADE_USERNAME" value="your-username-here"/>
<env name="GATE_TO_PAY_TRADE_PASSWORD" value="your-password-here"/>

<!-- CMS API Credentials -->
<env name="GATE_TO_PAY_CMS_API_KEY" value="your-cms-api-key-here"/>

<!-- Test Data -->
<env name="GATE_TO_PAY_CUSTOMER_ID" value="your-customer-id-here"/>