云账号SDK更换
This commit is contained in:
@@ -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()
|
||||
]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user