tdanielcox/bluesnap-php
最新稳定版本:v0.2.2
Composer 安装命令:
composer require tdanielcox/bluesnap-php
包简介
A PHP Library for the Bluesnap api
README 文档
README
NOTE this library is not production ready as my company decided against using bluesnap shortly after starting this project. Please feel free to fork it and make it fit your needs, all endpoints are working as of June 2017, however the library is missing several features that bluesnap offers. Development and maintence on this project has been discontinued.
This (unofficial) library standardizes and simplifies working with the bluesnap api.
All the standard api documentation is applicable to this library.
View the bluesnap documentation here: https://developers.bluesnap.com/v8976-JSON/docs
This library currently supports:
- CardTransactions
- VaultedShoppers
- Vendors
- Subscriptions
- Plans (Subscriptions)
- Refunds
- Reports
Installation
Install this package with composer
composer require tdanielcox/bluesnap-php
Usage
Initialize the library in your class constructor
public function __construct() { $environment = 'sandbox'; // or 'production' \tdanielcox\Bluesnap\Bluesnap::init($environment, 'YOUR_API_KEY', 'YOUR_API_PASSWORD'); }
Create a New Transaction
public function createTransaction() { $response = \tdanielcox\Bluesnap\CardTransaction::create([ 'creditCard' => [ 'cardNumber' => '4263982640269299', 'expirationMonth' => '02', 'expirationYear' => '2018', 'securityCode' => '837' ], 'amount' => 10.00, 'currency' => 'USD', 'recurringTransaction' => 'ECOMMERCE', 'cardTransactionType' => 'AUTH_CAPTURE', ]); if ($response->failed()) { $error = $response->data; // handle error } $transaction = $response->data; return $transaction; }
See examples for further details on using the library
License
This package is licensed under the MIT License
统计信息
- 总下载量: 33.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-21