PHP code example of omarusman / omnipay-paymongo

1. Go to this page and download the library: Download omarusman/omnipay-paymongo 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/ */

    

omarusman / omnipay-paymongo example snippets


$gateway = Omnipay::create('Paymongo_Card');
$gateway->setKeys('pk_test_csp6bBgoLuJ6TXT6Nzm6bTVN', 'sk_test_NW1bkhC8pa77ttiYQaJcVAhU');

$token = $gateway->authorize([
    'number'      => '4123 4501 3100 0508',
    'expiryMonth' => '1',
    'expiryYear'  => '22',
    'cvv'         => '123',
]);

$payment = $gateway->purchase([
    'amount'               => '123.45',
    'currency'             => 'PHP',
    'description'          => 'Just a purchase!',
    'statement_descriptor' => 'MyCo',
    'token'                => $token,
]);