File tree 4 files changed +54
-0
lines changed
4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
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 );
Original file line number Diff line number Diff line change
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 );
Original file line number Diff line number Diff line change @@ -40,4 +40,5 @@ class ApmType
40
40
const IWALLET = "IWALLET " ;
41
41
const FUND_TRANSFER = 'FUND_TRANSFER ' ;
42
42
const CASH_ON_DELIVERY = 'CASH_ON_DELIVERY ' ;
43
+ const SETCARD = 'SETCARD ' ;
43
44
}
Original file line number Diff line number Diff line change @@ -41,5 +41,6 @@ class PaymentProvider
41
41
const PAYLANDS_MB_WAY = "PAYLANDS_MB_WAY " ;
42
42
const PAYCELL_DCB = "PAYCELL_DCB " ;
43
43
const IWALLET = "IWALLET " ;
44
+ const SETCARD = "SETCARD " ;
44
45
const OFFLINE = "OFFLINE " ;
45
46
}
You can’t perform that action at this time.
0 commit comments