nickcheek/privacy-wrapper
Composer 安装命令:
composer require nickcheek/privacy-wrapper
包简介
PHP Api wrapper for Privacy API
README 文档
README
Just a small PHP API wrapper for privacy.com
Installation
You can install the package via composer:
composer require nickcheek/privacy-wrapper
Usage
// Include the library and then call it $privacy = new PrivacyWrapper('your-api-code-from-privacy'); var_dump($privacy->User()->enroll($first_name, $last_name, $dob, $street1, $street2 = null, $zipcode, $ssn_last_four, $phone_number = null, $email = null)); //Note: dob should be as an ISO 8601 date, phone should be in E.164 format //Funding Methods var_dump($privacy->Funding()->addBank($routingNumber, $accountNumber, $accountName)); var_dump($privacy->Funding()->listFundingSources()); var_dump($privacy->Funding()->listFundingBanks()); var_dump($privacy->Funding()->listFundingCards()); //Card Methods var_dump($privacy->Card()->createCard($token = '', $type = 'SINGLE_USE', $spend_limit = 10000, $limit_duration = 'FOREVER', $state = 'OPEN')); var_dump($privacy->Card()->updateCard($card_token, $memo = null, $state = 'OPEN', $funding_token = '', $spend_limit = 10000, $spend_limit_duration = 'FOREVER')); var_dump($privacy->Card()->listCards()); // Note: // Available Types: SINGLE_USE, MERCHANT_LOCKED, UNLOCKED // Available Spend Limit Duration: TRANSACTION, MONTHLY, ANNUALLY, FOREVER // Available State: OPEN, PAUSED //Simulate Methods (requires sandbox API) // to use sandbox, pass it through the Service Call, if left blank, it will use the live url. var_dump($privacy->Simulate('sandbox')->authorize(string $descriptor, int $pan, int $amount)); var_dump($privacy->Simulate('sandbox')->void(string $token, int $amount)); var_dump($privacy->Simulate('sandbox')->clearing(string $token, int $amount)); //return is equivelant of refund var_dump($privacy->Simulate('sandbox')->return(string $descriptor, int $pan, int $amount));
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email nick@nicholascheek.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-17