fenghuohuo/payment

支付sdk集合

dev-master 2018-10-25 02:46 UTC

This package is auto-updated.

Last update: 2024-09-25 15:43:22 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

composer require "fenghuohuo/payment" -vvv

Usage

channel 支付平台(支付宝/微信)

配置文件

/src/Config.php

用例

    public function testCreate()
        {
            try {
                $channel = 'alipay';
                $order = (object)[
                    'orderId'  => '111',
                    'amount'   => 100,
                    'subject'  => '测试商品',
                    'body'     => '商品详情',
                    'pid'      => 1, // 商品id
                    'clientIp' => '111', // 客户端设备id
                    'extra'    => '', // 额外参数 json {"openid":"111"}
                ];
                $payment = new Payment($channel);
                $payment->createOrder($order);
    
                var_dump($order);
            } catch (\Exception $exception) {
                throw $exception;
            }
        }