485 lines
16 KiB
PHP
Executable File
485 lines
16 KiB
PHP
Executable File
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||
// +----------------------------------------------------------------------
|
||
// | Author: Devil
|
||
// +----------------------------------------------------------------------
|
||
namespace payment;
|
||
|
||
/**
|
||
* 支付宝小程序支付
|
||
* @author Devil
|
||
* @blog http://gong.gg/
|
||
* @version 1.0.0
|
||
* @date 2018-09-19
|
||
* @desc description
|
||
*/
|
||
class AlipayMini
|
||
{
|
||
// 插件配置参数
|
||
private $config;
|
||
|
||
/**
|
||
* 构造方法
|
||
* @author Devil
|
||
* @blog http://gong.gg/
|
||
* @version 1.0.0
|
||
* @date 2018-09-17
|
||
* @desc description
|
||
* @param [array] $params [输入参数(支付配置参数)]
|
||
*/
|
||
public function __construct($params = [])
|
||
{
|
||
$this->config = $params;
|
||
}
|
||
|
||
/**
|
||
* 配置信息
|
||
* @author Devil
|
||
* @blog http://gong.gg/
|
||
* @version 1.0.0
|
||
* @date 2018-09-19
|
||
* @desc description
|
||
*/
|
||
public function Config()
|
||
{
|
||
// 基础信息
|
||
$base = [
|
||
'name' => '支付宝', // 插件名称
|
||
'version' => '0.0.1', // 插件版本
|
||
'apply_version' => '不限', // 适用系统版本描述
|
||
'apply_terminal'=> ['alipay'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu']
|
||
'desc' => '适用支付宝小程序,即时到帐支付方式,买家的交易资金直接打入卖家支付宝账户,快速回笼交易资金。 <a href="http://www.alipay.com/" target="_blank">立即申请</a>', // 插件描述(支持html)
|
||
'author' => 'Devil', // 开发者
|
||
'author_url' => 'http://shopxo.net/', // 开发者主页
|
||
];
|
||
|
||
// 配置信息
|
||
$element = [
|
||
[
|
||
'element' => 'input',
|
||
'type' => 'text',
|
||
'default' => '',
|
||
'name' => 'appid',
|
||
'placeholder' => 'appid',
|
||
'title' => 'appid',
|
||
'is_required' => 0,
|
||
'message' => '请填写小程序appid',
|
||
],
|
||
[
|
||
'element' => 'textarea',
|
||
'name' => 'rsa_public',
|
||
'placeholder' => '应用公钥',
|
||
'title' => '应用公钥',
|
||
'is_required' => 0,
|
||
'rows' => 6,
|
||
'message' => '请填写应用公钥',
|
||
],
|
||
[
|
||
'element' => 'textarea',
|
||
'name' => 'rsa_private',
|
||
'placeholder' => '应用私钥',
|
||
'title' => '应用私钥',
|
||
'is_required' => 0,
|
||
'rows' => 6,
|
||