Issue with Apple Pay / Stripe integration

applepay, ios, objective-c, parse-platform, stripe-payments

Solution

I think I know what happened here. Leaving this up in case it helps anybody.

When I initially set up Stripe / Apple Pay into my app, I kept getting numerous errors when I attempted to implement `STPTestPaymentAuthorizationController`. I found the exact problem described here (Stripe payment library and undefined symbols for x86_64).

I replicated the solution defined above by commenting out part of Stripe's code, which maybe (?) produced the `Error Domain=com.stripe.lib Code=50` error.

I fixed this by not using `STPTestPaymentAuthorizationController` at all, just replacing that with `PKPaymentAuthorizationViewController` in `#DEBUG` mode.

tl:dr Not completely sure why STPTestPaymentAuthorization didn't work; avoided situation completely by running PKPaymentAuthorizationViewController with my iPhone and Stripe dashboard in test mode.

Problem

I have followed Stripe's documentation and Example App on integrating Apple Pay. In the handlePaymentAuthorizationWithPayment method, under createTokenWithPayment, I am getting the error: Error Domain=com.stripe.lib Code=50 "Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios ." UserInfo=0x170261b40 {com.stripe.lib:ErrorMessageKey=Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios ., NSLocalizedDescription=Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios .} Anyone know how to resolve this? I am using the latest Stripe library. Thanks.

Original source