popphp/pop-payment
最新稳定版本:2.1.0p1
Composer 安装命令:
composer require popphp/pop-payment
包简介
Pop Payment Component Pop PHP Framework
README 文档
README
END OF LIFE
The pop-payment component v2.1.0 is now end-of-life and will no longer be maintained.
OVERVIEW
pop-payment is a component for processing payments via some of the known payment processing gateway
vendors. It can also be extended to support other shipping vendors and their available APIs. Currently,
the built-in supported vendors are:
- Authorize.net
- PayLeap
- PayPal
- TrustCommerce
- USAEPay
The main idea is the "normalize" the the fields across the adapters so that the main interface has
common fields that are "translated" into the fields required for the selected adapter's API. So,
instead of having to worry that Authorize.net's credit card field is called x_card_num and
USAEPay's credit card field is UMcard, you just need to worry about the field cardNum and it'll
be mapped correctly to the adapter. The main common fields are:
| Common Fields | ||
|---|---|---|
| amount | city | shipToLastName |
| cardNum | state | shipToCompany |
| expDate | zip | shipToAddress |
| ccv | country | shipToCity |
| firstName | phone | shipToState |
| lastName | fax | shipToZip |
| company | shipToCountry | |
| address | shipToFirstName |
pop-payment is a component of the Pop PHP Framework.
INSTALL
Install pop-payment using Composer.
composer require popphp/pop-payment
BASIC USAGE
Creating a payment object
use Pop\Payment\Payment; use Pop\Payment\Adapter\Authorize; $payment = new Payment(new Authorize('API_LOGIN_ID', 'TRANSACTION_KEY'));
Using the payment object to process a transaction
$payment->amount = 41.51; $payment->cardNum = '4111111111111111'; $payment->expDate = '03/17'; $payment->firstName = 'Test'; $payment->lastName = 'Person'; $payment->company = 'Test Company'; $payment->address = '123 Main St.'; $payment->city = 'New Orleans'; $payment->state = 'LA'; $payment->zip = '70124'; $payment->country = 'US'; $payment->shippingSameAsBilling(); $payment->send(); if ($payment->isApproved()) { // If approved } else if ($payment->isDeclined()) { // If declined } else if ($payment->isError()) { // Some other unknown error echo $payment->getMessage(); }
统计信息
- 总下载量: 860
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: New
- 更新时间: 2014-12-08