jinomdeveloper/payment-php-sdk
最新稳定版本:1.0.0
Composer 安装命令:
composer require jinomdeveloper/payment-php-sdk
包简介
Jinom Payment Gateway
README 文档
README
Installation
composer require jinomdeveloper/payment-php-sdk
Environment
U can set SERVER_KEY and Is it Production to JinomPayment class
example
$jinom_payment = new \Jinom\Payment\JinomPayment('YOUR SERVER_KEY', 'IS PRODUCTION');
or
if you using Laravel please use this config and save it as jinompay.php
<?php return [ "server_key" => env("JINOM_PAYMENT_KEY", ""), "is_production" => env("JINOM_PAYMENT_IS_PRODUCTION", false), "base_url" => env("JINOM_PAYMENT_IS_PRODUCTION", false) ? "https://payment.jinom.net" : "https://va.sandbox.jinom.net", ];
don't forget to add it to the .env.
JINOM_PAYMENT_KEY=
JINOM_PAYMENT_IS_PRODUCTION=
JINOM_PAYMENT_IS_PRODUCTION=
Implement the configuration
$jinom_payment = new \Jinom\Payment\JinomPayment(config('jinompay.server_key'), config('jinompay.is_production'));
Usage
<?php ... use Jinom\Payment\JinomPayment; use Jinom\Payment\Transaction; ... class TransactionController extends Controller { ... public function topUp(Request $request) { $nominal = 350000; $jinom_payment = new JinomPayment('YOUR SERVER_KEY', 'IS PRODUCTION'); // Automatic Generate Order ID with Time combination $order_id = $jinom_payment->generate_order_id("TOPUP"); $transaction = new Transaction(); $transaction->setTransactionDetails( $transaction->createTransactionDetail($order_id, $nominal) ); $transaction->setCustomerDetails($transaction->createCustomerDetail("John Doe", "john@doe.com", "083119030777")); $items = []; // Item name, price, quantity $items[] = $transaction->createItemDetail("Apple", 350000, 1); $transaction->setItemDetails($items); $charge = $jinom_payment->charge($transaction, [ 'payment_type' => 'bank_transfer', 'bank_transfer' => [ 'bank' => 'bri', // required | It can be bri, bni, bca 'va_number' => '88888888' // optional ] ]); return response()->json([ 'charge' => $charge ]); } } ...
统计信息
- 总下载量: 104
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-11-03