haykkarapetyan/omnipay-ameriabank
Composer 安装命令:
composer require haykkarapetyan/omnipay-ameriabank
包简介
Ameria Bank Package
README 文档
README
Ameriabank driver for the Omnipay Laravel payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements iDram support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply add it
to your composer.json file:
{
"require": {
"haykkarapetyan/omnipay-ameriabank": "dev-master"
}
}
And run composer to update your dependencies:
composer update
Or you can simply run
composer require haykkarapetyan/omnipay-ameriabank
Basic Usage
- Use Omnipay gateway class:
use Omnipay\Omnipay;
- Initialize Ameriabank gateway:
$gateway = Omnipay::create('Ameriabank'); $gateway->setClientId('Client_ID'); // Shoud be your Ameriabank Client ID (e.g. 7e7ef8ff-6300-4a78-bb31-3ad1a8c67d5f) $gateway->setUsername('Username'); // Should be your Ameria Username $gateway->setPassword('Password'); // Should be your Ameria password $gateway->setOpaque('Opaque'); // Is not mandatory field and used as additional information during information exchange $gateway->setOrderId('Order_ID'); // Is randomly generated ID. Integer which is generated by using system local time e.g. time() $gateway->setCurrency('AMD'); // Uses national currency e.g. AMD, USD, EUR $gateway->setTestMode(false); // Boolean and can be only true or false $payment = $gateway->purchase([ 'amount' => '100', 'returnUrl' => 'http://example.com/xxx', // The URL to which you will be redirected after completing the purchase. Please also refer to poin 4 below 'description' => 'Description ...' ] )->createPaymentRequest();
- Processing payment
After payment request approval, call receive positive or negative response
if (empty($payment->GetPaymentIDResult->PaymentID) || $payment->GetPaymentIDResult->Respmessage != 'OK') { return $payment->GetPaymentIDResult; // in case if response was negative (rejected). } else { $gateway->setPaymentId($payment->GetPaymentIDResult->PaymentID); //if positive, call receive payment ID $gateway->setClientUrl("http://example.com/ameriarequestframe.aspx"); // Setting /ameriarequestframe.aspx inside your site $gateway->setLanguage('en'); $response = $gateway->purchase()->send(); // generate unique URL return [ 'redirectUrl' => $response->getRedirectUrl() // redirection to previously generated unique URL ]; }
- Completeng Payment
You will be redirected to AmeriaBank VPOS form page. After filling and submitting credit card data AmeriaBank page will webhook http://example.com/xxx (refer to also to point 2)
$gateway = Omnipay::create('Ameriabank'); $gateway->setClientId('Client_ID'); // Shoud be your Ameriabank Client ID (e.g. 7e7ef8ff-6300-4a78-bb31-3ad1a8c67d5f) $gateway->setUsername('Username'); // Should be your Ameria Username $gateway->setPassword('Password'); // Should be your Ameria password $gateway->setOrderId('Order_ID'); // Is randomly generated ID. Integer which is generated by using system local time e.g. time() $gateway->setTestMode(false); // Boolean and can be only true or false $$webService = $gateway->completePurchase([ 'amount' => '100' ] )->getPaymentFields(); if ($paymentFields = $webService->GetPaymentFieldsResult) { // Your logic return $paymentFields; } return $webService; // Return error text in case of connection errors
For testing puposes you should use only AMD currency and charge not more than 10 AMD
For general usage instructions, please see the main Omnipay repository.
Support
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
haykkarapetyan/omnipay-ameriabank 适用场景与选型建议
haykkarapetyan/omnipay-ameriabank 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.98k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 07 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 haykkarapetyan/omnipay-ameriabank 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 haykkarapetyan/omnipay-ameriabank 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-04