Ios6 PayPal MPL iOS SDK中的参数小计无效
当我试图通过PayPal MPL处理自适应支付的交易时,我得到了“无效参数小计”错误。如果金额小于10000,则它可以正常工作,但如果金额大于10000,则无法正常工作。这是我的密码Ios6 PayPal MPL iOS SDK中的参数小计无效,ios6,paypal,paypal-adaptive-payments,invalid-argument,Ios6,Paypal,Paypal Adaptive Payments,Invalid Argument,当我试图通过PayPal MPL处理自适应支付的交易时,我得到了“无效参数小计”错误。如果金额小于10000,则它可以正常工作,但如果金额大于10000,则无法正常工作。这是我的密码 -(void)processSplitPaymentWithAdminPayPalId:(NSString*)adminId sellerPayPalId:(NSString*)sellerId withAdminPercentage:(NSNumber*)adminPercentage forTotalA
-(void)processSplitPaymentWithAdminPayPalId:(NSString*)adminId sellerPayPalId:(NSString*)sellerId withAdminPercentage:(NSNumber*)adminPercentage forTotalAmount:(NSNumber*)totalAmount andShippingCharges:(NSNumber*)shippingCharges
{
DLog(@"!!!--------------------------------------");
DLog(@"AdminID: %@",adminId);
DLog(@"SellerID: %@",sellerId);
DLog(@"Admin Percentage: %@",adminPercentage);
DLog(@"Total Amount: %@",totalAmount);
DLog(@"Shipping Charges: %@",shippingCharges);
DLog(@"!!!--------------------------------------");
PayPal *ppMEP = [PayPal getPayPalInst];
ppMEP.shippingEnabled = FALSE;
ppMEP.dynamicAmountUpdateEnabled = FALSE;
ppMEP.feePayer = FEEPAYER_EACHRECEIVER;
PayPalAdvancedPayment *payment = [[[PayPalAdvancedPayment alloc] init] autorelease];
payment.paymentCurrency = @"AUD";
payment.receiverPaymentDetails = [NSMutableArray array];
NSArray *emails = nil;
if ([adminPercentage doubleValue]>0.0) {
emails = [[NSArray alloc]initWithObjects:adminId,sellerId, nil];
}
else {
emails = [[NSArray alloc]initWithObjects:sellerId, nil];
}
for (int i = 0; i < emails.count; i++)
{
PayPalReceiverPaymentDetails *details = [[[PayPalReceiverPaymentDetails
alloc] init] autorelease];
details.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];
float adminAmount = [adminPercentage floatValue];
float sellerAmount = [totalAmount floatValue] - adminAmount;
switch (i) {
case 0:
if (emails.count>1) {
// Admin commission
details.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",adminAmount]];
NSLog(@"Admin commission::details.subTotal: %@",details.subTotal);
details.description = @"Amount paid to Admin as a Commission";
details.merchantName = [NSString stringWithFormat:@"%@",ADMIN];
}
else {
// Seller amount
details.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%@",shippingCharges]];
details.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",sellerAmount]];
NSLog(@"Seller amount 1::details.subTotal: %@",details.subTotal);
details.description = [NSString stringWithFormat:@"Amount paid to Seller :%@",self.product.sellerName];
details.merchantName = [NSString stringWithFormat:@"%@ : %@",SELLER,self.product.sellerName];
}
break;
case 1:
// Seller amount
details.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%@",shippingCharges]];
details.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",sellerAmount]];
NSLog(@"Seller amount 2::details.subTotal: %@",details.subTotal);
details.description = [NSString stringWithFormat:@"Amount paid to Seller :%@",self.product.sellerName];
details.merchantName = [NSString stringWithFormat:@"%@ : %@",SELLER,self.product.sellerName];
break;
default:
break;
}
details.recipient = [emails objectAtIndex:i];
[payment.receiverPaymentDetails addObject:details];
}
[ppMEP advancedCheckoutWithPayment:payment];
[emails release];
}
当我打印管理员和卖家的小计时,它会显示以下值
2013-07-24 12:21:44.685 AppName[6720:907] Admin commission::details.subTotal: 2.3
2013-07-24 12:21:44.687 AppName[6720:907] Seller amount 2::details.subTotal: 29997.7
所以总数是29997.7+2.3=30000,这是正确的。那我为什么会犯这个错误呢
我遇到了一个问题,这个问题告诉我有10000的限制。此限制是否导致我出现此错误
我在Paypal的实时环境中收到此错误。谢谢
更新
我用12700澳元测试了新交易&我得到了同样的错误。所以我认为这是一个极限问题。有人能证实这一点吗?这是正确的-以下是每种货币的限额:谢谢链接。但我可以在易趣上看到价格超过10000美元的商品,那么买家如何购买这些商品?您能建议其他选项以实际金额进行交易吗?
2013-07-24 12:21:44.685 AppName[6720:907] Admin commission::details.subTotal: 2.3
2013-07-24 12:21:44.687 AppName[6720:907] Seller amount 2::details.subTotal: 29997.7