承接 paga/paga-business 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

paga/paga-business

Composer 安装命令:

composer require paga/paga-business

包简介

This document lists the different RESTful web services Paga offers to businesses and guide’s you in setting up these services.

README 文档

README

Business Services exposed by the library

  • registerCustomer
  • registerCustomerAccountPhoto
  • registerCustomerIdentification
  • moneyTransfer
  • airtimePurchase
  • merchantPayment
  • validateDepositToBank
  • depositToBank
  • accountBalance
  • transactionHistory
  • recentTransactionHistory
  • getMerchants
  • getMerchantServices
  • getBanks
  • getOperationStatus
  • getMobileOperators
  • onboardMerchant
  • moneyTransferBulk

For more information on the services listed above, visit the Paga DEV website

How to use

composer require paga/paga-business

require_once __DIR__ .'/vendor/autoload.php'


$businessClient = PagaBusinessClient::builder()
                ->setApiKey("<apiKey>")
                ->setPrincipal("<publicId>")
                ->setCredential("<password>")
                ->setTest(true)
                ->build();

As shown above, you set the principal and credential given to you by Paga, If you pass true as the value for setIsTest(), the library will use the test url as the base for all calls. Otherwise setting it to false will use the live url value you pass as the base.

Business Service Functions

Register Customer

The Register Customer operation allows 3rd Parties to register customers on Paga. New customers will be contacted to setup their authentication credentials. To make use of this function, call the registerCustomer inside the BusinessClient which will return a JSONObject for the registered customer.

$response = $businessClient ->registerCustomer(
    "referenceNumber",
    "customerPhoneNumber",
    "customerFirstName",
    "customerLastName",
    "customerEmail",
    "customerDateOfBirth",
)

Register Customer Account Photo

An operation for a business to upload an account photo for a customer account that it has registered. This is useful in case the account photo is not available or the upload fails or is rejected during the initial registration attempt. To make use of this function, call the registerCustomerAccountPhoto function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient ->registerCustomerAccountPhot(
  $reference_number,
  $customerPhoneNumber,
  $passportPhoto_path
);

Register Customer Identification

An operation for a business to upload an identification photo for a customer account that it has registered. To make use of this function, call the registerCustomerIdentification function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient -> registerCustomerIdentification(
  $reference_number,
  $customerPhoneNumber, 
  $customerIdType, 
  $customerIdNumber,
  $customerIdExpirationDate, 
  $idPhoto_path
);

Money Transfer

The Money Transfer operation enables an integrated 3rd party to utilize the Paga platform to transfer funds from a variety of sources to another party. The funds transfer may be executed from the accounts of the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the sender's Paga account or another source that the sender has pre-registered on the Paga platform. To make use of this function, call the moneyTransfer inside the BusinessClient Library which will return a JSONObject for the money transferred.

$response = $businessClient ->moneyTransfer(
  $referenceNumber,
  $amount, 
  $destinationAccount,
  $senderPrincipal, 
  $senderCredentials,
  $currency
  );

Airtime Purchase

The Airtime Purchase operation enables an integrated 3rd party to utilize the Paga platform to purchase airtime for any phone number on any of the major networks. The purchase can be funded by the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the purchaser's Paga account or another source that the sender has pre-registered on the Paga platform. To make use of this function, call the airtimePurchase function inside the BusinessClient Library which will return a JSONObject for the airtime purchased.

$response = $businessClient ->airtimePurchase(
  $referenceNumber,
  $amount,
  $phoneNumber
);

Merchant Payment

The Merchant Payment operation enables an integrated 3rd party to utilize the Paga platform to make payments to registered merchants. The purchase can be funded by the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the purchaser's Paga account or another source that the sender has pre-registered on the Paga platform. To make use of this function, call the merchantPayment function inside the BusinessClient Library which will return a JSONObject for the merchant payment.

$response = $businessClient-> merchantPayment($reference_number, 
  $amount, 
  $merchantAccount, 
  $merchantReferenceNumber, 
  $currency, 
  $merchantService
);

Validate Deposit to Bank

The Validate Deposit To Bank operation enables an integrated 3rd party to pre-validate a potential deposit to bank operation using similar parameters that would be provided for the actual deposit to bank operation. This will return a result indicating whether the actual deposit to bank operation using the same parameters is likely to be successful or not, and if not, why not. This will also validate the bank account number for the bank provided and return the account holder name for that account as stored at the bank. This will also return any fees that would be charged as part of the actual deposit to bank operation.To make use of this function, call the validateDepositToBank function inside the BusinessClient Library which will return a JSONObject for the validate deposit to bank.

$response = $businessClient-> validateDepositToBank(
  $reference_number, 
  $amount, 
  $destinationBankUUID, 
  $destinationBankAccountNumber
  );

Deposit To Bank

The Deposit To Bank operation enables an integrated 3rd party to utilize the Paga platform to deposit funds to any bank account. The funds will be deposited from the businesses Paga account to the bank via the bank account specified in the operation parameters. To make use of this function, call the depositToBank function inside the BusinessClient Library which will return a JSONObject for the deposit to bank.

