我使用的是Paypal SDK 2.12.3.当我通过Paypal付款时,有时我在进行交易时低于警惕.
在我的控制台中得到了这个:PayPal SDK:请求失败并出现错误:PAYER_ACTION_REQUIRED - 系统错误(PAYER_ACTION_REQUIRED).请稍后再试.(400)| PayPal Debug-ID:982dc2baccecb [sandbox,PayPal iOS SDK 2.12.3]
这是我的paypal代码
// This method is called when user presses payment button
- (IBAction)pay {
NSMutableArray *items = [[NSMutableArray alloc] init];
for (NSDictionary *dictCart in arrCartData) {
PayPalItem *item1 = [PayPalItem itemWithName:dictCart[@"name"]
withQuantity:[dictCart[@"qty"] intValue]
withPrice:[NSDecimalNumber decimalNumberWithString:dictCart[@"amount"]]
withCurrency:@"USD"
withSku:dictCart[@"badge_id"]];
[items addObject:item1];
}
NSDecimalNumber *subtotal = [PayPalItem totalPriceForItems:items];
NSDecimalNumber *shipping = [[NSDecimalNumber alloc] initWithString:[NSString stringWithFormat:@"%d",[Utility getShippingCharge]]];
NSDecimalNumber *tax = [[NSDecimalNumber alloc] initWithString:@"0.00"];
NSDecimalNumber *total = [[subtotal decimalNumberByAdding:shipping] decimalNumberByAdding:tax];
PayPalPaymentDetails *paymentDetails …Run Code Online (Sandbox Code Playgroud)