6

我正在使用“paypal”付款方式:

$payer = new Payer();
$payer->setPaymentMethod('paypal');

我尝试了以下方法,但没有设置地址:

$addr = new Address();
$addr->setLine1('34/1');
$addr->setLine2('xxx');
$addr->setCity('xxxxxxx');
$addr->setCountry_code('US');
$addr->setPostal_code('43210');
$addr->setState('OH');
4

1 回答 1

9
  1. 创建ShippingAddress对象。
  2. ShippingAddress扩展地址对象。因此,设置所有Address对象属性和ShippingAddress特定属性 ( RecipientName)。
  3. 使用方法将创建ShippingAddress的项分配给ItemListsetShippingAddress
$shipping_address = new ShippingAddress();

$shipping_address->setCity('City');
$shipping_address->setCountryCode('AR');
$shipping_address->setPostalCode('200');
$shipping_address->setLine1('Adress Line1');
$shipping_address->setState('State');
$shipping_address->setRecipientName('Recipient Name');

$itemList->setShippingAddress($shipping_address);
于 2013-12-31T13:10:00.353 回答