1. Go to this page and download the library: Download devsitarget/sdk-pagarme-php 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/ */
devsitarget / sdk-pagarme-php example snippets
use PagarmeSdk\Environment;
use PagarmeSdk\Pagarme;
use PagarmeSdk\Store;
$store = new Store(
apiKey: 'SUA_SECRET_KEY',
environment: Environment::sandbox()
);
$pagarme = new Pagarme($store);
use PagarmeSdk\Address;
use PagarmeSdk\Customer;
$customer = new Customer(
id: '123',
name: 'Cliente',
email: '[email protected]',
document: '12345678900',
phone: '11999999999',
address: new Address(
street: 'Rua A',
number: '100',
zipCode: '01234567',
neighborhood: 'Centro',
city: 'Sao Paulo',
state: 'SP'
)
);