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");
}