pickupman / linx-pay
适用于Linx支付平台的支付处理
1.0.0
2017-03-12 19:54 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-29 04:14:25 UTC
README
PHP客户端库,用于对LinxPAY系统进行API请求。
安装
composer require pickupman/linx-pay
使用
此库将处理OAuth2流程以检索和维护访问令牌。
初始化类
$options = [ 'username' => 'Your Username', 'password' => 'Your Password', 'client_id' => 'Your API Client ID', 'client_secret' => 'Your API Client Secret' ]; $linx = new Pickupman\LinxPay($options);
轮询API调用
$poll = $linx->poll(); var_dump($poll); // JSON response object {'success' : true }
兑换API调用
$redemption = $linx->redemption([ 'linx_card_number' => '1234567890123456', 'customer' => [ 'type' => 'drivers_license', 'name' => 'John Smith', 'id_number' => '1234', // drivers license number 'state' => 'Colorado' // drivers license State ], 'product_type' => 'medicinal', // or recreational 'store_location' => [ 'name' => 'Dispensary Name' ], 'budtender' => [ 'name' => 'David Smith' ], 'amount' => '200.00' ]); var_dump($redemption); // JSON response object