PHP code example of bamboopayment / bamboopayment-sdk
1. Go to this page and download the library: Download bamboopayment/bamboopayment-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/ */
bamboopayment / bamboopayment-sdk example snippets
composer
{
""bamboopayment/bamboopayment-sdk" : "0.1.*"
}
}
composer.phar install
git clone https://github.com/BambooPayment/sdk_php.git
$bambooPaymentClient = new BambooPaymentClient(
[
'api_key' => PRIVATE_KEY,
'testing' => true,
]
);
$customer = $bambooPaymentClient->customers->create(
[
'Email' => '[email protected] ',
'FirstName' => 'PrimerNombre',
'LastName' => 'PrimerApellido',
'DocNumber' => 12345672,
'DocumentTypeId' => 2,
'PhoneNumber' => '24022330',
'BillingAddress' => [
'AddressType' => 1,
'Country' => 'UY',
'State' => 'Montevideo',
'City' => 'MONTEVIDEO',
'AddressDetail' => '10000'
]
]
);
$bambooPaymentClient = new BambooPaymentClient(
[
'api_key' => PRIVATE_KEY,
'testing' => true,
]
);
$purchase = $bambooPaymentClient->purchases->create(
[
'TrxToken' => 'OT__klLNXDDkgAvk1KXG-i6SIUxo-ACnvpjf4jiYpVJ8SzQ_',
'Order' => '12345678',
'Amount' => 100,
'Installments' => 1,
'Customer' => [
'Email' => '[email protected] ',
'FirstName' => 'Juan',
'LastName' => 'Perez',
'PhoneNumber' => '099123123',
'DocNumber' => '12345672',
'DocumentTypeId' => 2,
'BillingAddress' => [
'AddressType' => 1,
'Country' => 'Uruguay',
'State' => 'Montevideo',
'City' => 'MONTEVIDEO',
'AddressDetail' => 'Av. Sarmiento 2260'
]
],
'DataUY' => [
'IsFinalConsumer' => 'true',
'Invoice' => '1000',
'TaxableAmount' => 100
],
'Currency' => 'UYU',
'Capture' => 'true'
]
);