3

我正在尝试使用 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一起使用。

4

1 回答 1

4

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

于 2013-10-16T14:31:53.853 回答