cihansenturk/omnipay-gocardlessv2
Composer 安装命令:
composer require cihansenturk/omnipay-gocardlessv2
包简介
GoCardless gateway for Omnipay payment processing library, using the v2 GoCardless API
README 文档
README
Go Cardless driver for the Omnipay PHP payment processing library using the GoCardless v2 API
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements GoCardless support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply add it
to your composer.json file:
composer require digitickets/gocardlessv2:"^0"
Basic Usage
The following gateways are provided by this package:
- GoCardless Pro - Release Candidate
- GoCardless Pro (JS Flow) - Release Candidate
- GoCardless Redirect Flow - Alpha Release
Please let us know if you are using these release candidates in a production envrionment and we will make a formal release - until that time we may push breaking changes!
Don't know which gateway to use?
- If you are using GoCardless' own payment screens on their site you want the RedirectGateway.
- If you are using the GoCardless Javascript to process the card details and return a token then the JSFlowGateway is for you.
- If you are handling the bank account details on your own server (accepting the highest level of PCI responsibility) then the Pro Gateway is for you.
All the gateways wrap a common core with a lot of shared methods but they differ in mechanism for creating customers, bank accounts and mandates. Redirect returns you a mandate with customer / bank account created behind the scenes. JSFlow returns you a bank account token so you can create a customer, bank account and mandate yourself without handling the bank account details. Pro requires you to submit all the data yourself in individual steps. Creating a subscription or taking a single payment is common to all.
This is still in Development - Only the JS Flow gateway is currently stable.
You need to set your access_token. Setting testMode to true will use the sandbox environment.
This gateway supports single payments or scheduled subscriptions via bank mandate only. For more details about what this gateway supports please consult the documentation
For general usage instructions, please see the main Omnipay repository.
Driver specific usage
This driver supports multiple methods of implementation available via GoCardless. Please consult their documentation to confirm which methods are correct for your situation. Not all methods are applicable to every route. This driver does not provide access to the list methods - data may only be retrieved by primary key.
Create customer
$customer = $gateway->createCustomer([ 'customerData' => array( 'card' => new \Omnipay\Common\CreditCard( // use the standard omnipay card to hold the customer data [ 'firstName' => 'Mike', 'lastName' => 'Jones', 'email' => 'mike.jones@example.com', 'address1' => 'Iconic Song House, 47 Penny Lane', 'address2' => 'Wavertree', 'city' => 'Liverpool', 'company' => 'Mike Jones Enterprises', 'country' => 'GB', 'postal_code' => 'L18 1DE', 'state' => 'Merseyside', ] ), 'customerMetaData' => [ 'meta1' => 'Lorem Ipsom Dolor Est', 'meta2' => 'Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.', 'meta567890123456789012345678901234567890123456789' => 'Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.', ], 'swedishIdentityNumber' => '123', ), ])->send();
You can find full list of options here.
Find customer (By id)
$customer = $gateway->findCustomer(1)->send();
Parse webhook notification
$notification = $gateway->parseNotification( getallheaders(), file_get_contents('php://input'), 'MySecurityToken' ) ->send();
This will fetch the event associated with the web hook.
Process repeat billing
TODO - this. Use the standard repeatePurchase() format (see sagepay for example structure)
Suggested generic omnipay driver flow
We are exploring using a simplified set of functions to allow agnostic processing. Each step checks if the method exists on the driver and if it does call it accordingly, before calling getXyzRefernce and adding it to the data passed around. It is hoped that this structure should work with several major gateways - we have considered Stripe, Paypal and the various GoCardless options.
- CreateCustomer
- completeCustomer
- createPaymentMethod (either create card or create bank account)
- completePaymentMethod (either complete card or complete bank account)
- createMandate
- completeMandate
---- above this point is setting up the customer data (effectively taking it to the point of having an authorisation token), below is creating the transaction data
- createPlan
- completePlan
- createSubscription
- completeSubscription
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.
cihansenturk/omnipay-gocardlessv2 适用场景与选型建议
cihansenturk/omnipay-gocardlessv2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gocardless」 「pay」 「gateway」 「merchant」 「purchase」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cihansenturk/omnipay-gocardlessv2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cihansenturk/omnipay-gocardlessv2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cihansenturk/omnipay-gocardlessv2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GoCardless gateway for Omnipay payment processing library, using the v2 GoCardless API
Payyo Gateway for the Omnipay payment processing library
A client for the GoCardless Pro API
A php library for interfacing with the GoCardless Enterprise REST API. Please note this library is not for use with their standard API.
Includes Omnipay payment processing library and all officially supported gateways
Библиотека для приема платежей через Альфабанк.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-22