chore(addon): 支付相关判断是否平台开通配置
This commit is contained in:
@@ -78,6 +78,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function pay($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
// 验证必要参数
|
||||
if (empty($param["out_trade_no"])) {
|
||||
@@ -200,6 +203,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function close($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
$parameter = array(
|
||||
"out_trade_no" => $param["out_trade_no"]
|
||||
@@ -226,6 +232,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function refund($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
// 验证必要参数
|
||||
if (empty($param["pay_info"])) {
|
||||
@@ -291,6 +300,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function transfer($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
// 华为支付转账功能需要根据实际API进行实现
|
||||
// 目前华为支付客户端未实现转账功能,需要根据官方文档扩展
|
||||
@@ -407,6 +419,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function authcodePay($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
// 华为支付授权码支付功能需要根据实际API进行实现
|
||||
// 目前华为支付客户端未实现授权码支付功能,需要根据官方文档扩展
|
||||
@@ -424,6 +439,9 @@ class Pay extends BaseModel
|
||||
*/
|
||||
public function query($param)
|
||||
{
|
||||
if (!$this->config['pay_status'])
|
||||
return $this->error([], '平台未启用华为支付');
|
||||
|
||||
try {
|
||||
// 构造查询请求参数
|
||||
$parameter = array(
|
||||
|
||||
Reference in New Issue
Block a user