forked from craftgate/craftgate-php-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_checkout_payment.php
37 lines (32 loc) · 963 Bytes
/
init_checkout_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
<?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,
'currency' => Currency::TL,
'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION,
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5',
'callbackUrl' => 'https://www.your-website.com/craftgate-checkout-callback',
'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()->initCheckoutPayment($request);
print_r($response);