商家API包/paga-merchant

PAGA 商户API平台公开了商户用于向自身或第三方客户提供PAGA服务的操作。

v1.0.1 2020-05-04 01:40 UTC

This package is auto-updated.

Last update: 2024-09-04 21:55:49 UTC


README

库公开的商户服务

  • getTransactionDetails
  • getTransactionDetailsByInvoiceNumber
  • getProcessDetails
  • reconciliationReport
  • getForeignExchangeRate
  • refundBillPay

有关上述服务的更多信息,请访问Paga 开发者网站

如何使用

composer require paga/paga-merchant

include("PagaMerchantServiceClient.php");

$merchantServiceClient = PagaMerchantServiceClient::builder()
    ->setApiKey("<apiKey>")
    ->setPrincipal("<clientId>")
    ->setCredential("<password>")
    ->setTest(true)
    ->build();

如上所示,您设置Paga提供的主体和凭证,如果将setIsTest()的值传递为true,则库将使用测试URL作为所有调用的基本URL。否则,将其设置为false将使用您传递的实时URL值作为基本URL。

商户服务函数

获取交易详情

为了验证执行过程的状况和详情,或确定是否在系统上使用预先共享的交易参考号执行了交易,请在PagaMerchantClient中调用getTransactionDetails函数,它返回JSONObject。

$response=$merchantServiceClient -> getTransactionDetails("<referenceNumber>");

通过发票号获取交易详情

为了验证执行过程的状况和详情,或确定是否在系统上使用预先共享的交易发票号执行了交易,请在PagaMerchantClient中调用getTransactionDetailByInvoiceNumber函数,它返回JSONObject。

$response=$merchantServiceClient -> getTransactionDetailsByInvoiceNumber("<invoice_Number>");

获取过程详情

为了确定是否在系统上使用预先共享的过程代码执行了过程,请在PagaMerchantClient中调用getProcessDetail函数,它返回JSONObject Response。

$response=$merchantServiceClient -> getProcessDetails("<process_code>");

对账报告

要检索包含过程和交易列表的指定日期范围内的对账报告,请在PagaMerchantClient中调用reconciliationReport函数,它返回JSONObject Response。请注意,您的日期参数应传递此格式的日期:"YYYY-MM-DD"。

$response=$merchantServiceClient -> reconciliationReport('2015-01-30','2016-01-30');

获取外汇汇率

为了确定汇率,请在PagaMerchantClient中调用getForeignExchange函数,它返回JSONObject Response。

$response=$merchantServiceClient -> getForeignExchangeRate('NGN','USD');

退款账单支付

为了全额或部分退款客户先前进行的账单支付,请在PagaMerchantClient中调用refundBillPay函数,它返回JSONObject Response。

$response=$merchantServiceClient -> refundBillPay('<reference_Number>','<refund_amount','<customerPhoneNumber>');

通过商户参考号获取交易详情

此服务允许商户验证执行交易的状况和详情,或确定是否在系统上使用商户参考号执行了交易。检查多个用户交易状态的商户聚合器应使用此方法。

$response=$merchantServiceClient -> getTransactionDetailsByMerchantReference('<merchantReference>');