ios - 本地与国际运输(PayPal iOS SDK)

标签 ios paypal

我正在使用 PayPal iOS SDK 在我的应用程序中处理付款。有没有办法区分美国境内的运输和国际运输?

这是我目前所拥有的:

NSDecimalNumber *subtotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%@", self.product.price]];
NSDecimalNumber *shipping = [[NSDecimalNumber alloc] initWithString:@"12.00"];

PayPalPaymentDetails *paymentDetails = [PayPalPaymentDetails paymentDetailsWithSubtotal:subtotal withShipping:shipping withTax:nil];

NSDecimalNumber *total = [subtotal decimalNumberByAdding:shipping];

payment.intent = PayPalPaymentIntentSale;
payment.amount = total;
payment.currencyCode = @"USD";

谢谢。

最佳答案

您需要在您的应用中指定一种方法来确定送货地址,并确定该地址相对于您的送货地点是否是“国际”地址。

来自 the docs :

Your code...

Instructs the PayPal iOS SDK to display an app-provided Shipping Address and/or the Shipping Addresses already associated with the user's PayPal account.

The PayPal iOS SDK...

Allows the user to examine and choose from the displayed Shipping Address(es). Adds the chosen Shipping Address to the payment information sent to PayPal's servers.

然后您可以将国际费用作为最终费用的一部分。
(您还想让用户知道您打算收取国际运费)

关于ios - 本地与国际运输(PayPal iOS SDK),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30513796/

相关文章:

ios - 照片库权限 - 为什么我的应用程序没有显示在“设置”应用程序中? (iOS 12.1 Xcode 10.1)

ios - 具有自动布局和 subview 的 UIView 动画

regex - 使用 htaccess 将 Paypal 回调重新格式化为自定义 URL 格式

paypal - 如何将 "paypal page"处的货币从 USD 更改为 AUD?

objective-c - 从 NSMutableArray 释放 CGMutablePathRef

android - 我应该在我的 iOS 和 Android 应用程序中使用相同的包名称吗?

c# - 在 Monotouch 中子类化和覆盖 UITextField

应用了折扣代码的 Magento 小计/增值税错误 - PayPal 付款细目错误

Paypal 沙盒表格 - 空购物车

paypal - 访问此 paypal API "https://api.sandbox.paypal.com/v1/payments/payouts"时获得 Http 响应代码 403