PHP code example of codepso / techgenies-mm

1. Go to this page and download the library: Download codepso/techgenies-mm 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/ */

    

codepso / techgenies-mm example snippets


use TechGenies\MM\Exceptions\PayTraceException;

public function register()
{
    //
    
    $this->renderable(function (PayTraceException $e, $request) {
        return $e->getError();
    });
}

use TechGenies\MM\Api\PayTraceApi;

try {
    $payTraceApi = new PayTraceApi();
    return $payTraceApi->customers->create($data);
} catch (PayTraceException $e) {
    return $e->getError();
}

use TechGenies\MM\Api\PayTraceApi;

$payTraceApi = new PayTraceApi();
return $payTraceApi->customers->create($data);

$credentials = $payTraceApi->getCredentials();

// Get customer
$params = [
    'customer_id' => 'customerTest1'
];
$customer = $payTraceApi->customers->export($params);

$params = [
    'customer_id' => $validated['customer_id'],
    'credit_card' => [
        'number' => $validated['credit_card_number'],
        'expiration_month' => $validated['credit_card_expiration_month'],
        'expiration_year' => $validated['credit_card_expiration_year'],
    ],
    'billing_address' => [
        'name' => 'Juan Minaya',
        'street_address' => '8320 E. West St.',
        'city' => 'Spokane',
        'state' => 'WA',
        'zip' => '85284',
    ],
    'check' => [
        'account_number' => '123456',
        'routing_number' => '325070760'
    ]
];
$customer = $payTraceApi->customers->create($params);

$params = [
    'customer_id' => 'customerTest1',
    'amount' => 2.00
];
$payTraceApi->ach->vaultSale($params);