payrex/payrex-php
最新稳定版本:v1.8.2
Composer 安装命令:
composer require payrex/payrex-php
包简介
PayRex PHP Library
README 文档
README
PayRex PHP library provides PHP applications an easy access to the PayRex API. Explore various PHP classes that represents PayRex API resources on object instantiation.
Check example.php see usage examples.
Requirements
PHP 5.6.0 and later.
Composer
You can install the library via Composer. Run the following command:
composer require payrex/payrex-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Manual Installation
If you prefer to manually install the library instead of using composer, you can download the latest release. Then, to use the bindings, include the initialize.php file.
require_once('/path/to/payrex-php/initialize.php');
Dependencies
The bindings require the following extensions in order to work properly:
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that the required extensions are available.
Getting Started
Simple usage looks like:
$client = new \Payrex\PayrexClient('Your PayRex secret api key'); $paymentIntent = $client->paymentIntents->create([ 'amount' => 10000, 'currency' => 'PHP', 'payment_methods' => ['card'] ]); echo $paymentIntent->id;
Handle errors
try { $client = new \Payrex\PayrexClient('Your PayRex secret api key'); $paymentIntent = $client->paymentIntents->create([ 'amount' => 10000, 'currency' => 'PHP', 'payment_methods' => ['card'] ]); } catch(\Payrex\Exceptions\InvalidRequestException $e) { print "<pre>"; print_r($e->getError()); print "</pre>"; }
统计信息
- 总下载量: 20.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 未知