You need PHP >= 7.4
The bindings require the following extensions in order to work properly:
json
(This extension implements the » JavaScript Object Notation (JSON) data-interchange format.)guzzle
(Guzzle is a PHP HTTP client to send HTTP requests and to integrate with web services.)generated-hydrator
(GeneratedHydrator is a library about high performance transition of data from arrays to objects and from objects to arrays.)
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
Full documentation: Spanish, English, Portuguese.
To install with Composer, simply run the following command:
composer require bamboopayment/bamboopayment-sdk
Or you can manually add the requirement to your composer.json file:
{
"require" : {
"bamboopayment/bamboopayment-sdk" : "0.1.*"
}
}
Then install by running
composer.phar install
Obtain the latest version of BambooPayment SDK with:
git clone https://github.com/BambooPayment/sdk_php.git
If you are using Composer use autoload functionality:
include "vendor/autoload.php";
File with working example: examples/customers/create.php
To create an order using REST API in back-end you must provide an Array with customer data:
in your controller
$bambooPaymentClient = new BambooPaymentClient(
[
'api_key' => PRIVATE_KEY,
'testing' => true,
]
);
$customer = $bambooPaymentClient->customers->create(
[
'Email' => 'testing@bamboopayment.com',
'FirstName' => 'PrimerNombre',
'LastName' => 'PrimerApellido',
'DocNumber' => 12345672,
'DocumentTypeId' => 2,
'PhoneNumber' => '24022330',
'BillingAddress' => [
'AddressType' => 1,
'Country' => 'UY',
'State' => 'Montevideo',
'City' => 'MONTEVIDEO',
'AddressDetail' => '10000'
]
]
);
File with working example: examples/purchases/create.php
To create an order using REST API in back-end you must provide an Array with purchase data:
in your controller
$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' => 'juanperez123@bamboopayment.com',
'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'
]
);
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes using the Angular Contributing Guide (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Run composer test to test your code (
composer test
) - Create new Pull Request
For support, email soportetec@bamboopayment.com
The MIT License (MIT). Please see License File for more information.