okyayaykut / omnipay-gvp
Omnipay支付处理库的Gvp(Garanti, Denizbank, TEB, ING, Şekerbank, TFKB虚拟POS)网关
3.2.3
2019-08-21 12:38 UTC
Requires
- php: ^5.6|^7
- ext-simplexml: *
- omnipay/common: ~3.0
Requires (Dev)
- omnipay/tests: ~3.0
README
Omnipay支付处理库的Gvp(Garanti, Denizbank, TEB, ING, Şekerbank, TFKB虚拟POS)网关
Omnipay 是一个适用于PHP 5.3+的框架无关的多网关支付处理库。此包实现了Omnipay对Gvp(土耳其支付网关)的支持。
Gvp(Garanti, Denizbank, TEB, ING, Şekerbank, TFKB)虚拟POS服务使用的Omnipay库。
安装
composer require okyayaykut/omnipay-gvp
基本用法
此包提供以下网关
- Gvp
- Garanti
- Denizbank
- TEB
- ING
- Şekerbank
- TFKB
网关方法
- authorize($options) - 在客户的卡上授权一定金额
- capture($options) - 捕获之前已授权的金额
- purchase($options) - 授权并立即在客户的卡上捕获金额
- refund($options) - 退款已处理的交易
- void($options) - 通常只能在提交交易后24小时内调用
有关一般使用说明,请参阅主要的 Omnipay 存储库。
单元测试
PHPUnit 是一个面向程序员的PHP测试框架。它是xUnit单元测试框架架构的一个实例。
示例应用
<?php defined('BASEPATH') OR exit('No direct script access allowed');
use Omnipay\Omnipay;
class GvpTest extends CI_Controller {
public function index() {
$gateway = Omnipay::create('Gvp');
$gateway->setMerchantId("7000679");
$gateway->setTerminalId("30691297");
$gateway->setUserName("PROVAUT");
$gateway->setPassword("123qweASD");
$gateway->setRefundUserName("PROVRFN");
$gateway->setRefundPassword("123qweASD");
$gateway->setTestMode(TRUE);
$options = [
'number' => '4824894728063019',
'expiryMonth' => '06',
'expiryYear' => '2017',
'cvv' => '959'
];
$response = $gateway->purchase(
[
//'installment' => '2', # Taksit
//'multiplepoint' => 1, // Set money points (Maxi puan gir)
//'extrapoint' => 150, // Set money points (Maxi puan gir)
'amount' => 100.00,
'orderid' => '',
'card' => $options
]
)->send();
$response = $gateway->authorize(
[
'orderid' => 'asd2',
'transactionId' => '111111111111',
'amount' => 10.00,
'card' => $options
]
)->send();
//
$response = $gateway->capture(
[
'transactionId' => '111111111111',
'amount' => 1.00,
'currency' => 'TRY',
'card' => $options
]
)->send();
$response = $gateway->refund(
[
'transactionId' => '111111111111',
'amount' => 1.00,
'currency' => 'TRY',
'card' => $options
]
)->send();
$response = $gateway->void(
[
'transactionId' => '111111111111',
'authcode' => '123123',
'amount' => 1.00,
'currency' => 'TRY',
'card' => $options
]
)->send();
if ($response->isSuccessful()) {
//echo $response->getTransactionReference();
echo $response->getMessage();
} else {
echo $response->getError();
}
// Debug
//var_dump($response);
}
}
支持
如果您在使用Omnipay时遇到一般问题,我们建议您在 Stack Overflow 上发布帖子。请确保添加 omnipay 标签,以便可以轻松找到。
如果您想了解最新发布公告、讨论项目想法或提出更详细的问题,还有一个您可以订阅的 邮件列表。
如果您认为您发现了一个错误,请使用 GitHub问题跟踪器 报告它,或者更好的是,分叉库并提交拉取请求。