soheylak/omnipay-saman
最新稳定版本:1.0.5
Composer 安装命令:
composer require soheylak/omnipay-saman
包简介
README 文档
README
composer require soheylak/omnipay-saman
Example
Purchase
The result will be a redirect to the gateway or bank.
$gateway->setTerminalId('xxxxxxxxxxxx'); $gateway->setRedirectUrl('https://www.example.com/return'); $response = $gateway->purchase([ 'Amount' => $amount, 'currency' => $currency, 'ResNum'=>'10', 'CellNumber'=>'9120000000' ])->send(); // Process response if ($response->isSuccessful() && $response->isRedirect()) { // store the transaction reference to use in completePurchase() $transactionReference = $response->getTransactionReference(); // Redirect to offsite payment gateway $response->redirect(); } else { // Payment failed: display message to customer echo $response->getMessage(); }
Complete Purchase (Verify)
// Send purchase complete request $response = $gateway->completePurchase([ 'RefNum' => $refNum, 'TerminalNumber' => $terminalNumber, ])->send(); if (!$response->isSuccessful() || $response->isCancelled()) { // Payment failed: display message to customer echo $response->getMessage(); } else { // Payment was successful print_r($response); }
Refund Order
Refund an order by the $refNum:
$response = $gateway->refund([ 'RefNum' => $refNum, 'TerminalNumber' => $terminalNumber, ])->send(); if ($response->isSuccessful()) { // Refund was successful print_r($response); } else { // Refund failed echo $response->getMessage(); }
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-16