PHP code example of gregoriohc / moneta

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

    

gregoriohc / moneta example snippets

 php
$gateway = Moneta::create('Stripe', [
    'test_mode' => true',
    'api_key' => 'API_KEY',
]);

$response = $request = $gateway->capture([
    'card' => new Card([
        'full_name' => 'John Doe',
        'number' => '4111111111111111',
        'expiration_month' => '06',
        'expiration_year' => '2024',
        'verification_value' => '123',
    ]),
    'amount' => 100,
    'currency' => 'USD',
])->send();

if ($response->isSuccessful()) {
    // Do something with the $response->data()
}