我尝试使用PayPal Advance与下面的请求数组进行测试交易
我对PayPal付款流程的要求:
Array
(
[PARTNER] => paypal
[VENDOR] => MyVENDOR
[USER] => MyUSER
[PWD] => MyPWD
[TRXTYPE] => S
[AMT] => 1
[CURRENCY] => USD
[CREATESECURETOKEN] => Y
[SECURETOKENID] => DF0ej9MfITxolvm32wqQZSE17ONrACck
[RETURNURL] => http://mywebsite.com/success/
[CANCELURL] => http://mywebsite.com/payment/
[ERRORURL] => http://mywebsite.com/payment/
[BILLTOFIRSTNAME] => test
[BILLTOLASTNAME] => test
[BILLTOSTREET] => test
[BILLTOCITY] => test
[BILLTOSTATE] => test
[BILLTOZIP] => test Postal
[BILLTOCOUNTRY] => Test Country
}
在$ response中获得响应:
Array
(
[RESULT] => 0
[RESPMSG] => Approved
[SECURETOKEN] => 8aCzrm8u9OkejgNQi13ZPXwsJ
[SECURETOKENID] => 1rLHxvk4i7S80cqQACUlEY6DNVKnZgBI
)
然后在PayPal docs
中加载Iframe中的PayPal交易窗口$securetoken = $response['SECURETOKEN'];
$securetokenid = $response['SECURETOKENID'];
$mode='TEST';
/*mode='LIVE';*/
<iframe src='https://payflowlink.paypal.com?SECURETOKEN=$securetoken&SECURETOKENID=$securetokenid&MODE=$mode' width='490' height='565' border='0' frameborder='0' scrolling='no' allowtransparency='true'>\n</iframe>
但每次我收到错误并且交易失败。
Declined: 10544-Please use a different payment card.
Declined 1000 Generic host error.
以及其他错误随机错误,例如Your transaction could not be completed
..
我也试过了实时模式和测试模式,但是得到了相同的错误。