Skip to content

Commit 8d646da

Browse files
authored
Merge branch 'master' into mxn-currency-support
2 parents 012ac43 + 3b5b70b commit 8d646da

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
require_once('config/sample_config.php');
4+
5+
$request = array(
6+
'paymentId' => 1,
7+
'additionalParams' => array(
8+
'otpCode' => '784294'
9+
)
10+
);
11+
12+
$response = SampleConfig::craftgate()->payment()->completeApmPayment($request);
13+
14+
print_r($response);

samples/init_setcard_apm_payment.php

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
require_once('config/sample_config.php');
4+
5+
use Craftgate\Model\ApmType;
6+
use Craftgate\Model\Currency;
7+
use Craftgate\Model\PaymentGroup;
8+
use Craftgate\Util\Guid;
9+
10+
$request = array(
11+
'apmType' => ApmType::SETCARD,
12+
'price' => 1,
13+
'paidPrice' => 1,
14+
'currency' => Currency::TL,
15+
'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION,
16+
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5',
17+
'externalId' => 'optional-externalId',
18+
'callbackUrl' => 'https://www.your-website.com/craftgate-apm-callback',
19+
'items' => array(
20+
array(
21+
'externalId' => Guid::generate(),
22+
'name' => 'Item 1',
23+
'price' => 0.40
24+
),
25+
array(
26+
'externalId' => Guid::generate(),
27+
'name' => 'Item 2',
28+
'price' => 0.60
29+
)
30+
),
31+
'additionalParams' => array(
32+
'cardNumber' => "7500131700998087",
33+
)
34+
);
35+
36+
$response = SampleConfig::craftgate()->payment()->initApmPayment($request);
37+
38+
print_r($response);

src/Model/ApmType.php

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ class ApmType
4040
const IWALLET = "IWALLET";
4141
const FUND_TRANSFER = 'FUND_TRANSFER';
4242
const CASH_ON_DELIVERY = 'CASH_ON_DELIVERY';
43+
const SETCARD = 'SETCARD';
4344
}

src/Model/PaymentProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ class PaymentProvider
4141
const PAYLANDS_MB_WAY = "PAYLANDS_MB_WAY";
4242
const PAYCELL_DCB = "PAYCELL_DCB";
4343
const IWALLET = "IWALLET";
44+
const SETCARD = "SETCARD";
4445
const OFFLINE = "OFFLINE";
4546
}

0 commit comments

Comments
 (0)