2

在过去的 5 个小时里,我一直在努力解决这个问题,所以让我们看看是否有人可以帮助我。

我正在使用 PayPal 的自适应付款进行连锁付款(只有我和第二个收款人)。问题是:我不知道如何强迫买家输入送货地址。

这是我拨打电话的方式:

$primaryReceiver = new \Receiver();
$primaryReceiver->email = 'primary.receiver@mail.com';
$primaryReceiver->primary = 'true';
$primaryReceiver->paymentType = 'SERVICE';
$primaryReceiver->amount = 100;

$secondaryReceiver = new \Receiver();
$secondaryReceiver->email = 'secondary.receiver@mail.com';
$secondaryReceiver->primary = 'true';
$secondaryReceiver->paymentType = 'GOODS';
$secondaryReceiver->amount = 90;

$receiverList = new \ReceiverList(array($primaryReceiver, $secondaryReceiver));

$payRequest = new \PayRequest(
    new \RequestEnvelope('en_US'),
    'CREATE',
    'http://my.site.url/pay/cancel',
    'USD',
    $receiverList,
    'http://my.site.url/pay/success'
);

// maybe this Pay() call is wrong? should it be some other method?
$paymentResponse = $service->Pay($payRequest);

// setting payment options
$payOptions = new \SetPaymentOptionsRequest(new \RequestEnvelope("en_US"), $paymentResponse->payKey);
$payOptions->senderOptions = new \SenderOptions();
$payOptions->senderOptions->requireShippingAddressSelection = 'true';
$payOptionsResponse = $service->setPaymentOptions($payOptions);

在 Pay() 调用中获得的支付密钥的 SetPaymentOptionsRequest 的响应是成功的,但是当我继续付款时,没有要求送货地址。

任何帮助都感激不尽。

谢谢!

4

1 回答 1

1

我有同样的经历,并得到了 PayPal 支持的回复,说这是不可能的。

此功能仅适用于嵌入式流程(灯箱或弹出窗口,而不是重定向)。与 receiverOptions 相同(如果您想显示有关产品的其他详细信息)。只有 displayOptions(例如设置公司名称)在重定向后起作用。

于 2014-01-09T12:05:24.750 回答