omnipay-paysafe-payment-hub
所属分类:collect
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2021-04-14 15:19:33
上 传 者:
sh-1993
说明: Paysafe支付中心的Omnipay网关,
(Omnipay gateway for Paysafe Payment Hub,)
文件列表:
.travis.yml (328, 2021-04-14)
LICENSE (1059, 2021-04-14)
code-coverage.php (902, 2021-04-14)
composer.json (880, 2021-04-14)
gitlabci/ (0, 2021-04-14)
gitlabci/docker_install.sh (568, 2021-04-14)
phpunit.xml (849, 2021-04-14)
src/ (0, 2021-04-14)
src/Exception/ (0, 2021-04-14)
src/Exception/RedirectUrlException.php (134, 2021-04-14)
src/Gateway.php (3025, 2021-04-14)
src/Message/ (0, 2021-04-14)
src/Message/Request/ (0, 2021-04-14)
src/Message/Request/CompletePurchaseRequest.php (3200, 2021-04-14)
src/Message/Request/FetchTransactionRequest.php (696, 2021-04-14)
src/Message/Request/GetPaymentHandleRequest.php (1162, 2021-04-14)
src/Message/Request/GetPaymentHandlesByMerchantReferenceNumberRequest.php (1290, 2021-04-14)
src/Message/Request/PurchaseRequest.php (4948, 2021-04-14)
src/Message/Request/Request.php (1932, 2021-04-14)
src/Message/Response/ (0, 2021-04-14)
src/Message/Response/CompletePurchaseResponse.php (288, 2021-04-14)
src/Message/Response/FetchTransactionResponse.php (749, 2021-04-14)
src/Message/Response/GetPaymentHandleResponse.php (585, 2021-04-14)
src/Message/Response/GetPaymentHandlesByMerchantReferenceNumberResponse.php (814, 2021-04-14)
src/Message/Response/PurchaseResponse.php (1302, 2021-04-14)
src/Message/Response/Response.php (779, 2021-04-14)
src/PaymentHandle.php (1247, 2021-04-14)
tests/ (0, 2021-04-14)
tests/GatewayTest.php (1822, 2021-04-14)
tests/Message/ (0, 2021-04-14)
tests/Message/CompletePurchaseTest.php (1927, 2021-04-14)
tests/Message/FetchTransactionTest.php (4131, 2021-04-14)
tests/Message/GetPaymentHandleTest.php (1484, 2021-04-14)
tests/Message/GetPaymentHandlesByMerchantReferenceNumberTest.php (4708, 2021-04-14)
tests/Message/Mock/ (0, 2021-04-14)
tests/Message/Mock/CompletePurchaseSuccess.txt (1409, 2021-04-14)
tests/Message/Mock/FetchTransactionFailure.txt (230, 2021-04-14)
... ...
# Omnipay: Paysafe Payment Hub
[![Build Status](https://travis-ci.org/worldstream-labs/omnipay-paysafe-payment-hub.svg?branch=master)](https://travis-ci.org/worldstream-labs/omnipay-paysafe-payment-hub) [![Latest Stable Version](https://poser.pugx.org/worldstream-labs/omnipay-paysafe-payment-hub/v)](//packagist.org/packages/worldstream-labs/omnipay-paysafe-payment-hub) [![Total Downloads](https://poser.pugx.org/worldstream-labs/omnipay-paysafe-payment-hub/downloads)](//packagist.org/packages/worldstream-labs/omnipay-paysafe-payment-hub) [![License](https://poser.pugx.org/worldstream-labs/omnipay-paysafe-payment-hub/license)](//packagist.org/packages/worldstream-labs/omnipay-paysafe-payment-hub)
Paysafe Payment Hub library for the Omnipay V3 payment library, used for Neteller (and Skrill later).
## Installation
Use composer to add the library as dependency for your project
`composer require league/omnipay worldstream-labs/omnipay-paysafe-payment-hub`
## Development
To set up for development:
`composer install`
## Usage
### Setup
```php
setApiKey('yourApiKey');
// When deploying to production, don't forget to set test mode to false
$gateway->setTestMode(false);
```
### Creating a payment handle for Neteller
```php
setApiKey('yourApiKey');
$response = $gateway->purchase([
'amount' => 11.00,
'currency' => 'EUR',
'successUrl' => 'https://url/success',
'failureUrl' => 'https://url/failure',
'returnUrl' => 'https://url/return',
'consumerId' => 'consumer@example.com',
'merchantRefNum' => 'abcdefg',
'description' => 'description',
'text' => 'text',
'paymentMethod' => 'neteller',
])->send();
redirect($response->getRedirectUrl());
```
This call will return the `PurchaseResponse` object. If the call is succesful then you can redirect the customer to the `redirectUrl`. Depending on the result in the next screen the customer will be redirected to the success or failure url.
Note: `consumerId` is optional in the request, don't forget to add `consumerIdLocked` with value `false` when leaving `consumerId` out.
### Finalize Payment
Before you can finalize the payment, make sure the payment handle is successfully created and payable using the `getPaymentHandle` call.
```php
setApiKey('yourApiKey');
$response = $gateway->getPaymentHandle([
'paymentHandleId' = $paymentHandleId,
])->send();
$paymentHandle = $response->getPaymentHandle();
if ($response->getPaymentHandle()->isPayable()) {
$completePurchaseResponse = $gateway->completePurchase([
'amount' => 11.00,
'currency' => 'EUR',
'paymentHandleToken' => $paymentHandle->getPaymentHandleToken(),
'merchantRefNum' => 'ref2',
'dupCheck' => false,
'settleWithAuth' => true,
'customerIp' => '172.0.0.1',
'description' => 'description',
])->send();
}
```
### Fetch transaction
```php
setApiKey('yourApiKey');
$response = $gateway->fetchTransaction([
'transactionId' => $webhook['payload']['id'],
])->send();
if ($response->isComplete()) {
// payment is complete
}
```
## Tests
Run the unit tests with `composer run test`
## Support
If you are having general issues with Omnipay, we suggest posting on
[Stack Overflow](http://stackoverflow.com/). Be sure to add the
[omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.
If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/worldstream-labs/omnipay-paysafe-payment-hub/issues),
or better yet, fork the library and submit a pull request.
## References
[Paysafe Payment Hub documentation](https://developer.paysafe.com/en/additional-documentation/neteller-migration-guide/api/#/reference/0/payment-handle/process-payments)
近期下载者:
相关文件:
收藏者: