#epuuc
1 messages ยท Page 1 of 1 (latest)
Crashing in the simulator, do you think that may have something to do with Apple's default cards in the simulator?
I found this on stackoverflow, same error code, different error message
https://stackoverflow.com/questions/60390725/error-domain-com-stripe-lib-code-50-we-had-a-problem-decrypting-your-payment-in
Does it have something to do with the keys being used in the app, or with the merchant identifier, or certificates that stripe has?
Sorry I've been trying to wrap my head around this stripe integration for the past couple weeks, till I discovered this discord
Did you create Apple merchant ID and Apple Pay certificate as the step 1 and 2 mentioned here? https://stripe.com/docs/apple-pay?platform=react-native
in the root of the app we have the StripeProvider setup
There's another person working on the backend, and they say they set up the certificate with Stripe
The app fetches the payment intent from the backend, throws that in the confirmPlatformPayPayment function, with the order total as the only cart item
Can you share your account ID, so that I can take a closer look if Apple Pay certificate is set up correctly You can find your account ID by logging in to https://dashboard.stripe.com/settings/account. It'll be in the upper right hand corner and looks like acct_123
Is your merchant identifier set as merchant.fo....rs?
yes
Is your publishable key test mode or live mode? If you use test mode key, Payment Intent should be created in test mode. Simulator should only work with test mode key, but not live mode key
Test mode publishable key will look like pk_test_xxx
Does both publishable key in client and secret key in server in the test mode and belong to same account?
yes, we're only using 1 account
It turns out that in code we're using the live key, with test mode turned off and the dashboard says that test key is being used
Dashboard toggle is for you to view the data between test mode and live mode. It doesn't affect any API integration
But yes, your code running on simulator should use test mode publishable and secret keys
alright I can make a ternary work in simulator only
but, I was testing it with the pk_test key and it would still crash
and normally with an expo app, it wouldn't crash, it would display an error
I get no output, no error messages from the development server, just a crash from the app
Can you share crash log from Xcode console?
I'm getting the backend developer in this chat real quick
Not using XCode
but I can find the crash error from my laptop
give me 1 second
Yup! That will be good if you can provide the crash log!
Hi Brandon
Hello -- am the admin for this project. @supple kindle is my minion.
oh
๐
Hello Brandon ๐
So from the logs, it looks like the app is using the pk_test although @supple kindle tells me that they are using the pk_live key
If the app uses pk_test_xxx, then it is correct
It'll be helpful if you could provide the crash log, so that we can look into it further
Yes, understood. @supple kindle all evidence is pointing to the pk_test key -- is it possible that the version posted to Apple has bogus logic?
that log is just from this message
@supple kindle do you want me to switch back to the sk_test in the API until we get the simulator working?
sure, let's fix the simulator first
read the rest of the chat to get updated on the context @naive sail
done -- ping me if you need any additional information from the Stripe account.
If publishable key is in test mode (pk_test_xxx), the server secret key (sk_test_xxx) should be in test mode as well
@naive sail is that why it might be coming up as the test key is only being used?
Can you share the Payment Intent ID (pi_xxx) used in your testing?
the string being passed to the confirmPlatformPayPayment function?
Yes!
doesn't it change on every order?
It does, but an example will be helpful for me to check how your Payment Intent was created
it's safe to send here?
I only need pi_xxx and not the secret
From the crash log, the error was thrown from: https://github.com/stripe/stripe-ios/blob/master/StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent%2BAPI.swift#L30-L33
Can you share the client secret value that you set in confirmPlatformPayPayment?
It's fine to share it here
Client secret should be in the format of pi_xxx_secret_xxx
@naive sail
the only key I'm setting in the confirmPlatformPayPayment is that
Then the value is incorrect
It should be in the format of pi_xxx_secret_xxx which can be obtained from the server under client_secret of Payment Intent object: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
It should be Payment Intent's client secret, not Payment Intent ID
just looking into this
how is the PaymentIntent Object passed into the confirmPlatformPayPayment?
is it just
confirmPlatformPayPayment(payment_intent_object)
with the example you showed me
You server should create Payment Intent first, then pass its client secret to your client to render Payment Sheet: https://stripe.com/docs/apple-pay?platform=react-native#present-payment-sheet
So that's the problem. I was just passing the "paymentintent.id"
Rather than the client_secret.
I think you need both, no?
Okay @supple kindle -- I'm now including "client_secret" in the payload from the API. You can use that instead.
Only client_secret is needed at client to present Payment Sheet
that would be my bad for not RTFM
oh, so I pass the client_secret to the confirmPlatformPayPayment?
Yup!
instead of that
ok awesome
it worked
That's great to hear!
ok I will finish coding the rest of the stuff, publish it to apple to review again and I'll be back if there are any more problems
Really appreciate your help @river !
No problem! Happy to help ๐