PayPal:错误 - 返回商家

时间:2013-08-14 09:39:34

标签: php paypal drupal-7

以下代码基于Webform PayPal Integration in Drupal 7

上的示例
$paypal = array();
$paypal['cmd'] = '_xclick';
$paypal['business'] = variable_get('event_reg_paypal_address');
$paypal['receiver_email'] = $paypal['business'];
$paypal['page_style'] = 'huang_checkout';
$paypal['amount'] = variable_get('event_reg_paypal_cost');
$paypal['currency_code'] = 'GBP';
$paypal['item_name'] = 'Test Event Registration';
$paypal['tax'] = 0;
$paypal['custom'] = $submission->sid;
$paypal['return'] = $base_url.'/test/thanks';
$paypal['notify_url'] = $base_url.'/test/thanks';
$paypal['cancel_return'] = $base_url;
$paypal['first_name'] = //first name from submission
$paypal['country'] = 'UK';

$query = http_build_query($paypal, '', '&');
$url = $paypal_host . $query;

drupal_goto($url);

它是自定义模块代码的一部分并实现hook_webform_submission_insert()。提交表单时,$url变量是从$paypal数组构建的,然后用户的浏览器重定向到,例如,

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=pete27_11_94-facilitator%40hotmail.com&receiver_email=pete27_11_94-facilitator%40hotmail.com&page_style=huang_checkout&amount=0.01&currency_code=GBP&item_name=Test+Event+Registration&tax=0&custom=24&return=http%3A%2F%2Fwww.pitmart.com%2Fformulak%2Ftest%2Fthanks&notify_url=http%3A%2F%2Fwww.pitmart.com%2Fformulak%2Ftest%2Fthanks&cancel_return=http%3A%2F%2Fwww.pitmart.com%2Fformulak&first_name=sdfgsdfg&country=UK

在我的paypal开发者帐户中,有一个用户的电子邮件地址与url类似,属于business-pro类型,但每次我提交时都会收到错误消息

We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller. Please contact the seller to resolve the problem. If this payment is for an eBay listing, you can contact the seller via the "Ask Seller a Question" link on the listing page. When you have the correct email address, payment can be made at www.paypal.com.

我在实时服务器上进行测试,而不是无法访问本地服务器。

我本来希望被带到paypal登录表单,但只是得到错误。

是否有可能以这种方式将数据传递给paypal? (直接在网址中而不是通过表单“发布”)

我错过了一些会导致这种失败的变量/数据吗?是否有文档列出了这种paypal请求的最小配置?

修改 - 缺少currency_code。因为已经加入并仍然收到错误。