taqin/jayapay-sdk
Composer 安装命令:
composer require taqin/jayapay-sdk
包简介
Professional PHP SDK for JayaPay payment gateway integration supporting fiat and digital currencies
README 文档
README
A professional, semantic PHP SDK for integrating with the JayaPay payment gateway. This SDK provides comprehensive support for fiat and digital currency collections, payments, order queries, account verification, and webhook handling.
Features
- ✅ Fiat Currency Collections - Support for Indonesian banks and e-wallets
- ✅ Digital Currency Collections - USDT, BTC, ETH, TRX with multiple networks
- ✅ Fiat Currency Payments - Payout to bank accounts
- ✅ Digital Currency Payments - Send cryptocurrency to addresses
- ✅ Order Queries - Check status of collection and payment orders
- ✅ Account Verification - Verify bank account details
- ✅ Balance Inquiry - Check available balances
- ✅ Webhook Handling - Secure notification processing with signature verification
- ✅ RSA Signature Support - Built-in signature generation and verification
- ✅ Professional Code Structure - PSR-4 compliant with semantic naming
- ✅ Comprehensive Error Handling - Custom exceptions for different error types
- ✅ Sandbox Support - Test environment support
Installation
composer require taqin/jayapay-sdk
Quick Start
<?php require_once 'vendor/autoload.php'; use Taqin\Jayapay\JayaPay; // Initialize SDK $jayapay = new JayaPay( 'YOUR_MERCHANT_CODE', 'YOUR_PRIVATE_KEY', // PKCS8 format 'PLATFORM_PUBLIC_KEY', false, // false for production, true for sandbox 30 // timeout in seconds ); // Create a fiat collection order $orderParams = [ 'orderNum' => 'ORDER123456', 'payMoney' => '10000', 'productDetail' => 'Test Payment', 'notifyUrl' => 'https://your-domain.com/notify', 'expiryPeriod' => '1440', 'name' => 'John Doe', 'email' => 'john@example.com', 'phone' => '081234567890' ]; try { $response = $jayapay->createFiatCollectionOrder($orderParams); echo "Order created successfully: " . $response['platOrderNum']; } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
API Reference
Initialization
$jayapay = new JayaPay($merchantCode, $privateKey, $publicKey, $sandbox, $timeout);
Fiat Currency Collection
// Create order $response = $jayapay->fiatCollection()->createOrder($params); // Get supported payment methods $methods = $jayapay->fiatCollection()->getSupportedMethods();
Required Parameters:
orderNum- Merchant order numberpayMoney- Payment amount (integer, no decimals)productDetail- Payment descriptionnotifyUrl- Notification URLexpiryPeriod- Expiry time in minutesname- Customer nameemail- Customer emailphone- Customer phone
Optional Parameters:
method- Payment method (BCA, MANDIRI, etc.)
Digital Currency Collection
// Create order $response = $jayapay->digitalCollection()->createOrder($params); // Get supported currencies $currencies = $jayapay->digitalCollection()->getSupportedMethods(); // Get supported networks $networks = $jayapay->digitalCollection()->getSupportedNetworks();
Required Parameters:
mchUserId- Merchant user IDpayMoney- Payment amount (supports decimals up to 6 places)notifyUrl- Notification URLexpiryPeriod- Expiry time in minutesname- Customer nameemail- Customer emailphone- Customer phone
For ordered mode (v1.0, v3.0):
orderNum- Merchant order number
For digital currencies:
method- Currency type (USDT, BTC, ETH, TRX)currency- Currency codenetWork- Network (TRC20, BEP20, etc.)orderVersion- Cashier version (v1.0, v2.0, v3.0, v4.0)
Fiat Currency Payment
// Create payment $response = $jayapay->fiatPayment()->createPayment($params); // Get supported bank codes $banks = $jayapay->fiatPayment()->getSupportedBankCodes();
Required Parameters:
orderNum- Merchant order numbermoney- Payment amount (integer, no decimals)feeType- Fee type (0: deduct from amount, 1: separate)bankCode- Bank codenumber- Account numbername- Recipient namemobile- Recipient phoneemail- Recipient emailnotifyUrl- Notification URLdescription- Payment description
Digital Currency Payment
// Create payment $response = $jayapay->digitalPayment()->createPayment($params); // Get supported currencies $currencies = $jayapay->digitalPayment()->getSupportedMethods();
Required Parameters:
orderNum- Merchant order numbermoney- Payment amount (supports decimals)feeType- Fee typemethod- Currency typecurrency- Currency codenetWork- NetworkinAddress- Recipient addressname- Recipient namemobile- Recipient phoneemail- Recipient emailnotifyUrl- Notification URL
Order Queries
// Query by order number $response = $jayapay->queryOrder('ORDER123456', 'ORDER_QUERY'); // Query collection order $response = $jayapay->orderQuery()->queryCollectionOrder(['orderNum' => 'ORDER123456']); // Query payment order $response = $jayapay->orderQuery()->queryPaymentOrder(['orderNum' => 'PAY123456']);
Account Verification
// Verify account $response = $jayapay->accountVerification()->verifyByBankCode('014', '1234567890'); // Check if verification is supported $supported = $jayapay->accountVerification()->isVerificationSupported('014');
Balance Inquiry
// Get all balances $balances = $jayapay->getBalance(); // Get specific currency balance $idrBalance = $jayapay->getBalance('IDR'); // Parse balance data $parsed = $jayapay->balanceInquiry()->parseBalanceData($balances);
Webhook Handling
// Handle incoming webhook try { $notification = $jayapay->webhookHandler()->handleNotification($_POST); if ($jayapay->webhookHandler()->isPaymentSuccessful($notification)) { // Process successful payment echo $jayapay->webhookHandler()->generateSuccessResponse(); } else { // Handle failed payment echo $jayapay->webhookHandler()->generateFailureResponse(); } } catch (SignatureException $e) { // Invalid signature echo $jayapay->webhookHandler()->generateFailureResponse(); }
Error Handling
The SDK provides specific exception types:
use Taqin\Jayapay\Exceptions\ApiException; use Taqin\Jayapay\Exceptions\ValidationException; use Taqin\Jayapay\Exceptions\SignatureException; try { $response = $jayapay->createFiatCollectionOrder($params); } catch (ValidationException $e) { // Input validation failed $errors = $e->getErrors(); } catch (ApiException $e) { // API error $code = $e->getResponseCode(); $message = $e->getResponseMessage(); } catch (SignatureException $e) { // Signature verification failed }
Configuration
Sandbox Mode
$jayapay = new JayaPay($merchantCode, $privateKey, $publicKey, true); // true for sandbox
Custom Timeout
$jayapay = new JayaPay($merchantCode, $privateKey, $publicKey, false, 60); // 60 second timeout
Supported Payment Methods
Fiat Currency
- BCA, MANDIRI, PERMATA, CIMB, BNI, MAYBANK, DANAMON, BRI, BSI, BNC
- OVO, DANA, LINKAJA, SHOPEEPAY, GOPAY_QRIS, QRIS
- ALFAMART, TRANSFER_BCA
Digital Currency
- USDT (TRC20, BEP20, OMNI, ERC20)
- BTC (OMNI)
- ETH (ERC20)
- TRX (TRC20)
Requirements
- PHP 7.4 or higher
- cURL extension
- OpenSSL extension
License
MIT License
Support
For technical support, please contact the development team or refer to the JayaPay official documentation.
taqin/jayapay-sdk 适用场景与选型建议
taqin/jayapay-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「payment」 「sdk」 「gateway」 「signature」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 taqin/jayapay-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 taqin/jayapay-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 taqin/jayapay-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
TrinkPOS Sanal POS (Virtual POS) API client for PHP
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-08