sadad-payment/library
最新稳定版本:1.0.0
Composer 安装命令:
composer require sadad-payment/library
包简介
Sadad PHP Library
README 文档
README
Sadad Pay library is a PHP library to integrate Sadad payment APIs with PHP plugins, modules, e-commerce and websites.
License
The GPL-3.0-only License.
Install
You can install/require it via Composer
composer require sadad-payment/library
How to use it ..
Create refresh Token
$sadadConfig = array( 'clientId' => '', 'clientSecret' => '', 'isTest' => true, // true for test mode | false for live mode ); $sadadObj = new SadadLibrary( $sadadConfig ); $sadadObj->generateRefreshToken(); echo "Save the refresh Token ".$sadadObj->refreshToken. " into a secure place.";
Create an invoice
$invoice = array( 'ref_Number' => "order #110092", 'amount' => SadadLibrary::getKWDAmount( 'USD', 40 ), 'customer_Name' => "fname lname", 'customer_Mobile' => SadadLibrary::validatePhone( '+966987654321' ), 'customer_Email' => "email@email.com", 'currency_Code' => 'USD' ); $request = array( 'Invoices' => array( $invoice ) ); $sadadInvoice = $sadadObj->createInvoice( $request, $sadadObj->refreshToken ); $invoiceURL = $sadadInvoice['InvoiceURL']; echo "Pay Sadad Invoice <a href='$invoiceURL' target='_blank'>$invoiceURL</a>.";
Get invoice information
$invoiceInfo = $sadadObj->getInvoiceInfo( $sadadInvoice['InvoiceId'], $sadadObj->refreshToken ); echo "Sadad Invoice information <pre/>"; print_r($invoiceInfo);
Credits
统计信息
- 总下载量: 725
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2023-10-17