devcbh/checkout-wrapper
最新稳定版本:1.1.3
Composer 安装命令:
composer require devcbh/checkout-wrapper
包简介
A Laravel-friendly wrapper for the Pisopay Checkout API.
README 文档
README
A Laravel-friendly wrapper for the Pisopay Checkout API.
Installation
You can install the package via composer:
composer require devcbh/checkout-wrapper
The package will automatically register its service provider.
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Devcbh\CheckoutWrapper\CheckoutWrapperServiceProvider" --tag="config"
This will create a config/checkout-wrapper.php file in your app. You can set your API credentials in your .env file:
CHECKOUT_API_ENDPOINT=https://api.example.com
CHECKOUT_API_VERSION=v1
CHECKOUT_API_USERNAME=your-username
CHECKOUT_API_PASSWORD=your-password
Usage
Using the Instance
use Devcbh\CheckoutWrapper\Checkout; // Instantiate the class $checkout = app(Checkout::class); // Generate a token $details = [ array("name" => "itemSample", "price" => "1.00", "quantity" => "1"), array("name" => "itemSample1", "price" => "1.00", "quantity" => "2") ]; $arrayData = [ "branch_code" => "", "amount" => "3", "delivery_fees" => "0", "transaction_type" => "", "processor_name" => "", "customer_name" => "John Doe", "customer_email" => "developer@pisopay.com.ph", "customer_phone" => "09091231234", "customer_address" => "PH", "merchant_trace_no" => "sampleTraceNo12345", //unique trace no "merchant_callback_url" => "https://pisopay.com.ph/received", //status update webhook "callback_url" => "https://pisopay.com.ph", //redirection after payment and other returns "ip_address" => "192.168.123.1", "expiry_date" => "2027-01-01 00:00:00" // any future date ]; $token = $checkout->generateToken($details, $arrayData); // Generate a reference number $referenceNumber = $checkout->generateReferenceNumber($arrayData, "PPC"); // 2nd param is the channel code
Using the Facade
//use Devcbh\CheckoutWrapper\Facades\Checkout; // Or use the alias which is automatically registered use Checkout; // Generate a token $details = [ array("name" => "itemSample", "price" => "1.00", "quantity" => "1"), array("name" => "itemSample1", "price" => "1.00", "quantity" => "2") ]; $arrayData = [ "branch_code" => "", "amount" => "3", "delivery_fees" => "0", "transaction_type" => "", "processor_name" => "", "customer_name" => "John Doe", "customer_email" => "developer@pisopay.com.ph", "customer_phone" => "09091231234", "customer_address" => "PH", "merchant_trace_no" => "sampleTraceNo12345", //unique trace no "merchant_callback_url" => "https://pisopay.com.ph/received", //status update webhook "callback_url" => "https://pisopay.com.ph", //redirection after payment and other returns "ip_address" => "192.168.123.1", "expiry_date" => "2027-01-01 00:00:00" // any future date ]; $token = Checkout::generateToken($details, $arrayData); // Generate a reference number $referenceNumber = Checkout::generateReferenceNumber($arrayData, "PPC"); // 2nd param is the channel code
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 777
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2025-07-02