3

I am getting very frustrated as I have spent long hours on a solution to this problem. I am creating a request using the code below:

 PKPaymentRequest *request = [Stripe
                             paymentRequestWithMerchantIdentifier:merchantId];
// Configure your request here.
NSString *label = @"Product Description";

NSDecimalNumber *amount = [NSDecimalNumber decimalNumberWithString:[productpriceDouble stringByReplacingOccurrencesOfString:@"$" withString:@""]];
request.paymentSummaryItems = @[
                                [PKPaymentSummaryItem summaryItemWithLabel:label
                                                                    amount:amount]
                                ];
request.merchantIdentifier = @"merchantId";
request.countryCode = @"US";
request.currencyCode = @"USD";
request.merchantCapabilities = PKMerchantCapability3DS;

    PKPaymentAuthorizationViewController *paymentController;


    paymentController = [[PKPaymentAuthorizationViewController alloc]
                         initWithPaymentRequest:request];
    paymentController.delegate = self;

    [self presentViewController:paymentController animated:YES completion:nil];

When the code runs, it starts off fine as the Apple Pay view pops up with the finger print, however, when the finger print is confirmed, it spirals around for a bit and then pops up with an alert and says:

'Apple Pay is Not Available in "AppName"'

Check the settings for this app and make sure it was designed to use Apple Pay.

Any thoughts would be greatly appreciated.

user2918201
  • 52
  • 1
  • 7

4 Answers4

3

May 2015 - Also encountered this problem.

I had to redo all the certificates for my app due, because I had an issue with the provisioning profile and other stuff that were not set up correctly.

Apple pay WAS working before all the changes...still worked after I changed all the certificates, but....day later it stopped working!!!

Here is what I did.

I check the Apple Pay settings in the phone, re-added my billing address (sometimes this could be the problem, but it wasn't).

I check the entitlements certificate in the app, to make sure that it was properly setup. Here make sure you have your merchant id included...should start with merchant.com.nameOfApp (you can get this from apple center under merchant id. (This was good - not the problem)

Checked all my certificates - everything seem to be correct.

The last thing I did was to regenerate the certificate for apple pay. BOOM! That was the issue. Not sure why, it just worked. Delete the old certificates for stripe and apple apple pay from your computer and follow the instructions in the stripe/apple pay documentation.

See here

https://stripe.com/docs/mobile/apple-pay

Hope this help!

TheRealRonDez
  • 2,807
  • 2
  • 30
  • 40
  • After regenerating the cert, I had to select it in the Apple Developer Portal and click "Activate". This revoked the old cert and activated the new one. Apple Pay started working immediately. – Mike Taverne May 23 '16 at 23:05
1

You may have created a merchant ID and matching cert, but have you checked that merchant ID is in your entitlements file, and ensured that your entitlements file is being put into your binary? Double check your project capabilities in Xcode to make sure your merchant ID is listed there, and triple check by seeing if the entitlements file is in your target's build settings.

It's also not clear to me why you're explicitly setting the merchantID, when presumably Stripe's factory method should create it for you pre-set?

lxt
  • 31,146
  • 5
  • 78
  • 83
  • Yes all of these things have been done which is why I am so baffled. – user2918201 Apr 14 '15 at 03:39
  • When you generated your merchant ID and certificate did you subsequently upload your certificate back to the developer portal? And was the certificate backed with an elliptic curve or RSA based key? (if you didn't specify anything when you generated the key it will be RSA) – lxt Apr 14 '15 at 03:50
  • It was uploaded back to stripe, but what do you mean to upload it back to the developer portal? Isn't it already on the portal? And as far as the backing, I am unsure of this. – user2918201 Apr 14 '15 at 12:13
  • Go to the Apple developer member center, click on your merchant ID, and select 'Edit'. Do you see a certificate listed under "Production Certificates"? If you never uploaded the certificate to Apple after you generated it then they won't be able to encrypt your payment data, so the payment will immediately fail. If you only see a button that says "Create Certificate" then you'll need to upload the cert you previously generated. – lxt Apr 14 '15 at 14:55
  • I do see a production certificate. – user2918201 Apr 14 '15 at 15:08
  • Try revoking the certificate and creating a new one, just in case? I'm afraid I don't have any other help I can give. Stripe Support might be able to help out as well. – lxt Apr 15 '15 at 01:14
0

I found the solution. Add the string STRIPE_ENABLE_APPLEPAY to both Debug and Release under Preprocessor Macros.

I too faced the same problem.

enter image description here

Update : Now it was fixed. refer: github.com

Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
0

We encountered this problem in Jun, 2016.

Fixed by revoking the merchant Certificate and recreating it by uploading the same CSR.

It is really confusing because Apple Pay seems "Enabled" and there was nothing wrong.

Draken
  • 3,134
  • 13
  • 34
  • 54
sktree
  • 101
  • 5