-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit_tom_finance_bnpl_payment.php
46 lines (41 loc) · 1.18 KB
/
init_tom_finance_bnpl_payment.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
require_once('config/sample_config.php');
use Craftgate\Model\ApmType;
use Craftgate\Model\BnplCartItemType;
use Craftgate\Model\Currency;
use Craftgate\Model\PaymentGroup;
use Craftgate\Util\Guid;
$request = array(
'price' => 100,
'paidPrice' => 100,
'currency' => Currency::TL,
'apmType' => ApmType::TOM_FINANCE,
'apmOrderId' => Guid::generate(),
'paymentGroup' => PaymentGroup::PRODUCT,
'externalId' => Guid::generate(),
'conversationId' => 'conversationId',
'callbackUrl' => 'https://www.your-website.com/callback',
'additionalParams' => array(
'buyerName' => "John Doe",
'buyerPhoneNumber' => "5553332211",
),
'items' => array(
array(
'externalId' => 'externalId',
'name' => 'Item 1',
'price' => 100,
)
),
'cartItems' => array(
array(
'id' => '26020874',
'name' => 'Test 1',
'brandName' => '26010303',
'type' => BnplCartItemType::OTHER,
'unitPrice' => 100,
'quantity' => 1,
)
)
);
$response = SampleConfig::craftgate()->payment()->initBnplPayment($request);
print_r($response);