zerosdev/paylabs-sdk-php
最新稳定版本:v1.1.2
Composer 安装命令:
composer require zerosdev/paylabs-sdk-php
包简介
Unofficial Paylabs.co.id Integration Kit for PHP
README 文档
README
Unofficial Paylabs.co.id Integration Kit for PHP
Requirements
- PHP v7.2+
- PHP JSON Extension
- PHP cURL Extension
Installation
- Run command
composer require zerosdev/paylabs-sdk-php
Usage
Notes
- The following payloads have been added automatically so you don't have to enter them manually
- requestId
- You can still enter your own requestId, otherwise we will generate random UUIDv4 for the requestId
- merchantId
- sign
- requestId
<?php require 'path/to/your/vendor/autoload.php'; use ZerosDev\Paylabs\Client as PaylabsClient; use ZerosDev\Paylabs\Support\Constant; use ZerosDev\Paylabs\VirtualAccount; $merchantId = '12345'; $apiKey = 'd1cfd***********888ed3'; $mode = Constant::MODE_DEVELOPMENT; $guzzleOptions = []; // Your additional Guzzle options (https://docs.guzzlephp.org/en/stable/request-options.html) $client = new PaylabsClient($merchantId, $apiKey, $mode, $guzzleOptions); $va = new VirtualAccount($client); $result = $va->create([ 'paymentType' => 'SinarmasVA', 'amount' => 10000, 'merchantTradeNo' => uniqid(), 'notifyUrl' => 'https://yourwebsite.com/payment/notify', 'payer' => 'Customer Name', 'goodsInfo' => 'Product Name' ]); echo $result->getBody()->getContents(); /** * For debugging purpose */ $debugs = $client->debugs(); echo json_encode($debugs, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
Please check the /examples for the other examples
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-22