当前位置: 首页 > 工具软件 > alipay > 使用案例 >

Alipay Global API 境外支付宝接口对接

郜昊苍
2023-12-01

中文文档:https://global.alipay.com/doc/web_cn/about

最近对接了支付宝境外支付,遇到了个比较大的坑,就是缺少了个参数,死活过不去

"product_code" => "NEW_OVERSEAS_SELLER",//不知道为啥,加了这个就可以了

感谢 https://global.alipay.com 上面的技术客服,非常专业和耐心帮我一一调试,解答我的问题

 

从官网上面下载demo的时候,记得默认的请求是测试环境的,上线时需要改为正式环境的地址

//沙箱网关The Alipay gateway of sandbox environment.
var $alipay_gateway_new = 'https://mapi.alipaydev.com/gateway.do?';
//生产环境网关,如果商户用的生产环境请换成下面的正式网关
//The Alipay gateway of production environment.(pls use the below line instead if you were in production environment)
//var $alipay_gateway_new = 'https://mapi.alipay.com/gateway.do?';
还有一点就是,初期测试过不去,把 $split_fund_info注释掉就可以了
$parameter = array(
      "service"       => $alipay_config['service'],
      "partner"       => $alipay_config['partner'],
      "notify_url"   => $alipay_config['notify_url'],
      "return_url"   => $alipay_config['return_url'],
      
      "out_trade_no" => $out_trade_no,
      "subject"  => $subject,
      "total_fee"    => $total_fee,
      "body" => $body,
      "currency" => $currency,
      "product_code" => $product_code,
      //$split_fund_info => str_replace("\"", "'",'split_fund_info'),
      //"split_fund_info"=>$split_fund_info,
      //"_input_charset" => trim(strtolower($alipay_config['input_charset']))
      //其他业务参数根据在线开发文档,添加参数.文档地址:https://global.alipay.com/service
      //To add other parameters,please refer to development documents.Document address:https://global.alipay.com/service
        //如"参数名"=>"参数值"
      //eg"parameter name"=>"parameter value"
      
);
 类似资料: