云账号SDK更换

This commit is contained in:
2025-09-30 14:06:41 +08:00
parent 4faaea51b8
commit b3f5a5d62d
59 changed files with 8726 additions and 148 deletions

View File

@@ -36,6 +36,7 @@ class YunPay
$this->card_no = $card_no;
$this->order_amount = $order_amount;
$this->phone = $phone;
$this->dealer_platform_name = "秘地";
//读取配置
$this->config = Config::newFromArray(array(
'app_dealer_id' => $this->sys_config->dealer_id,
@@ -47,7 +48,7 @@ class YunPay
'sign_type' => $this->sys_config->sign_type
));
}
public function alipay(){
public function alipay($data=[]){
try {
$this->paymentClient = new PaymentClient($this->config);
$this->paymentClient->setEnv(PaymentClient::ENV_PROD);
@@ -66,7 +67,11 @@ class YunPay
'pay_remark' => $this->remark, // 订单备注(选填,至多支持 40 个字符且不支持特殊字符,⼀个汉字占 2 个字符,不支持的特殊字符为 ' " & | @% ( ) - : # + / < > ¥ \ ,
'check_name' => 'Check', // 校验⽀付宝账户姓名(固定值 Check
'notify_url' => $this->notify_url, // 回调地址(选填,长度不超过 200 个字符)
'project_id' => '' // 项目ID该字段由云账户分配当接口指定项目时会将订单关联指定项目
'project_id' => '', // 项目ID该字段由云账户分配当接口指定项目时会将订单关联指定项目
//9月新加
'dealer_platform_name' => $this->dealer_platform_name, //互联网平台名称
'dealer_user_nickname' => $data['nickname'] ?? "", //用户名称/昵称
'dealer_user_id' => $data['user_id'] ?? "", //用户ID 用户唯一标识码
));
/*
* request-id请求 ID请求的唯一标识
@@ -205,12 +210,14 @@ class YunPay
return ['code' => 1, 'msg' => "订单状态:" . $response->getData()->getStatusMessage(), 'data' => [
'code' => $response->getData()->getStatusDetail(),
'msg' => $response->getData()->getStatusMessage(),
'data' => $response->getData()
]];
}else{
return ['code' => 1, 'msg' => "订单状态:" . $response->getData()->getStatusDetailMessage(), 'data' => [
'code' => $response->getData()->getStatusDetail(),
'msg' => $response->getData()->getStatusDetailMessage(),
'data' => $response->getData()
]];
}