#CowBoy0602

1 messages · Page 1 of 1 (latest)

teal mauveBOT
clear moth
#

You're using API keys from different Stripe account to create and confirm the Setup Intent. This error is expected:

#

Looks like they're completed unrelated accounts, too (i.e. not a Connect platform/connected account)

snow rain
#

So how do I solve that please? I just have one account i don't know why ? how should I check these different accounts

#

?

clear moth
#

You need to use API keys (secret & publishable) from the same account when creating/confirming. Which account of those is the one you want to use?

snow rain
#

i dont have other accounts

#

i am using java script to create the setupintent and the confirmsetupintent in my java code

clear moth
snow rain
#

I only use the stripe_client_key in my java code

#

like ca_....

clear moth
#

Please can you check what I asked

snow rain
#

ok

#

acct_1KcypKCVgz1OfKdx

#

its this account

clear moth
#

Then in your Android code that's confirming the Setup Intent, you're using the wrong key. You should go to the Dashboard, and use the publishable key (pk_xxx) when initialising the SDK

snow rain
#

ok i will chek that

#

check

clear moth
snow rain
#

I have checked on the code you are right its not the same key but why? since i get it from my javascript code in the stripe = new Stripe(getApplicationContext(), responseMap.get("publishableKey"));

#

here is the js code : * This will create a stripe user which will be used to
*/
exports.create_setup_intent = functions.https.onRequest(async (request, response) => {

const snapshot = await admin.database().ref().child('stripe_customers').child(request.body.uid).once('value')
 console.log("snapshot:",snapshot)
const customer = snapshot.val().customer_id

console.log("customer:",snapshot.val().customer_id)

const setupIntent = await stripe.setupIntents.create({ customer });

const clientSecret = setupIntent.client_secret

// Send publishable key and SetupIntent details to client
response.send({
    publishableKey: functions.config().stripe.pk,
    clientSecret: clientSecret
});

});

#

this one : "publishableKey: functions.config().stripe.pk" dont get the right key

clear moth
#

What does functions.config().stripe.pk return? I imagine that's set incorrectly

snow rain
#

thank you for your precious help