peopleapps-dev / ticketasa-visa-omnipay-package
Ticketasa 支持的 omnipay 支付处理库
V1.0.0
2023-04-13 19:41 UTC
Requires
- php: ^7.2
- omnipay/common: ^3
This package is not auto-updated.
Last update: 2024-09-26 20:42:08 UTC
README
TicketAsaGT Commerce 网关,用于 Omnipay PHP 支付处理库
Omnipay 是一个与框架无关、多网关的 PHP 5.3+ 支付处理库。本包实现了 Omnipay 对 TicketAsaGT 2.4 的支持。
安装
通过 Composer
$ composer require peopleapps-dev/ticketasa-visa-omnipay-package
网关操作默认值
此网关驱动程序默认以 3DS 模式运行,并需要通过 'setNotifyURL' 方法提供通知 URL。
用法
有关一般使用说明,请参阅主 Omnipay 仓库。
3DS 交易(直接集成)
'NotifyURL' 必需。URL 必须是 https://
use Omnipay\Omnipay; try { $gateway = Omnipay::create('Ticketasavisa'); $gateway ->setTestMode(true) // false to use productions links , true to use test links ->setMerchantId('xxxxxxxx') ->setPublicKey('xxxxxxxx') ->setPrivateKey('xxxxxxxx') // **Required and must be https:// ->setNotifyUrl('https:///webhook.php') // **Required and must be https:// ->setReturnUrl('https:///webhook.php') ->setDiscount(false); $cardData = [ 'firstName' => 'Gabriel', //optional 'LastName' => 'Arzu', // optional ]; $transactionData = [ 'card' => $cardData, 'amount' => '1.00', // Mandatory 'TransactionId' => '2100001', // mandatory, must be unique in each transaction ]; $response = $gateway->purchase($transactionData)->send(); if($response->isSuccessful()) $response->getHostedPageURL(); // return the link with encrypted params $response->redirectToHostedPage(); //Redirect automatically to payment form } catch (Exception $e){ $e->getMessage(); }
webhook 响应 TicketasaGT 的响应事务。
{
"clientReferenceInformation": {
"code": "VlISZ4VI2kKFcz07JELCTw2"
},
"id": "6638930703846085404953",
"orderInformation": {
"amountDetails": {
"totalAmount": "1.00",
"currency": "GTQ"
}
},
"reconciliationId": "6638927696246293304951",
"status": "PENDING",
"submitTimeUtc": "2022-09-23T00:31:10Z"
}
抓取状态事务(直接集成)
'fetchTransaction' 必需。TransactionId
use Omnipay\Omnipay; try { $gateway = Omnipay::create('Ticketasavisa'); $gateway ->setTestMode(true) // false to use productions links , true to use test links ->setMerchantId('xxxxxxxx') ->setPublicKey('xxxxxxxx') ->setPrivateKey('xxxxxxxx'); $transactionData = [ 'TransactionId' => '2100001', // mandatory, must be unique in each transaction ]; $response = $gateway->fetchTransaction($transactionData)->send(); $response->getData(); //return the response object $response->isSuccessful() // if IsoResponseCode is 00 return true $response->getTransactionId() // return transactionId from object response $response->getTotalAmount() // return Amount from object response $response->getAuthorizationCode() // return authorizationCode from object response $response->getLastCaptureDateTime() // return date capture payment from object response $response->getTransactionDateTime() // return date transaction payment from object response } catch (Exception $e){ $e->getMessage(); }
Visa Cybersource 响应 从 powerTranz 抓取事务的响应。
{
"success":true,
"message":"OK",
"statusCode":200,
"data":{
"id":"6814001314506170404951",
"rootId":"6814001314506170404951",
"reconciliationId":"6814001314506170404951",
"merchantId":"visanetgt_ticketasa",
"submitTimeUTC":"2023-04-13T15:35:31Z",
"applicationInformation":{
"status":"PENDING",
"reasonCode":"100",
"applications":[
{
"name":"ics_auth",
"reasonCode":"100",
"rCode":"1",
"rFlag":"SOK",
"reconciliationId":"6814001314506170404951",
"rMessage":"Request was processed successfully.",
"returnCode":1010000
}
]
},
"orderInformation":{
"amountDetails":{
"totalAmount":"1",
"currency":"GTQ",
"taxAmount":"0",
"authorizedAmount":"1"
}
},
"paymentInformation":{
"paymentType":{
"name":"vdcguatemala",
"type":"credit card",
"method":"VI"
},
"card":{
"suffix":"1005",
"prefix":"445653",
"expirationMonth":"12",
"expirationYear":"2031",
"type":"001"
}
},
"processingInformation":{
"paymentSolution":"Visa",
"commerceIndicator":"5",
"commerceIndicatorLabel":"vbv"
},
"processorInformation":{
"processor":{
"name":"vdcguatemala"
},
"networkTransactionId":"016153570198200",
"retrievalReferenceNumber":"310315180334",
"approvalCode":"831000",
"responseCode":"00"
},
"riskInformation":{
"profile":{
"name":"Perfil de Pruebas CVV2",
"decision":"ACCEPT"
},
"score":{
"factorCodes":[
"V",
"H",
"F"
],
"result":91
}
}
}
}
退款支付(直接集成)
'fetchTransaction' 必需。TransactionId,OrderIdentifier 和金额
use Omnipay\Omnipay; try { $gateway = Omnipay::create('Ticketasavisa'); $gateway ->setTestMode(true) // false to use productions links , true to use test links ->setMerchantId('xxxxxxxx') ->setPublicKey('xxxxxxxx') ->setPrivateKey('xxxxxxxx'); $transactionData = [ 'amount' => '1.00', // Mandatory 'TransactionId' => '6694214339196447904951', // mandatory, must be unique in each transaction 'OrderIdentifier' => '2100001', // mandatory, must be unique in each transaction ]; $response = $gateway->refund($transactionData)->send(); $response->getData(); //return the response object $response->isSuccessful(); // if Approved response $response->getIdentifier(); // return transactionId from object response $response->getTotalAmount(); // return Amount from object response $response->getOrderIdentifier(); // return transactionId from object response $response->getReconciliationIdentifier(); // return transactionId from object response $response->getStatus(); // return the iso Code $response->getResponseMessage(); // return the error general message } catch (Exception $e){ $e->getMessage(); }
Visa Cybersource 响应 从 powerTranz 退款事务的响应。
{
"success":true,
"message":"OK",
"statusCode":201,
"data":{
"id":"6814069291496607104953",
"submitTimeUtc":"2023-04-13T17:28:49Z",
"status":"PENDING",
"reconciliationId":"6814004474776245104951",
"clientReferenceInformation":{
"code":"68ef8f5d-f3d9-4ed2-98a6-a12f57dfa27f"
},
"refundAmountDetails":{
"refundAmount":"1.00",
"currency":"GTQ"
}
}
}
支持
如果您遇到 Omnipay 的一般问题,我们建议在 Stack Overflow 上发表帖子。请务必添加 omnipay 标签,以便轻松找到。
如果您认为您已发现一个错误,请使用 GitHub 问题跟踪器 报告它,或者更好的方法是,分支库并提交一个 pull request。