#MidnighttFoxx-paymentsheet
1 messages · Page 1 of 1 (latest)
Thanks! let me take a look
it seems that each time i initialize the payment sheet it generates a new client secret
Yes, that's expected - when you're creating Payment Intents in general are you setting setup_future_usage?
when i put that parameter into my payment intent my frontend comes back with 'you must provide either a paymentIntent or setUpIntent'
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?
I want to see your code - specifically wherever you're setting the configuration
ah, are you using our react native sdk?
yea
i just watched the video from the stripe developers channel on youtube and theres had the save card button
In your frontend code can you log ephemeralKey and customer for me and tell me what they are in addition to the clientSecret?
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,
}
And what's the payment Intent for this one?
pi_3LujsUK8PMRUef6p0f5zAjxS_secret_9VJOGd5FaUK7125ylKN6BZSL1
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?
version: 0.6.1 is what is says in package.json
and sure let me try that
doing that did not change anything sadly
Are you seeing anything interesting/errors in your logs
it looks all good in the logs
Let me do some testing on my end to see if I can reproduce
thanks let me know what you find
sorry it's taking a while, it's just taking ages to build
While we're waiting for my samples to cooperate - has this ever worked/were you ever using a different version of our library?
this is the first time ive tried integrating stripe and it have never been able to see the checkbox
Is there a reason you're using 0.6.1 of our library and not a more recent version?
thats just what got installed when i ran npm install stripe /stripe-react-native
whoops
did not mean to @ someone
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?
when i console.log customer thats what comes back so that may be the case
Yeah instead of customerId: customer do customerId: customer.id
in the creatpaymentintent i do customer: customer.id
but in res.json i just return customer
should that also be customer.id
HURRAY! I'm so glad I caught that
❤️
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
thank you so much for your help
i do have one more question about apple pay and google pay,
Hi, sure!
in my initpaymentsheet method i pass
applePay: {
merchantCountryCode: 'US'
},
googlePay: {
merchantCountryCode: 'US',
testEnv: true,
currencyCode: 'usd'
}
but nothing shows up
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?
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
how are you doing this though? Purely on an emulator? On a real device? Is Google Pay and Apple Pay supported on those?
apple pay is on the real device
also did you do all of this https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-apple-pay
also on those devices what do you see on https://stripe.com/docs/stripe-js/elements/payment-request-button like do you see the Apple Pay or Google Pay button? Can you share a screenshot?
what do you see when you click Add?
how do i get the merchant id
oh boy
Okay so really step one is to carefully read the docs in that case which explains everything
https://stripe.com/docs/apple-pay?platform=ios#accept if you don't know how a merchant id works on iOS
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
all good, we're around if you have a follow up question and make sure to load https://stripe.com/docs/stripe-js/elements/payment-request-button on the device(s) you test to ensure Apple Pay and Google Pay work on those correctly first
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
Hello! Hung up how?
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
Can you share the code in question?
So when a Customer isn't found what does the second console.log statement log?
The console.log(customer) one?
it says undefined
So that gets logged, then console.log('here') does not get logged?
it does get logged too
but that next two do not
but strangely it does actually create the customer
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?
yea
this is all inside my app.post
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.
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
Not sure I understand. Where is the request coming from? Why is missing one or more of the required fields?
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
I'm not a React developer, so I'm not sure how to help you with that piece unfortunately.