#sinduri_code

1 messages ¡ Page 1 of 1 (latest)

fluid moatBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1229642560331452466

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

junior mesaBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

timid wasp
#

Hi there, you need to initialize Stripe.js with your publishable key. What make you think you should replace it with a access token ?

blazing cairn
#

because previously Stripe integration relay on publishable key and secret key, but now I migrated to Stripe app which automatically connect with Stripe account and return access token and refresh token, So I think all the integration relay on these new 2 tokens

timid wasp
#

OK, so you are trying to embed a card element inside a Stripe app?

blazing cairn
#

I am a developer of Stripe plugin, previous version our customer need to copy paste the keys from their Stripe account,

#

not inside Stripe app, Our plugin integrated with many Stripe payment methods such as card, sepa, klarna etc

#

previously integration relay on publiushable and secret API kerys

timid wasp
#

No you should never ask your user to expose their API keys

blazing cairn
#

Now it should use refresh token instead?

timid wasp
#

Can you share with me the integration doc that you are currently following?

blazing cairn
#

We are using stripe card elements and Stripe PHP SDK

#

https://docs.stripe.com/api/authentication
https://docs.stripe.com/js/including

Followed this, but Stripe tean asked us to implement Stripe app, now we are on migration process, So please let me know should I replace the secret and publishable key with refresh token to connect with Stripe in thi new Strip app integration?

timid wasp
#

Did your stripe contact send you any docs for you to follow along for the migration?

blazing cairn
#

but in this doc, not found how to integrate card elements!!

timid wasp
#

This is the doc for Stripe app. and Stripe app doesn't support card element.

#

I'd suggest you push back to your stripe contact and tell them this integratoin doesn't work for you.

blazing cairn
#

we are using stripe app to connect with customers Stripe account only

#

card element and other payment method integration is inside our WooCommerce Stripe plugin

timid wasp
#

Ok, To clarify, you want to load a card element for a stripe account that has installed your Stripe app?

blazing cairn
#

Yes

#

the card element need to load on the checkout page of customer site, for this we have integrated stripe card elements and payment intent API (PHP sdk), and this relayed on publishable and secret key, but now plugin authentication is changed to oAuth Stripe app. Then how can I load the card elements and PHP sdk to call payment intent. Oauth authentication token received from Stripe app is a refresh token, then should i use it instead of publishable and secret key

timid wasp
#

Got it. In this case you need to specify the connected account's ID when initializing Stripe.js

blazing cairn
#

But this is for Stripe connect integration?

#

and this also relay publishable key!!

timid wasp
blazing cairn
#

We are not using Stripe connect

timid wasp
#

Then I don't see a way to make API requests on behalf of an account outside a Stripe app.

blazing cairn
#

our plugin customet install our Stripe app to their Stripe account, then we get the access tokens to connect their account with Stripe..

See the screenshot, in the doc they mentioned to use access token to make API call

#

My question is how to initialize card elements using access tokens

timid wasp
#

I have already answered this question. Stripe app doesn't support card element. The only way is to connect your platform with the existing account through OAuth, so that you can include the connected account's ID when initializing Stripe.js

blazing cairn
#

We have already connect the customer account by installing the Stripe app to their account

#

our plugin received the access token for their account

timid wasp
#

That's within Stripe app, but you are now embedding a card element in your own page, which is outside the scope of a Stripe app.

blazing cairn
#

yes

timid wasp
#

Yup, so now you see the difference?

#

Hmm, one sec.

#

I'm not sure if it would work, but can you try initializing Stripe.js with this account ID in your own webpage and see if card element can be loaded?

blazing cairn
timid wasp
#

Yes, your publishable key, and the ID of account that installed your app.

blazing cairn
#

Are you able to find which key is used for this API call
req_SF3UFWiyfuZBpu secret key or refresh token?

timid wasp
#

I'm unable to verify your identity in discord, so I'm afraid that I'm unable to answer questions that could reveal user's integration.

blazing cairn
#

The documentation you've shared, suggest to use publishable key, can we use the access token for the same initialization

blazing cairn
timid wasp
#

No, but as I pointed out earlier, you can get the account ID from the acess token response.

#

So that you can initialize Stripe.js with your own publishable key + account ID

blazing cairn
#

How to get the publishable key using Stripe app connect, becuase when the customet install our Stripe app it return only tokens, account id and user id not publishable and secret keys

timid wasp
#

You use your own publishable key

blazing cairn
timid wasp
#

Sorry can't help. Please reach out to support https://support.stripe.com/contact/email they can verify your identity.

#

But I can tell you this request was made by woocommerce plugin.

blazing cairn
#

thats my own plugin

#

I am the developer , I just tested all the things after migration.

#

Whenever I contacted Stripe discord they quickly resolved the concerns by checking the request IDs

timid wasp
#

Have you tried what I suggested earlier and see if card element is loaded by initializing Stripe.js with your own publishable key and connected account's ID?

blazing cairn
#

OK let met check, my concerns, is there any issues to use publishable key of Stripe account where stripe app published to initiate payment for the customer account, previousle we use customer's own publishable and secret keys

timid wasp
#

Your flow is unique and I've never tried integrating this way. The general integration guide is for a plugin that only live within a Stripe App.