fecshop paypal 支付虚拟物品,没有地址,报错:There's an error with this transaction. Please enter a country in the shipping address.

技术分享 · Terry · 于 5年前 发布 · 2276 次阅读

fecshop paypal支付,默认只支持实物产品,对于非实物产品,就会报错

array(11) { ["TOKEN"]=> string(20) "EC-3A2480147D4898418" ["SUCCESSPAGEREDIRECTREQUESTED"]=> string(5) "false" ["TIMESTAMP"]=> string(20) "2018-06-15T08:44:00Z" ["CORRELATIONID"]=> string(13) "24164923296e5" ["ACK"]=> string(7) "Failure" ["VERSION"]=> string(5) "109.0" ["BUILD"]=> string(8) "47201799" ["L_ERRORCODE0"]=> string(5) "10731" ["L_SHORTMESSAGE0"]=> string(12) "Invalid Data" ["L_LONGMESSAGE0"]=> string(87) "There's an error with this transaction. Please enter a country in the shipping address." ["L_SEVERITYCODE0"]=> string(5) "Error" }

解决:https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/

no_shipping Optional 	

Do not prompt buyers for a shipping address.

Valid value is:

    0. Prompt for an address, but do not require one.
    1. Do not prompt for an address.
    2. Prompt for an address and require one.

Default is 0.
Character Length: 1

因此,你需要在对接paypal的地方加入NO_SHIPPINGde 参数

if(如果是虚拟产品){
	params.put("NOSHIPPING", "1");
	params.put("REQCONFIRMSHIPPING", "0");
}else{
	params.put("NOSHIPPING", "2");
}
共收到 2 条回复
adminhch#13年前 0 个赞

我现在遇到了同样的问题,报错的原因是因为收货地址没有填写“国家”吗?国家是必须填写的是吗

Fecmall#23年前 0 个赞

@adminhch #1楼 paypal会对地址进行验证,验证不通过就报错,国家肯定必填

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics