From acf0798d5a94813d07be6c9941960e89b02299a7 Mon Sep 17 00:00:00 2001 From: Emre INAL <9061788+reywyn@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:41:02 +0300 Subject: [PATCH] Adds Paymob and EGP currency (#132) * Adds Paymob and EGP currency * pr fix --- samples/init_paymob_apm_payment.php | 38 +++++++++++++++++++++++++++++ src/Model/ApmType.php | 1 + src/Model/Currency.php | 1 + src/Model/PaymentProvider.php | 1 + 4 files changed, 41 insertions(+) create mode 100644 samples/init_paymob_apm_payment.php diff --git a/samples/init_paymob_apm_payment.php b/samples/init_paymob_apm_payment.php new file mode 100644 index 0000000..0584823 --- /dev/null +++ b/samples/init_paymob_apm_payment.php @@ -0,0 +1,38 @@ + ApmType::PAYMOB, + 'price' => 1, + 'paidPrice' => 1, + 'currency' => Currency::EGP, + 'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION, + 'conversationId' => 'conversationId', + 'externalId' => 'externalId', + 'callbackUrl' => 'https://www.your-website.com/craftgate-apm-callback', + 'items' => array( + array( + 'externalId' => Guid::generate(), + 'name' => 'Item 1', + 'price' => 0.40 + ), + array( + 'externalId' => Guid::generate(), + 'name' => 'Item 2', + 'price' => 0.60 + ) + ), + 'additionalParams' => array( + 'integrationId' => '11223344' + ), +); + +$response = SampleConfig::craftgate()->payment()->initApmPayment($request); + +print_r($response); diff --git a/src/Model/ApmType.php b/src/Model/ApmType.php index f0c5f0b..4196aec 100644 --- a/src/Model/ApmType.php +++ b/src/Model/ApmType.php @@ -32,6 +32,7 @@ class ApmType const HEPSIPAY_SHOPPING_LOAN = "HEPSIPAY_SHOPPING_LOAN"; const CHIPPIN = "CHIPPIN"; const ISPAY = "ISPAY"; + const PAYMOB = "PAYMOB"; const FUND_TRANSFER = 'FUND_TRANSFER'; const CASH_ON_DELIVERY = 'CASH_ON_DELIVERY'; } diff --git a/src/Model/Currency.php b/src/Model/Currency.php index ae85c4e..e83a410 100644 --- a/src/Model/Currency.php +++ b/src/Model/Currency.php @@ -20,4 +20,5 @@ class Currency const BHD = 'BHD'; const RUB = 'RUB'; const JPY = 'JPY'; + const EGP = 'EGP'; } diff --git a/src/Model/PaymentProvider.php b/src/Model/PaymentProvider.php index 3bb04bd..d5d3ab0 100644 --- a/src/Model/PaymentProvider.php +++ b/src/Model/PaymentProvider.php @@ -35,5 +35,6 @@ class PaymentProvider const ALFABANK = "ALFABANK"; const CHIPPIN = "CHIPPIN"; const ISPAY = "ISPAY"; + const PAYMOB = "PAYMOB"; const OFFLINE = "OFFLINE"; }