#epuuc

1 messages ยท Page 1 of 1 (latest)

cursive cairnBOT
supple kindle
#

Crashing in the simulator, do you think that may have something to do with Apple's default cards in the simulator?

#

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

trim bay
supple kindle
#

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

trim bay
#

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

supple kindle
#

Sure, let me grab it from the backend

#

acct_1NSTtmCrjytTLB5p

trim bay
#

Is your merchant identifier set as merchant.fo....rs?

supple kindle
#

yes

trim bay
#

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

supple kindle
#

would it cause a crash though?

#

yes we tested with both the live and test keys

trim bay
#

Does both publishable key in client and secret key in server in the test mode and belong to same account?

supple kindle
#

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

trim bay
#

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

supple kindle
#

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

trim bay
#

Can you share crash log from Xcode console?

supple kindle
#

I'm getting the backend developer in this chat real quick

supple kindle
#

but I can find the crash error from my laptop

#

give me 1 second

trim bay
#

Yup! That will be good if you can provide the crash log!

supple kindle
#

Hi Brandon

naive sail
#

Hello -- am the admin for this project. @supple kindle is my minion.

supple kindle
#

oh

naive sail
#

๐Ÿ˜‰

trim bay
#

Hello Brandon ๐Ÿ‘‹

naive sail
#

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

trim bay
#

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

supple kindle
naive sail
#

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?

supple kindle
#

that log is just from this message

naive sail
#

@supple kindle do you want me to switch back to the sk_test in the API until we get the simulator working?

supple kindle
#

sure, let's fix the simulator first

#

read the rest of the chat to get updated on the context @naive sail

naive sail
trim bay
#

If publishable key is in test mode (pk_test_xxx), the server secret key (sk_test_xxx) should be in test mode as well

supple kindle
#

@naive sail is that why it might be coming up as the test key is only being used?

trim bay
#

Can you share the Payment Intent ID (pi_xxx) used in your testing?

supple kindle
#

the string being passed to the confirmPlatformPayPayment function?

trim bay
#

Yes!

supple kindle
#

doesn't it change on every order?

trim bay
#

It does, but an example will be helpful for me to check how your Payment Intent was created

supple kindle
#

it's safe to send here?

trim bay
#

I only need pi_xxx and not the secret

supple kindle
#

pi_3NcHfjCrjytTLB5p1pu4dS0X

#

was the last used

trim bay
#

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

supple kindle
#

@naive sail

supple kindle
trim bay
#

Then the value is incorrect

supple kindle
trim bay
#

It should be Payment Intent's client secret, not Payment Intent ID

naive sail
#

just looking into this

supple kindle
#

how is the PaymentIntent Object passed into the confirmPlatformPayPayment?

#

is it just
confirmPlatformPayPayment(payment_intent_object)

#

with the example you showed me

trim bay
naive sail
#

Rather than the client_secret.

supple kindle
#

I think you need both, no?

naive sail
#

Okay @supple kindle -- I'm now including "client_secret" in the payload from the API. You can use that instead.

trim bay
#

Only client_secret is needed at client to present Payment Sheet

naive sail
#

that would be my bad for not RTFM

supple kindle
#

oh, so I pass the client_secret to the confirmPlatformPayPayment?

trim bay
#

Yup!

supple kindle
#

ok awesome

#

it worked

trim bay
#

That's great to hear!

supple kindle
#

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

naive sail
#

Really appreciate your help @river !

trim bay
#

No problem! Happy to help ๐Ÿ˜„