Paypal sandbox iphone应用程序中Paypal错误589023的解决方案

Paypal sandbox iphone应用程序中Paypal错误589023的解决方案,paypal-sandbox,Paypal Sandbox,这是iPhone应用程序中Paypal(沙盒)错误“589023”的解决方案 -(作废)payWithPayPal{ 对于(int i=0;i PayPal*PayPal=[PayPal getPayPalInst] payPal.shippingEnabled = FALSE; payPal.dynamicAmountUpdateEnabled = NO; payPal.feePayer = FEEPAYER_EACHRECEIVER; PayPalPayment *payment =

这是iPhone应用程序中Paypal(沙盒)错误“589023”的解决方案

-(作废)payWithPayPal{

对于(int i=0;i PayPal*PayPal=[PayPal getPayPalInst]

payPal.shippingEnabled = FALSE;

payPal.dynamicAmountUpdateEnabled = NO;

payPal.feePayer = FEEPAYER_EACHRECEIVER;

PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];

payment.recipient = @"UKMCA2010@GMAIL.COM";    

payment.paymentCurrency = @"USD";

payment.description = @"Payment Discription here...";

SampleSingleton *sample=[SampleSingleton sharedInstance];

payment.merchantName =[sample getStrRestaurantName]; 

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 = objTempReceived.strItemName;



    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];
}

这里的合计、小计和税只允许在(dot)Ex:(234.xx)后面有两个数字。因此,使用%.2f可以完美地工作