-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcreate_payment_and_store_card.php
48 lines (43 loc) · 1.23 KB
/
create_payment_and_store_card.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
47
48
<?php
require_once('config/sample_config.php');
use Craftgate\Model\Currency;
use Craftgate\Model\PaymentGroup;
use Craftgate\Util\Guid;
$request = array(
'price' => 100,
'paidPrice' => 100,
'walletPrice' => 0,
'installment' => 1,
'currency' => Currency::TL,
'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION,
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5',
'externalId' => 'external_id-123456789',
'card' => array(
'cardHolderName' => 'Haluk Demir',
'cardNumber' => '5258640000000001',
'expireYear' => '2044',
'expireMonth' => '07',
'cvc' => '000',
'storeCardAfterSuccessPayment' => true,
'cardAlias' => 'My YKB Card'
),
'items' => array(
array(
'externalId' => Guid::generate(),
'name' => 'Item 1',
'price' => 30
),
array(
'externalId' => Guid::generate(),
'name' => 'Item 2',
'price' => 50
),
array(
'externalId' => Guid::generate(),
'name' => 'Item 3',
'price' => 20
)
)
);
$response = SampleConfig::craftgate()->payment()->createPayment($request);
print_r($response);