<?php
namespace payment;
use app\plugins\allocation\service\PaymentHandleService;
* 银联分账 - 支付宝APP
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2024-11-14
* @desc description
*/
class ChinaumsAllocationAlipayApp
{
private $config;
public static $inst_mid = 'APPDEFAULT';
* 构造方法
* @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' => '银联分账-支付宝APP',
'version' => '1.0.0',
'apply_version' => '不限',
'apply_terminal'=> ['h5', 'ios', 'android'],
'desc' => '适用支付宝APP,分账模式支付方式。 <a href="https://www.chinaums.com/" target="_blank">立即申请</a>',
'author' => 'Devil',
'author_url' => 'http://shopxo.net/',
];
$element = [
[
'element' => 'message',
'message' => '支付参数请在【银联支付分账】插件中配置',
],
];
return [
'base' => $base,
'element' => $element,
];
}
* 支付入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-19
* @desc description
* @param [array] $params [输入参数]
*/
public function Pay($params = [])
{
$ret = $this->IsCall();
if($ret['code'] != 0)
{
return $ret;
}
$params['inst_mid'] = self::$inst_mid;
return PaymentHandleService::Pay('alipay-app', $params);
}
* 支付回调处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-19
* @desc description
* @param [array] $params [输入参数]
*/
public function Respond($params = [])
{
$ret = $this->IsCall();
if($ret['code'] != 0)
{
return $ret;
}
$params['inst_mid'] = self::$inst_mid;
return PaymentHandleService::Respond($params);
}
* 退款处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-28
* @desc description
* @param [array] $params [输入参数]
*/
public function Refund($params = [])
{
$ret = $this->IsCall();
if($ret['code'] != 0)
{
return $ret;
}
$params['inst_mid'] = self::$inst_mid;
return PaymentHandleService::Refund($params);
}
* 是否可以调用
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2024-11-23
* @desc description
*/
public function IsCall()
{
$service_class = '\app\plugins\allocation\service\PaymentHandleService';
if(!class_exists($service_class))
{
return DataReturn('请先安装【分账系统】插件', -1);
}
return DataReturn('success', 0);
}
* 自定义成功返回内容
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-01
* @desc description
*/
public function SuccessReturn()
{
return 'SUCCESS';
}
* 自定义失败返回内容
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-01
* @desc description
*/
public function ErrorReturn()
{
return 'FAILED';
}
}
?>