PHP code example of gmodugno / azpaylaravel

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

    

gmodugno / azpaylaravel example snippets


AzPayLaravel\AzPay\AzPayServiceProvider::class, 
 
'AZPay' => AzPayLaravel\AzPay\Facades\AZPay::class, 
 php artisan vendor:publish --tag=config 
 Copied File [/vendor/gmodugno/azpaylaravel/src/AzPay/Config/azpay.php] To [/config/azpay.php] 
 php
return [
	'merchant_id' => 'MERCHANT_ID',
	'merchant_key' => 'MERCHANT_KEY'
];
 php 
$azpay = AZPay::init();
 php
// Order
$azpay->setOrder([
	'reference'   => '123456789',
	'totalAmount' => '1000'
]);
 php
// Options
$azpay->setOptions([
	'urlReturn'   => 'http://loja.exemplo.com.br',
	'fraud'       => 'false',
	'customField' => ''
]);
 php
// CreditCard
$azpay->setCardPayment([
	'acquirer'           => AZPay::getCardOperators()['cielo']['modes']['store']['code'],
	'method'             => '1',
	'amount'             => '1000',
	'currency'           => AZPay::getCurrencies('BRL'),
	'numberOfPayments'   => '1',
	'groupNumber'        => '0',
	'country'            => 'BRA',
	'flag'               => 'visa',
	'cardHolder'         => 'José da Silva',
	'cardNumber'         => '4012001037141112',
	'cardSecurityCode'   => '123',
	'cardExpirationDate' => '201805',
	'saveCreditCard'     => 'true'
]);