h2akim/billplz

BillPlz 支付软件 API

1.0.0 2016-08-11 05:37 UTC

This package is not auto-updated.

Last update: 2024-09-26 03:22:10 UTC


README

BillPlz 支付软件 API 的简单库

入门指南

Composer

composer require h2akim/billplz:*

如何使用

创建新的收款集合

创建收款集合可用的参数

  • 标题
  • logo (可选) - (未测试)
  • split_payment[email] (可选)
  • split_payment[fixed_cut] (可选)
  • split_payment[variable_cut] (可选)
  • object (可选) - 返回对象(如果为 true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->collection()->create([
	'title' => 'My Collection'
]);

创建新的公开收款集合

创建公开收款集合可用的参数

  • 标题
  • 描述
  • 金额
  • fixed_amount (可选)
  • fixed_quantity (可选)
  • payment_button (可选)
  • reference_1_label (可选)
  • reference_2_label (可选)
  • email_link (可选)
  • tax (可选)
  • photo (可选) - (未测试)
  • split_payment[email] (可选)
  • split_payment[fixed_cut] (可选)
  • split_payment[variable_cut] (可选)
  • object (可选) - 返回对象(如果为 true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->collection()->createOpen([
	'title' => 'My Collection',
	'description' => 'My Open Collection Description',
	'amount' => 100 // RM1.00
]);

创建新的账单

创建账单可用的参数

  • collection_id
  • email
  • mobile
  • 姓名
  • 金额
  • 回调 URL
  • 描述
  • due_at (可选)
  • redirect_url (可选)
  • deliver (可选) - SMS 如果设置为 true (RM0.15)
  • reference_1_label (可选)
  • reference_1 (可选)
  • reference_2_label (可选)
  • reference_2 (可选)
  • auto_submit (可选) - 跳过 BillPlz 页面。 [ 值: fpxpaypal ]
  • object (可选) - 返回对象(如果为 true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->create([
	'collection_id' => 'your-collection-id',
    'email' => 'your.client@email.com',
    'mobile' => '60123456789',
    'name' => 'Mak Jemah',
    'due_at' => '1991-4-21',
    'amount' => 5000, // RM50
    'callback_url' => "http://my-website-with-comic-sans.com/return_url"
]);

检索账单

检索账单可用的参数

  • bill_id (必需)
  • object (可选) - 返回对象(如果为 true)
  • auto_submit (可选) - 跳过 BillPlz 页面。 [ 值: fpxpaypal ]
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->get([
	'bill_id' => 'your-bill-id',
]);

删除账单

删除账单可用的参数

  • bill_id (必需)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->delete([
	'bill_id' => 'your-bill-id',
]);