gpt4 book ai didi

paypal - 在 OmniPay 中设置运输信息

转载 作者:太空宇宙 更新时间:2023-11-03 15:43:40 27 4
gpt4 key购买 nike

我正在尝试使用 OmniPay for PayPal Express 设置运送信息(姓名、地址、电子邮件等)。我尝试在 purchase($options) 对象的选项数组中添加运输信息:

$options = array(
// required fields (username, pass, etc)
// .....
'shippingAddress1' => 'Elm Street'
'shippingCity' => 'Elm',
'shippingPostcode' => '1000'
// etc.
);

我还尝试将此信息传递给 CreditCard 对象:

$card = new Omnipay\Common\CreditCard($card_options);没有任何成功。代码:

$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername(USERNAME);
$gateway->setPassword(PASS);
$gateway->setSignature(SIGNATURE);
$gateway->setTestMode(true);

$card_options = array(
'shippingAddress1' => 'Elm Street',
'shippingCity' => 'Elm',
'shippingPostcode' => '10000',
'shippingState' => '',
'shippingCountry' => 'NEverland',
'shippingPhone' => '123465789',
'company' => '',
'email' => 'shipping@test.com'
);
$card = new Omnipay\Common\CreditCard($card_options);

$response = $gateway->purchase(
array(
'cancelUrl'=>'http://localhost/laravel_paypal/',
'returnUrl'=>'http://localhost/laravel_paypal/public/paypalexpress_confirm',
'amount' => '0.99',
'currency' => 'USD',
'card' => $card

)
)->send();

如何使用 OmniPay 将运输信息添加到 PayPal Express

顺便说一句,我正在使用 LaravelPayPal Sandbox

最佳答案

此问题最近已得到修复 (https://github.com/adrianmacneil/omnipay/pull/140),因此现在应该可以正确设置送货信息。

关于paypal - 在 OmniPay 中设置运输信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18495788/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com