修改

优质
小牛编辑
137浏览
2023-12-01

说明

支付宝境外到店支付-修改商户二维码

官方文档:https://global.alipay.com/service/merchant_QR_Code/34

请求参数类

请求参数

类名:\Yurun\PaySDK\AlipayCrossBorder\InStore\ModifyMerchantQR\Request

属性
名称类型说明
$servicestring接口名称
$qrcodestring成功生成代码后返回的二维码值
$timestampstring调用接口的北京时间,格式为yyyy-MM-dd HH:mm:ss
$notify_urlstring支付宝将在 HTTP Post 方法中异步通知结果。
$biz_typestring业务类型
$biz_data\Yurun\PaySDK\AlipayCrossBorder\InStore\CreateMerchantQR\BizData业务数据
$_syncResponseNamestring支付宝返回的json中xxx_response的名字
$_methodstring接口请求方法
$_isSyncVerifyboolean是否同步返回验证

业务数据

参数
名称类型说明
$secondary_merchant_industrystring行业分类标识符
参考:https://global.alipay.com/help/online/81
$secondary_merchant_idstring用于区分每个特定子商户的子商户 ID
$secondary_merchant_namestring将被记录在用户的声明中的子商家名称
$store_idstring商家指定的商户店铺的唯一 id
$store_namestring在客户的支付宝钱包和核对文件中显示的商家商店的名称。
$taxi_operation_idstring出租车操作编号
$taxi_numberstring出租车号码
$taxi_driver_namestring出租车司机姓名
$taxi_driver_mobilestring出租车司机手机号
$trans_currencystring定价币种,货币代码
$currencystring与商人结算的货币。默认值为 CNY。如果定价币种不是 cny, 则结算币种必须是 cny 或定价币种。
$sys_service_provider_idstring系统服务提供程序ID
$channel_fee\Yurun\PaySDK\AlipayCrossBorder\InStore\CreateMerchantQR\ChannelFee渠道费配置
如果在创建二维码时 channel_fee 存在, 则在修改二维码时不能删除它。
$country_codestring国家代码。请参阅 ISO 3166-1 Uor 详细信息。国家代码由两个字母 (alpha-2 代码) 组成。
$addressstring创建代码的存储区的地址
$passback_parametersstring付款成功后返回给商家的响应参数。商家可以定义参数
最终会转为json格式
$notify_mobilestring合法的电话号码
$notify_wangwangstring合法的淘宝旺旺号码
$notify_alipay_accountstring合法的支付宝账号

渠道费配置

参数
名称类型说明
$typestring频道费用类型,
FIXED: 固定金额
RATE: 一定百分比
$valuestring1. 如果渠道费用类型是固定的, 价值范围是 [0, 5% 原始的订单数额]。该值的单位与结算币种一致。对于支持的小数位数, 请参阅受支持的币种。
2. 如果通道费用类型为 "费率", 则值范围为 [0、0.05]。(在促销季节, 渠道费可以是0。

简单使用

// 支付接口
$request = new \Yurun\PaySDK\AlipayCrossBorder\InStore\ModifyMerchantQR\Request;
$request->qrcode = 'https://qr.alipay.com/ocx08830r7djh7dbkkv9k3e';
$request->notify_url = $GLOBALS['PAY_CONFIG']['notify_url'];
$request->biz_data->secondary_merchant_industry = '5812';
$request->biz_data->secondary_merchant_id = 'x001';
$request->biz_data->secondary_merchant_name = 'xxxStore222';
$request->biz_data->store_id = 'x0001';
$request->biz_data->store_name = 'xxxxStore';
$request->biz_data->trans_currency = 'USD';
$request->biz_data->currency = 'USD';
// 下面两个参数在沙箱环境下传了就出错,生产环境可以传
$request->biz_data->country_code = 'CN';
$request->biz_data->address = 'wc';


// 调用接口
$result = $pay->execute($request);

var_dump('result:', $result);

var_dump('success:', $pay->checkResult());

var_dump('error:', $pay->getError(), 'error_code:', $pay->getErrorCode());

详见:test/AlipayCrossBorder/InStore/modify_merchant_QR.php