-
Notifications
You must be signed in to change notification settings - Fork 2
/
create.php
46 lines (41 loc) · 1.44 KB
/
create.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
use BambooPayment\Exception\ExceptionInterface;
require __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../init.php';
try {
$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'
]
);
echo '<pre>';
print_r($purchase->toArray());
echo '</pre>';
} catch (ExceptionInterface $e) {
var_dump($e->getMessage());
}