定制 brikmas/jazzcash-client-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

brikmas/jazzcash-client-php

最新稳定版本:v1.0.0

Composer 安装命令:

composer require brikmas/jazzcash-client-php

包简介

Jazzcash payment gateway client for PHP

README 文档

README

Jazzcash

Jazzcash payment gateway client for PHP

This client library provides access to the payment gateway web service interface of Jazzcash.

Requirements

  • PHP 5.4 or newer
  • CURL, JSON
  • Credential from Jazzcash

Installation

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

composer require brikmas/jazzcash-client-php

Init client

Replace sandbox with payments for production environment along credentials.

$client = new JazzClient([
    'apiBaseUrl' => 'https://sandbox.jazzcash.com.pk/',
    'merchantId' => 'xxxxxx',
    'password' => 'xxxxxx',
    'salt' => 'xxxxxx',
]);

Voucher/OTC request

Make sure the CallbackUrl is same as given in the Jazzcash portal.

$txn_ref_no = time();

$request = new VoucherReq();
$request->setAmount(10);
$request->setBillRefNumber($txn_ref_no);
$request->setDescription('Unit test case');
$request->setTxnRefNumber($txn_ref_no);
$request->setVersion('1.1');
$request->setTxnType('OTC');
$request->setCallbackUrl('http://localhost/gateway/jazzcash/callback');
$request->setCustomProperty('03331234567');

$response = $client->callVoucherService($request);
if ($response->pp_ResponseCode == 0) {
    // Handle success response
} 
else {
    // Handle fail response
}

Testing

Check the ClientTest class add your credentials and run test in order to see the keys are working fine. Make sure the keys are production, Unfortunately Jazzcash sandbox keys are not working as expected.

./vendor/bin/phpunit tests

Bug

If you've found a bug please feel free to open a ticket using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固