Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local vs international shipping (PayPal iOS SDK)

Tags:

ios

paypal

I'm using the PayPal iOS SDK to handle payments in my app. Is there a way to differentiate between shipping within the U.S. and international shipping?

This is what I have so far:

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";

Thanks.

like image 725
chrisbedoya Avatar asked May 28 '15 17:05

chrisbedoya


1 Answers

You'll need to specify in your app a way to determining the shipping address and decide if that address is "international" relative to your shipping location.

From 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.

You could then include an international charge as part of the final fee.
(You'd also want to make the user aware of your intent to charge for international shipping)

like image 151
Dan O'Boyle Avatar answered Nov 05 '22 06:11

Dan O'Boyle