beepsolutions/beep-php
Composer 安装命令:
composer require beepsolutions/beep-php
包简介
PHP Bindings for the Beep API
README 文档
README
PHP API Client and bindings for the Beep Solutions API
Using this PHP API Client you can interact with your Beep Solutions:
- 💳 Transactions
Installation
Requires PHP 7.0 or higher
The recommended way to install Beep-php is through Composer:
First, install Composer:
$ curl -sS https://getcomposer.org/installer | php
Next, install the latest Beep-php:
$ php composer.phar require beepsolutions/beep-php
Finally, you need to require the library in your PHP application:
require "vendor/autoload.php";
Development
- Run
composer testandcomposer phpcsbefore creating a PR to detect any obvious issues. - Please create issues for this specific API Binding under the issues section.
- Contact Beep Solutions directly for Beep Solutions API support.
Quick Start
BeepPHP\Client
First get your production or sandbox API key from your Merchant Portal.
If you want to get a production client:
use BeepPHP\Client; $client = new Client('apikey', 'appid');
If you want to get a sandbox client:
use BeepPHP\Client; $client = new Client('apikey', 'appid', 'sandbox');
If you want to pass additional GuzzleHTTP options:
use BeepPHP\Client; $options = ['headers' => ['foo' => 'bar']]; $client = new Client('apikey', 'appid', 'sandbox', $options);
Available API Operations
The following exposed API operations from the Beep Solutions API are available using the API Client.
See below for more details about each resource.
💳 Transactions
Create a new transaction with or without a specific payment method.
Usage details
💳 Transactions
Create transaction with a specific payment method
use BeepPHP\Client; $client = new Client('apikey', 'appid'); $json = [ "provider" => "alipay", // Payment method enabled for your merchant account such as bcmc, alipay, card "currency" => "GBP", "amount" => 1000, // 10.00 GBP "redirectUrl" => "https://foo.bar/order/123" // Optional redirect after payment completion ]; $transaction = $client->transactions->create($json); header('Location: '. $transaction["url"]); // Go to transaction payment page for e-commerce or use the qrcode to display on external screens
Create transaction without a payment method that will redirect to the payment method selection screen
This method is only available for e-commerce enabled transactions
use BeepPHP\Client; $client = new Client('apikey', 'appid'); $json = [ "currency" => "SGD", "amount" => 1000, // 10.00 SGD "redirectUrl" => "https://foo.bar/order/987" // Optional redirect after payment completion ]; $transaction = $client->transactions->create($json); header('Location: '. $transaction["url"]); // Go to payment method selection screen
Get a list of transactions
This method is only available for e-commerce enabled transactions
use BeepPHP\Client; $client = new Client('apikey', 'appid'); $transactions = $client->transactions->list(['page' => 2]); // get the second page of transactions
Get a single transaction
This method is only available for e-commerce enabled transactions
use BeepPHP\Client; $client = new Client('apikey', 'appid'); $transactions = $client->transactions->get('12356'); // get the transaction with id 123456
About
⭐ Sign up as a merchant at https://beep.solutions and start receiving payments in seconds.
统计信息
- 总下载量: 2.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-18