PHP code example of fhferreira / sdk-yapay

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

    

fhferreira / sdk-yapay example snippets




use Rockbuzz\SDKYapay\Config;
use Rockbuzz\SDKYapay\Payment\Item;
use Rockbuzz\SDKYapay\Payment\Items;
use Rockbuzz\SDKYapay\Payment\Email;
use Rockbuzz\SDKYapay\PaymentBoleto;
use Rockbuzz\SDKYapay\Payment\Billing;
use Rockbuzz\SDKYapay\Payment\Address;
use Rockbuzz\SDKYapay\Payment\Customer;
use Rockbuzz\SDKYapay\Payment\TransactionBoleto;


new Item('1235', 'Product Name', 13980),
    ]), 
    new Billing(new Customer(
            12, 
            'Customer Name', 
            '123456789', 
            new Email('[email protected]'), 
            new Address('Street', 123, '', '96085150', 'Center', 'City', 'ST')
        )
    )
);

$result = $payment->done();



use Rockbuzz\SDKYapay\Config;
use Rockbuzz\SDKYapay\Payment\Item;
use Rockbuzz\SDKYapay\Payment\Items;
use Rockbuzz\SDKYapay\Payment\Email;
use Rockbuzz\SDKYapay\Payment\Address;
use Rockbuzz\SDKYapay\Payment\Billing;
use Rockbuzz\SDKYapay\Payment\Customer;
use Rockbuzz\SDKYapay\PaymentCreditCard;
use Rockbuzz\SDKYapay\Payment\CreditCard;
use Rockbuzz\SDKYapay\Payment\TransactionCreditCard;

m('1235', 'Product Name', 13980),
    ]),
    new Billing(
        new Customer(
            12, 
            'Customer Name', 
            '123456789', 
            new Email('[email protected]'), 
            new Address('Street', 123, '', '96085150', 'Center', 'City', 'ST')
        )
    )
);

$result = $payment->done();


$result->isSuccess();
$about = $result->about();
$jsonAbout = json_encode($about);

Rockbuzz\SDKYapay\Exception\PaymentException::class