PayPal iOS SDK响应送货地址:(null)

时间:2016-06-23 13:47:53

标签: ios paypal sdk paypal-sandbox

信息

  • 模式(Mock / Sandbox / Live):Sandbox
  • PayPal iOS SDK版本:2.14.3
  • iOS版本和设备(iOS 8.x,iPhone 6s上的iOS 9.3等):模拟器iPhone 5 iOS 9.3

描述

_payPalConfig = [[PayPalConfiguration alloc] init];
_payPalConfig.payPalShippingAddressOption = PayPalShippingAddressOptionPayPal;

在payPal控制器中,我选择送货地址(PayPal帐户地址)。但作为回应,我收到送货地址:( null)。

CurrencyCode: EUR
Amount: 416.99
Short Description: Clothes
Intent: sale
Processable: Already processed
Display: €416.99
Confirmation: {
    client =     {
        environment = sandbox;
        "paypal_sdk_version" = "2.14.3";
        platform = iOS;
        "product_name" = "PayPal iOS SDK";
    };
    response =     {
        "create_time" = "2016-06-23T12:54:24Z";
        id = "PAY-3H962440US5*******";
        intent = sale;
        state = approved;
    };
    "response_type" = payment;
}
Details: Subtotal: 299.99, Shipping: 117, Tax: (null)
Shipping Address: (null)
Invoice Number: (null)
Custom: (null)
Soft Descriptor: (null)
BN code: (null)
Item: '{Some|299.99|EUR|(null)}'

为什么我收到回复送货地址:( null)?

1 个答案:

答案 0 :(得分:0)

您收到零,因为您应在PayPalPayment.shippingAddress中提供送货地址。这是用SDK帮助

编写的

/// - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app, /// in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.

<强>更新 如果你想从paypal获取地址,请尝试使用这些选项:

PayPalConfiguration *configuration = [[PayPalConfiguration alloc] init];
        configuration.merchantName = @"Name";
        configuration.payPalShippingAddressOption = PayPalShippingAddressOptionPayPal;

如果你想自己提供,请使用类似的东西:

PayPalConfiguration *configuration = [[PayPalConfiguration alloc] init];
    configuration.merchantName = @"Name";
    configuration.payPalShippingAddressOption = PayPalShippingAddressOptionNone;

    PayPalPayment *payment = [[PayPalPayment alloc] init];
    payment.amount = amount;
    payment.currencyCode = @"RUB";
    payment.intent = PayPalPaymentIntentSale;
    PayPalShippingAddress *shippingAddress = [PayPalShippingAddress shippingAddressWithRecipientName:recipientName withLine1:address withLine2:nil withCity:city withState:nil withPostalCode:postalCode withCountryCode:countryCode];
    payment.shippingAddress = shippingAddress;