Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c paypal iOS集成_Objective C_Ios_Paypal - Fatal编程技术网

Objective c paypal iOS集成

Objective c paypal iOS集成,objective-c,ios,paypal,Objective C,Ios,Paypal,我按下了按钮,当我按下它时,我调用了这个方法,在iPhone simulator 5上,我得到了错误,在iPhone simulator 4.3上工作成功,但在多次按下按钮后: - (void)simplePayment { //dismiss any native keyboards [PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_SANDBOX]; //optional, set shippi

我按下了按钮,当我按下它时,我调用了这个方法,在iPhone simulator 5上,我得到了错误,在iPhone simulator 4.3上工作成功,但在多次按下按钮后:

- (void)simplePayment {
//dismiss any native keyboards

[PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_SANDBOX];

//optional, set shippingEnabled to TRUE if you want to display shipping
//options to the user, default: TRUE
[PayPal getPayPalInst].shippingEnabled = TRUE;

//optional, set dynamicAmountUpdateEnabled to TRUE if you want to compute
//shipping and tax based on the user's address choice, default: FALSE
[PayPal getPayPalInst].dynamicAmountUpdateEnabled = TRUE;

//optional, choose who pays the fee, default: FEEPAYER_EACHRECEIVER
[PayPal getPayPalInst].feePayer = FEEPAYER_EACHRECEIVER;

//for a payment with a single recipient, use a PayPalPayment object
PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
payment.recipient = @"example-merchant-1@paypal.com";
payment.paymentCurrency = @"USD";
payment.description = @"Teddy Bear";
payment.merchantName = @"Joe's Bear Emporium";

//subtotal of all items, without tax and shipping
payment.subTotal = [NSDecimalNumber decimalNumberWithString:@"10"];

//invoiceData is a PayPalInvoiceData object which contains tax, shipping, and a list of PayPalInvoiceItem objects
payment.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];
payment.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithString:@"2"];
payment.invoiceData.totalTax = [NSDecimalNumber decimalNumberWithString:@"0.35"];

//invoiceItems is a list of PayPalInvoiceItem objects
//NOTE: sum of totalPrice for all items must equal payment.subTotal
//NOTE: example only shows a single item, but you can have more than one
payment.invoiceData.invoiceItems = [NSMutableArray array];
PayPalInvoiceItem *item = [[[PayPalInvoiceItem alloc] init] autorelease];
item.totalPrice = payment.subTotal;
item.name = @"Teddy";
[payment.invoiceData.invoiceItems addObject:item];

[[PayPal getPayPalInst] checkoutWithPayment:payment];
}

iPhone 5模拟器上的错误

我应该使用贝宝按钮吗


设备和操作系统版本的库支持。 移动支付库完全支持OS4.0和苹果iPad。您可以将库文件编译为以下配置:

•仅限3.0、3.1.x iPhone •仅限3.2台iPad •3.x通用 •4.x

该演示应用程序还完全支持OS4.0和苹果iPad。您可以编译演示 将应用程序添加到前面的配置中。 单个库文件可用于支持SDK 4.0及以下版本的armv6和armv7体系结构。目前仅为Xcode 3.2.3提供支持。

可能的副本
> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString
> rangeOfString:options:range:locale:]: nil argument'
> 
> *** First throw call stack: (0x142df1c 0x15c052e 0x13cfd38 0x13cfcaa 0xd00681 0xd0e35c 0x5400e 0x6a373 0x70958 0x6e823 0x543d9b 0x765be
> 0x763a1 0x545144 0x5453bb 0x546138 0x4b5b41 0x4bb031 0x4b531f 0x51fb
> 0x9889 0x54de 0x34df 0x2ff4 0x48084c 0x4807e2 0x52777a 0x527c4a
> 0x526ee4 0x4a6002 0x4a620a 0x48c60c 0x47fd52 0x1b968f6 0x13fd31a
> 0x1358d07 0x1356e93 0x1356750 0x1356671 0x1b950c3 0x1b95188 0x47dc29
> 0x294c 0x2885 0x1) terminate called throwing an exceptionsharedlibrary
> apply-load-rules all Current language:  auto; currently objective-c
> (gdb)
UIButton *button = [[PayPal getPayPalInst] getPayButtonWithTarget:self andAction:action andButtonType:type];