#MidnighttFoxx-paymentsheet

1 messages · Page 1 of 1 (latest)

high dew
#

Hello! Do you mind sharing the Payment Intent ID you're using with the payment sheet?

visual siren
#

sure one second

#

pi_3LujZxK8PMRUef6p0eqrCwp8_secret_xy2H2S1U0CtBp7SkuTmFt7Y28

high dew
#

Thanks! let me take a look

visual siren
#

it seems that each time i initialize the payment sheet it generates a new client secret

high dew
#

Yes, that's expected - when you're creating Payment Intents in general are you setting setup_future_usage?

visual siren
#

when i put that parameter into my payment intent my frontend comes back with 'you must provide either a paymentIntent or setUpIntent'

high dew
#

got it - just wanted to check since setting setup_future_usage is one reason why the button may not be appearing, but if you're not setting it then that can't be it

#

What does your ios payment sheet code look like?

visual siren
high dew
#

I want to see your code - specifically wherever you're setting the configuration

visual siren
#

gotcha

#

heres the backend

high dew
#

ah, are you using our react native sdk?

visual siren
#

yea

#

i just watched the video from the stripe developers channel on youtube and theres had the save card button

high dew
#

In your frontend code can you log ephemeralKey and customer for me and tell me what they are in addition to the clientSecret?

visual siren
#

ephemeral key: ek_test_YWNjdF8xTHI2VWxLOFBNUlVlZjZwLHpwQ0FtYkZjMFZOcEl0TXlacGh2ZHZFQWRYWWR4ZzU_00rbq8WJfF

#

customer: customer: Object {
"address": null,
"balance": 0,
"created": 1666148400,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "test@test.com",
"id": "cus_Mdjzekz1kZAk4W",
"invoice_prefix": "8AF9C1D8",
"invoice_settings": Object {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null,
},
"livemode": false,
"metadata": Object {},
"name": "test",
"next_invoice_sequence": 1,
"object": "customer",
"phone": "(123) 456-7890",
"preferred_locales": Array [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null,
}

high dew
#

And what's the payment Intent for this one?

visual siren
#

pi_3LujsUK8PMRUef6p0f5zAjxS_secret_9VJOGd5FaUK7125ylKN6BZSL1

high dew
#

Hmm... this is definitely odd, I'd expect the checkbox to be showing based on everything you sent over.

#

Can you share what version of our library you're using and try one thing for me?

#

Can you change your backend code to not pass in us_bank_account and see what happens?

visual siren
#

version: 0.6.1 is what is says in package.json

#

and sure let me try that

#

doing that did not change anything sadly

high dew
#

Are you seeing anything interesting/errors in your logs

visual siren
#

it looks all good in the logs

high dew
#

Let me do some testing on my end to see if I can reproduce

visual siren
#

thanks let me know what you find

high dew
#

sorry it's taking a while, it's just taking ages to build

high dew
#

While we're waiting for my samples to cooperate - has this ever worked/were you ever using a different version of our library?

visual siren
#

this is the first time ive tried integrating stripe and it have never been able to see the checkbox

high dew
#

Is there a reason you're using 0.6.1 of our library and not a more recent version?

visual siren
#

thats just what got installed when i ran npm install stripe /stripe-react-native

#

whoops

#

did not mean to @ someone

high dew
#

AH! Wait one second - when I asked you to log customer is there a reason you gave me the full Customer object? Are you accidentally setting customerId as the full customer Object instead of just the ID when you call initializePaymentSheet?

visual siren
#

when i console.log customer thats what comes back so that may be the case

high dew
#

Yeah instead of customerId: customer do customerId: customer.id

visual siren
#

but in res.json i just return customer

high dew
#

and then you can leave your frontend code the same

visual siren
#

omg

#

that was it

#

thank you!!

#

ive been fighting with this for 3 days

high dew
#

HURRAY! I'm so glad I caught that

visual siren
#

❤️

high dew
#

sorry I didn't catch it earlier!

#

I need to head out now, but if you need anything else @knotty fossil can answer any of your questions

visual siren
#

thank you so much for your help

#

i do have one more question about apple pay and google pay,

knotty fossil
#

Hi, sure!

visual siren
#

in my initpaymentsheet method i pass
applePay: {
merchantCountryCode: 'US'
},
googlePay: {
merchantCountryCode: 'US',
testEnv: true,
currencyCode: 'usd'
}

#

but nothing shows up

sharp patrol
#

Can you say more about "nothing shows up" Like the app is all white and empty? something else?

#

Do Apple Pay or Google Pay even work on your device?

visual siren
#

so the payment sheet comes up but there is no apple pay option

#

let me run my android studio to see if google pay shows up

sharp patrol
#

how are you doing this though? Purely on an emulator? On a real device? Is Google Pay and Apple Pay supported on those?

visual siren
#

apple pay is on the real device

sharp patrol
visual siren
#

i have not done those aforementioned tasks

sharp patrol
#

what do you see when you click Add?

visual siren
#

how do i get the merchant id

sharp patrol
#

oh boy

visual siren
sharp patrol
#

Okay so really step one is to carefully read the docs in that case which explains everything

visual siren
#

i gotcha. i dont think this a stripe issue anymore so i wont bother you with this

#

if i cant figure it out after reading through the docs and doing everything ill make a new post in the dev-help channel

#

thank you for your help

sharp patrol
visual siren
#

so i abandoned the whole apple pay thing for now because i more pressing matter arose

#

im trying to grab a customer by their email and if that customer does not exist create one

#

but the problem is my backend seems to be getting hung up on the create customercall

vale quest
#

Hello! Hung up how?

visual siren
#

so ive been tracking the console logs i put into my app and it returns what i would expect, but when it hits the if that the customer does not exist it enters the if statement, but then does not display any console logs after

vale quest
#

Can you share the code in question?

visual siren
#

sure thing

vale quest
#

So when a Customer isn't found what does the second console.log statement log?

#

The console.log(customer) one?

visual siren
#

it says undefined

vale quest
#

So that gets logged, then console.log('here') does not get logged?

visual siren
#

it does get logged too

#

but that next two do not

#

but strangely it does actually create the customer

vale quest
#

I think the issue is that you're declaring customer as a const and then you're trying to change it. I think that should be throwing an error.

#

Is all of this in a try/catch block?

visual siren
#

yea

vale quest
#

Are you discarding the errors?

#

Or ignoring/not surfacing them?

visual siren
#

this is all inside my app.post

vale quest
#

My guess is changing const customer to let customer will fix it, but you should really surface the error to see if my hunch is right.

#

You should log the errors to an error log on your server so you can examine them as needed.

visual siren
#

changing customers to a let seemed to do the trick

#

the other problem i have is that i am initializing my payment sheet at the same time i grab the email and other parameters from firebase which is causing a missing fields error as seen in the image below

vale quest
#

Not sure I understand. Where is the request coming from? Why is missing one or more of the required fields?

visual siren
#

i am using two useEffects, one to grab the current user from firebase and one two initialize the paymentsheet

#

the payment sheet stringifies the email, name, and phone number from firebase but since it is also in a useEffect it seems that it is not waiting for the fields to be filled

vale quest
#

I'm not a React developer, so I'm not sure how to help you with that piece unfortunately.

visual siren
#

no problem

#

thank you with your help on the first part