vr-shopxo-plugin/shopxo/extend/payment/LakalaAlipay.php

519 lines
19 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace payment;
use app\service\PayLogService;
/**
* 拉卡拉 - 支付宝
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-19
* @desc description
*/
class LakalaAlipay
{
// 插件配置参数
private $config;
// 签名方式
private $schema = 'LKLAPI-SHA256withRSA';
// 接口地址
private $url = [
0 => [
'pay' => 'https://s2.lakala.com/api/v3/labs/trans/preorder',
'refund' => 'https://s2.lakala.com/api/v3/labs/relation/refund',
],
1 => [
'pay' => 'https://test.wsmsd.cn/sit/api/v3/labs/trans/preorder',
'refund' => 'https://test.wsmsd.cn/sit/api/v3/labs/relation/refund',
],
];
/**
* 构造方法
* @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' => '1.0.1', // 插件版本
'apply_version' => '不限', // 适用系统版本描述
'apply_terminal'=> ['pc','h5'], // 适用终端 默认全部 ['pc', 'h5', 'ios', 'android', 'alipay', 'weixin', 'baidu', 'toutiao']
'desc' => '适用v3.0版本适用PC+H5即时到帐支付方式买家的交易资金直接打入卖家拉卡拉账户快速回笼交易资金。 <a href="https://www.lakala.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' => 'input',
'type' => 'text',
'default' => '',
'name' => 'merchant_no',
'placeholder' => '商户号',
'title' => '商户号',
'is_required' => 0,
'message' => '请填写商户号',
],
[
'element' => 'input',
'type' => 'text',
'default' => '',
'name' => 'term_no',
'placeholder' => '终端号',
'title' => '终端号',
'is_required' => 0,
'message' => '请填写终端号',
],
[
'element' => 'input',
'type' => 'text',
'default' => '',
'name' => 'serial_no',
'placeholder' => '证书序列号',
'title' => '证书序列号',
'is_required' => 0,
'message' => '请填写证书序列号',
],
[
'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,
'message' => '请填写应用私钥',
],
[
'element' => 'textarea',
'name' => 'out_rsa_public',
'placeholder' => '拉卡拉公钥',
'title' => '拉卡拉公钥',
'is_required' => 0,
'rows' => 6,
'message' => '请填写拉卡拉公钥',
],
[
'element' => 'select',
'title' => '是否测试环境'