-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_pre_auth_payment.php
46 lines (41 loc) · 1.13 KB
/
create_pre_auth_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 Tokenpay\Model\Currency;
use Tokenpay\Model\PaymentGroup;
use Tokenpay\Model\PaymentPhase;
$request = array(
'price' => 100,
'paidPrice' => 100,
'walletPrice' => 0,
'installment' => 1,
'currency' => Currency::TL,
'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION,
'paymentPhase' => PaymentPhase::PRE_AUTH,
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5',
'card' => array(
'cardHolderName' => 'Haluk Demir',
'cardNumber' => '5258640000000001',
'expireYear' => '2044',
'expireMonth' => '07',
'cvc' => '000'
),
'items' => array(
array(
'externalId' => uniqid(),
'name' => 'Item 1',
'price' => 30
),
array(
'externalId' => uniqid(),
'name' => 'Item 2',
'price' => 50
),
array(
'externalId' => uniqid(),
'name' => 'Item 3',
'price' => 20
)
)
);
$response = FunctionalTestConfig::tokenpay()->payment()->createPayment($request);
print_r($response);