elvanto / omnipay-tithely
Omnipay支付处理库的Tithe.ly驱动程序
Requires
- php: >=5.6.0
- omnipay/common: ~3.0
Requires (Dev)
- omnipay/tests: ~3.0
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-09-21 23:22:52 UTC
README
Omnipay支付处理库的Tithe.ly驱动程序
Omnipay 是一个不依赖于框架的多网关支付处理库,适用于PHP 5.6+。此包实现了对Omnipay的Tithe.ly支持。
安装
通过Composer
$ composer require elvanto/omnipay-tithely
版本
从v2.0.0版开始,本包支持Omnipay 3.x版本。
用法
本包提供以下网关
- Tithe.ly(快速充值)
有关通用使用说明,请参阅主要的 Omnipay 存储库。
特定使用说明
Omnipay tithely 是一个API中间件,用于简化对 Tithe.ly Quick-Charge v1 及更高版本的请求。此Tithe.ly API允许用户创建支付请求而无需创建账户。
创建支付请求。
Tithe.ly支付网关
验证数据,如我们的 Tithe.ly组织ID tithely_org_Id
、Tithe.ly公开的tithely_public
和秘密tithely_secret
密钥 作为我们网关请求的一部分存在。此外,网关还以字符串形式接受我们的 捐赠类型 giving_type
字段。
网关细节通过以下函数设置
$gateway->setPublicKey($tithely_public); // Required $gateway->setPrivateKey($tithely_secret); // Required $gateway->setOrganizationId($tithely_org_Id); // Required $gateway->setGivingType("Offering"); // Required
请求体
与常规使用Tithe.ly快速充值API不同,omnipay/tithely API对象在请求中需要包含一个卡片对象,以传递我们的first_name
、last_name
和email
。而token
、description
、currency
存在于请求对象的主体中。
对于omnipay / tithely,currency
字段在$request
主体中是必需的。
$request["card"] = new CreditCard(array( "first_name" => $first_name, // Required "last_name" => $last_name, // Required "email" => $email // Required )); $request["token"] = $token; // Stripe token. Required $request["amount"] = "10.00"; // Required $request["description"] = "Donation to church."; $request["currency"] = $currency; //e.g. "USD" "CAD" "AUD" Required $gateway = Omnipay::create('Tithely'); $tithely_public = "pub_*****"; // Required $tithely_secret = "pri_*****"; // Required $tithely_org_Id = "org_*****"; // Required $gateway->setPublicKey($tithely_public); // Required $gateway->setPrivateKey($tithely_secret); // Required $gateway->setOrganizationId($tithely_org_Id); // Required $gateway->setGivingType("Offering"); // Required $response = $gateway->purchase($request)->send();
访问响应对象。
$reponse
作为受保护的对象。要访问响应,请使用odadmnipay函数的getRequest
和getData()
。
$response->getRequest()->getData()["first_name"];
支持
如果您在使用Omnipay时遇到一般问题,我们建议在 Stack Overflow 上发布帖子。请确保添加 omnipay标签,以便可以轻松找到。
如果您想了解发行公告,讨论项目的想法或提出更详细的问题,还可以订阅 邮件列表。
如果您认为您已发现一个错误,请使用 GitHub问题跟踪器 报告它,或者更好的是,分支库并提交一个pull请求。
测试
$ composer test
贡献
请参阅 CONTRIBUTING 以获取详细信息。
安全
如果您发现任何与安全相关的问题,请通过 developers@elvanto.com 发送电子邮件,而不是使用问题跟踪器。
许可
MIT许可(MIT)。请参阅 许可文件 以获取更多信息。