paymob/php-library
最新稳定版本:1.0.4
Composer 安装命令:
composer require paymob/php-library
包简介
Paymob PHP Library
README 文档
README
Paymob PHP library is integrating Paymob Flash payment with PHP platforms.
Install
You can require it via Composer
composer require paymob/php-library Usage
Configuration Array
$paymobKeys['apiKey'] = ''; $paymobKeys['pubKey'] = ''; $paymobKeys['secKey'] = ''; Get HMAC and Available integration IDs
$paymobReq = new Paymob(); $result = $paymobReq->authToken($paymobKeys); echo "<pre>"; print_r($result); Create an intention with Paymob
$cents = 100; // 100 for all countries and 1000 for Oman $billing = [ "email" => 'email@email.com', "first_name" => 'fname', "last_name" => 'lname', "street" => 'street', "phone_number" => '1234567890', "city" => 'city', "country" => 'country', "state" => 'state', "postal_code" => '12345', ]; $data = [ "amount" => 10 * $cents, "currency" => 'EGP', "payment_methods" => array(1234567), // replace this id 1234567 with your integration ID(s) "billing_data" => $billing, "extras" => ["merchant_intention_id" => '123_' . time()], "special_reference" => '123_' . time() ]; $status = $paymobReq->createIntention($paymobKeys['secKey'], $data); echo "<pre/>"; print_r($status); Get Paymob Flash URL
$countryCode = $paymobReq->getCountryCode($paymobKeys['secKey']); $apiUrl = $paymobReq->getApiUrl($countryCode); $cs = $status['cs']; $to = $apiUrl . "unifiedcheckout/?publicKey=" . $paymobKeys['pubKey'] . "&clientSecret=$cs"; echo "Pay using the URL $to"; 统计信息
- 总下载量: 9.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 8
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2026-01-04