在过去的 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 的响应是成功的,但是当我继续付款时,没有要求送货地址。
任何帮助都感激不尽。
谢谢!