$response = $businessClient-> depositToBank(
  $reference_number, 
  $amount,
  $destinationBankUUID, 
  $destinationBankAccountNumber, 
  $recipientPhoneNumber, 
  $currency
  )

Account Balance

The Account Balance operation enables an integrated 3rd party to utilize the Paga platform to check the balance of a Paga account or any other account type pre-registered on the Paga platform, which support balance inquiries. The account balance check may be executed for the account(s) of the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. To make use of this function, call the accountBalance function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient-> accountBalance($reference_number);

Transaction History

The Transaction History operation enables an integrated 3rd party to utilize the Paga platform to check the transaction history of their Paga account between selected date ranges. The transaction history may be executed on the account(s) of the integrated 3rd party, or on behalf of another customer with the appropriate authentication. Transactions results are limited to the most recent 10,000 results. To make use of this function, call the transactionHistory function inside the BusinessClient Library which will return a JSONObject for the transaction history.

$response = $businessClient-> transactionHistory($reference_number);

Recent Transaction History

The Recent Transaction History operation enables an integrated 3rd party to utilize the Paga platform to check the last 5 transactions on their Paga account. The recent transaction history may be executed for the account(s) of the integrated 3rd party or on behalf of another customer with the appropriate authentication. To make use of this function, call the recentTransactionHistory function inside the BusinessClient Library which will return a JSONObject for the recent transaction history.

$response = $businessClient-> recentTransactionHistory($reference_number);

Get Merchants

The Get Merchants operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of registered merchants on the Paga platform, typically for use in parameterizing the merchant payment operation. To make use of this function, call the getMerchants function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient-> getMerchants($reference_number);

Get Merchant Services

The Get Merchants Services operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of registered services and service details for a given registered merchant on the Paga platform, typically for use in parameterizing the merchant payment operation. To make use of this function, call the getMerchantServices function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient-> getMerchantServices(
  $reference_number, 
  $merchantPublicId
  );

Get Banks

The Get Banks operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of available banks on the Paga platform, typically for use in parameterizing the deposit to bank operation. To make use of this function, call the getBanks function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient-> getBanks($reference_number);

Get Operation Status

The Get Operation Status operation allows an integrated 3rd party to check on the status of a previous operation using the operation's reference number. To make use of this function, call the getOperationStatus function inside the BusinessClient Library which will return a JSONObject.

$response = $businessClient -> getOperationStatus($reference_number);
  

Get Mobile Operators

The Get Mobile Operators operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of available mobile operators on the Paga platform, typically for use in parameterizing the various operations of the business api. To make use of this function, call the getMobileOperators function inside the BusinessClient Library which will return a JSON Object .

$response = $businessClient -> getMobileOperators($reference_number);

Bulk Money Transfer

The Bulk Money Transfer operation enables an integrated 3rd party to utilize the Paga platform to execute the money transfer operation described above to multiple recipients simultaneously. This is limited to 300 payment items per bulk operation. To make use of this function, call the moneyTransferBulk function inside the BusinessClient Library which will return a JSON Object.

$bulkReferenceNumber = "ref-123";
$items_arr = array(
                   array('referenceNumber'=>$referenceNumber_1,
                        'amount'=>$amount_1,
                        'destinationAccount'=>$phonenumber_1,
                        'senderPrincipal'=>$senderPrincipal_1,
                        'senderCredentials'=>$senderCredentials_1,
                        'currency'=>$currency_1
                   ),

                   array('referenceNumber'=>$referenceNumber_2,
                         'amount'=>$amount_2,
                         'destinationAccount'=>$phonenumber_2,
                         'senderPrincipal'=>$senderPrincipal_2,
                         'senderCredentials'=>$senderCredentials_2,
                         'currency'=>$currency_2
                   )
						);
$response = $businessClient -> moneyTransferBulk($bulkReferenceNumber, $items_arr);

Click here for more info on MoneyTransferItem

Onboard Merchant

The Onboard Merchant operation, allows Aggregator Organisations to create sub organisations on the paga platform.

This operation is only available to Merchant aggregators on the Paga platform.

$legalEntity = array (
    "name"=> "",
    "description"=>"",
    "addressLine1"=>"",
    "addressLine2"=>"",
    "addressCity"=>"",
    "addressState"=>"",
    "addressZip"=>"",
    "addressCountry"=>"");

$legalEntityRepresentative = array (
    "firstName"=>"",
    "lastName"=>"",
    "dateOfBirth"=>"",
    "phone"=>"",
    "email"=>""
);

$integration = array(
    "type"=>""
);

$merchantInfo = array( "legalEntity"=> legalEntity, "legalEntityRepresentative"=> $legalEntityRepresentative);

$response = $businessClient_test -> onboardMerchant($reference, $merchantExternalId, $merchantInfo, $integration);

Click here to get more info on OnboardMerchant.

Packagist Downloads Packagist License Packagist PHP Version Support Packagist Version

paga/paga-business 适用场景与选型建议

paga/paga-business 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「payment」 「Paga」 「paga-business」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 paga/paga-business 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 paga/paga-business 我们能提供哪些服务?
定制开发 / 二次开发

基于 paga/paga-business 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-04