Question

Hi i am trying to integrate Paypal service but its giving error

Error :

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-   [PayPalPaymentViewController payPalServiceManager]: unrecocnized selector sent to instance 0x12784450'

Code :

- (IBAction)buttonPaypalAction:(id)sender
{
gateway = @"Paypal";
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:[appDelegate.orderDetails  objectAtIndex:6]];
payment.currencyCode = appDelegate.currencyCode;
payment.shortDescription = @"Food items";

if (!payment.processable) {
    // This particular payment will always be processable. If, for
    // example, the amount was negative or the shortDescription was
    // empty, this payment wouldn't be processable, and you'd want
    // to handle that here.
}

    // Update payPalConfig re accepting credit cards.
   // self.payPalConfig.acceptCreditCards = self.acceptCreditCards;

 PayPalPaymentViewController *paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment                                                                 configuration:self.payPalConfig                                                                              delegate:self];

// error is coming after this line...
    [self presentViewController:paymentViewController animated:YES completion:nil];
}
Was it helpful?

Solution

Don't forgot to add -lc++ -ObjC in Other linker flags

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top