Skip to content

Commit

Permalink
Adds Paymob and EGP currency (#132)
Browse files Browse the repository at this point in the history
* Adds Paymob and EGP currency

* pr fix
  • Loading branch information
reywyn authored Oct 15, 2024
1 parent 77ac9fd commit acf0798
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions samples/init_paymob_apm_payment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

require_once('config/sample_config.php');

use Craftgate\Model\ApmType;
use Craftgate\Model\Currency;
use Craftgate\Model\PaymentGroup;
use Craftgate\Util\Guid;

$request = array(
'apmType' => 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);
1 change: 1 addition & 0 deletions src/Model/ApmType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
1 change: 1 addition & 0 deletions src/Model/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ class Currency
const BHD = 'BHD';
const RUB = 'RUB';
const JPY = 'JPY';
const EGP = 'EGP';
}
1 change: 1 addition & 0 deletions src/Model/PaymentProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ class PaymentProvider
const ALFABANK = "ALFABANK";
const CHIPPIN = "CHIPPIN";
const ISPAY = "ISPAY";
const PAYMOB = "PAYMOB";
const OFFLINE = "OFFLINE";
}

0 comments on commit acf0798

Please sign in to comment.