1. Go to this page and download the library: Download soulpay/soulpay-sdk 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/ */
soulpay / soulpay-sdk example snippets
// Request para o ambiente de desenvolvimento
$request = new CreditCardRequest('Sua chave JWT aqui', false);
// Request para o ambiente de produção
$request = new CreditCardRequest('Sua chave JWT aqui', true);
$login = new Login();
$login->setEmail('[email protected]');
$login->setPassword('testeDev');
$loginRequest = new LoginRequest(false);
$response = $loginRequest->send(json_encode($login));
$billing = new Billing();
$billing->setName('SoulPay');
$billing->setAddress('Avenida Paulista');
$billing->setAddress2('124');
$billing->setDistrict('Bela vista');
$billing->setCity('São Paulo');
$billing->setState('SP');
$billing->setPostalCode('01311000');
$billing->setCountry('BR');
$billing->setPhone('111112222233333');
$billing->setEmail('[email protected]');
$customer = new Customer();
$customer->setName('Cliente');
$customer->setTaxId('12234554323');
$bankSlip = new BankSlip();
$bankSlip->setExpirationDate('2022-12-25');
$bankSlip->setInstructions('teste API');
$payment = new Payment();
$payment->setChargeTotal(10.5);
$payment->setCurrencyCode('BRL');
$bankSlipTransaction = new BankSlipTransaction();
$bankSlipTransaction->setReferenceNum('123456');
$bankSlipTransaction->setCustomer($customer);
$bankSlipTransaction->setBilling($billing);
$bankSlipTransaction->setBankSlip($bankSlip);
$bankSlipTransaction->setPayment($payment);
// Passar o token JWT aqui.
$bankSlipRequest = new BankSlipRequest('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjMsImlhdCI6MTU3NjA3Mzc0MiwiZXhwIjoxNTc4NjY1NzQyfQ.45tr4BlNhzRQQc1nLw9C6kUqMpwS1WxdYptSIBmHtE4', false);
$response = $bankSlipRequest->send(json_encode($bankSlipTransaction))
// Passar o token JWT aqui.
$request = new CreditCardRequest('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEsImlhdCI6MTU3NTkwMzEyOSwiZXhwIjoxNTc4NDk1MTI5fQ.c0g6ynTtZHFSU3qh4bJWy-jea0VnKE4hGBTAs_uhNjY', false);
// Order ID
$response = $request->get(253);
// Passar o token JWT aqui.
$request = new BankSlipRequest('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjMsImlhdCI6MTU3NjA3Mzc0MiwiZXhwIjoxNTc4NjY1NzQyfQ.45tr4BlNhzRQQc1nLw9C6kUqMpwS1WxdYptSIBmHtE4', false);
// Order ID
$response = $request->get(253);
// Passar o token JWT aqui.
$request = new RecurringRequest('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjMsImlhdCI6MTU3NjA3Mzc0MiwiZXhwIjoxNTc4NjY1NzQyfQ.45tr4BlNhzRQQc1nLw9C6kUqMpwS1WxdYptSIBmHtE4', false);
// Order ID
$response = $request->get(253);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.