skrleo / easyphiz
一个简单的PhizPay SDK扩展包.
1.0.2
2024-08-26 08:55 UTC
Requires
- php: >=7.2
- ext-fileinfo: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ^11.1
This package is auto-updated.
Last update: 2025-03-26 10:10:35 UTC
README
📦 一个简单的PhizPay SDK扩展包.
环境需求
- PHP >= 7.2.0
- Composer >= 2.0
安装
composer require skrleo/easyphiz
使用示例
基本使用(以统一下单为例):
<?php use PhizPay\Factory; $config = array( 'appid' => '6490171c3b17b00001f52197', 'mchid' => '1900009191', 'serial_no' => '5157F09EFDC096DE15EBE81A47057A7232F1B8E1', 'is_debug' => true, // 是否开启调试模式,开启的话会走测试环境 'cert_path' => 'path/to/xxx.pem', // XXX: 绝对路径!!!! ); $response = Factory::Order($config)->unify(array( 'trade_type' => 'jsapi', # jsapi| native | micropay 'out_trade_no' => date('Ymd') . Str::random_int(13), 'description' => 'mch_10_store_17', 'amount' => array( 'total' => '0.01', 'currency' => 'BRL' ), 'detail' => array( 'goods_detail' => array( array( 'merchant_goods_id' => '243', 'quantity' => 1, 'unit_price' => '0.01', 'goods_name' => 'NongFuSpring' ) ) ), 'payer' => array( 'openid' => '589e37b9a9ca67b5e269701d3e50a2493719149c', ), 'attach' => array( 'path' => 'pages/order/detail?order_no=202405092658004622', 'appletsId' => '6490171c3b17b00001f52197' ) ));
License
MIT