Это разрешение для ошибки Paypal («песочница») «589023» в приложении iPhone
-(void)payWithPayPal{
PayPal *payPal=[PayPal getPayPalInst];
payPal.shippingEnabled = FALSE;
payPal.dynamicAmountUpdateEnabled = NO;
payPal.feePayer = FEEPAYER_EACHRECEIVER;
PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
payment.recipient = @"adn.reddy@witinnovation.com";//mail id of the paypal account
payment.paymentCurrency = @"USD";
payment.description = @"Payment Discription here...";
payment.merchantName =@"Y S Rajashekar Reddy];
payment.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];
payment.invoiceData.invoiceItems = [NSMutableArray array];
PayPalInvoiceItem *item = [[PayPalInvoiceItem alloc] init];
item.totalPrice=[NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f", 126.34545]]; // If u give xxx.xx , no need to give the %.2f , u can give directly %f
item.name = @"Any Name";
item.itemId = @"Item ID";
[payment.invoiceData.invoiceItems addObject:item];
[item release];
}
payment.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",126.34545]]; //Total and Subtotal must be equal
payment.invoiceData.totalTax = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",3.34]];
NSLog(@"Total Tax is :%@",[payment.invoiceData.totalTax stringValue]);
[payPal checkoutWithPayment:payment];
}
Здесь итоговая сумма, промежуточная сумма и налог допускают только две цифры после. (Точка) Пример: (234.хх).Таким образом, используя% .2f для идеальной работы.