skrleo/easyphiz

Pacote de extens?o PhizPay php simples e fácil de usar.

1.0.0 2024-05-11 01:28 UTC

This package is auto-updated.

Last update: 2024-05-11 01:46:13 UTC


README

📦 一个简单的PhizPay SDK扩展包.

Latest Stable Version Latest Unstable Version Total Downloads License

环境需求

安装

composer require skrleo/easyphiz -vvv

使用示例

基本使用(以统一下单为例):

<?php
use PhizPay\Factory;

$config = array(
    'appid' => '6490171c3b17b00001f52197',
    'mchid' => '1900009191',
    'serial_no' => '5157F09EFDC096DE15EBE81A47057A7232F1B8E1',

    '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