gladefinance / gladephp
用于调用Gladefinance API的核心PHP库
v0.0.2
2023-11-13 09:21 UTC
Requires
- guzzlehttp/guzzle: ^7.8
README
要了解更多信息,请访问https://developer.gladefinance.co/docs
入门
您需要一个商户ID和密钥来验证API,请联系support@gladefinance.co设置演示账户。
安装
您可以选择关闭此项目并将类包含在您的项目中,或者您可以在composer.json文件中添加此仓库,如下例所示
{
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/gladepay-apis/gladephp"
}
],
"require": {
"gladefinance/gladephp": "^0.0.1"
}
}
或者只需在您的项目中运行以下命令
composer require gladefinance/gladephp
。
设置环境
require './vendor/autoload.php';
生产环境
$api = new Glade($merchantId, $merchantKey, true);
沙盒环境
$api = new Glade($merchantId, $merchantKey, false);
方法
BVN验证
$api->bvnValidation(string $bvnNumber);
获取可收费银行列表
$api->supportedChargeableBanks();
获取银行列表
$api->bankList();
验证账户名称
$api->verifyAccountName(string $accountNumber, string $bankCode, string $bankName);
获取个性化账户信息
$api->personalizedAccount(string $accountName, string $accountEmail, string $accountBvn, string $reference, string $channel = "providus");
创建客户
$api->createCustomer(string $name, string $email, string $phoneNumber, string $address);
获取所有客户
$api->getCustomers();
获取单个客户的详细信息
$api->getCustomerDetail(int $customerId);
获取所有账单类别
$api->getBillCategory(string $category = null);
获取账单ID
$api->getBillById(int $billId);
解决账单
$api->resolveBill(string $payCode, string $reference);
购买账单
$api->purchaseBill(string $payCode, int $amount, string $reference, string $orderReference = null);
验证账单购买
$api->verifyBillPurchase(string $transactionReference);
进行单笔转账
$api->transfer(int $amount, string $receiverAccountNumber, string $receiverBankCode, string $senderName, string $reference, string $narration);
验证单笔转账
$api->verifySingleTransfer(string $reference);
进行批量转账
$api->bulkTransfer(array $transferObjects);
创建支付链接
$api->createPaymentLink(string $title, string $description, int $amount, string $type, bool $payerBearsFees, bool $acceptNumber, string $notificationEmail, string $customLink = null, string $redirectUrl = null, string $customMessage = null, string $frequency = null);
创建工单
$api->createTicket(string $title, string $description, int $amount, string $type, bool $payerBearsFees, bool $acceptNumber, string $notificationEmail, array $ticketData, string $customLink = null, string $redirectUrl = null, string $customMessage = null, string $frequency = null);
创建发票
$api->invoice(int $customerId,bool $chargeUser, int $shipping, int $vat, string $dueDate, bool $allowedDiscount, array $invoiceItems, string $note, string $discountType= null, string $invoiceId);
返回值
所有方法都返回一个数组。