#sinduri_stripe-js-parameters

1 messages ¡ Page 1 of 1 (latest)

bold spindleBOT
#

👋 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/1229751142666469396

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

weary moatBOT
#

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.

brave eagle
#

Hello there! What you have tried should of worked:

Stripe(eh_stripe_val.key, {
  apiVersion: eh_stripe_val.version,
  stripeAccount: acct_1K6RgqSB9POxYCQZ
})
#

What was the issue when you used that?

clever basin
#

ReferenceError: acct_1K6RgqSB9POxYCQZ is not defined

received the above error from Stripe

brave eagle
#

Well it expects a string, so you need to pass it as such: 'acct_1K6RgqSB9POxYCQZ'

#

Otheriwse it's looking for a variable named acct_1K6RgqSB9POxYCQZ

bold spindleBOT
#

sinduri_stripe-js-parameters

clever basin
#

One more question

#

In my WooCommerce plugin , I create payment method using Stripe js, but now I want to create using PHP sdk(server side),
https://docs.stripe.com/api/payment_methods/create, but in this doc we need to pass card number, expriy and cvv, but how to get these values in server side, becuase stripe create elements is in client side using stripe.js

brave eagle
#

You shouldn't be using that API really. It doesn't support 3DS/authentication and by proxy requires raw card data (which you shouldn't be handling). Instead you should be using a Setup Intent to save payment details collected with Elements: https://docs.stripe.com/payments/save-and-reuse

Learn how to save payment details and charge your customers later.

clever basin
#

I dont understand, I've integrated Stripe card payment using payment method API, customer. API and then payment intent API

#

Also my integration relays on card element, not payment element

brave eagle
#

Yeah I mean that is fine, but you can't tokenise server-side like you want to

clever basin
#

What would be the flow, previously I've created payment method and customer and pass those to payment intent API

brave eagle
#

The doc I linked previously has the flow. Generally:

  1. Create a Customer and Setup Intent server-side
  2. Return the client_secret to your front-end
  3. Initialise the Card Element, collect card details
  4. Call confirmCardSetup
clever basin
#

in which step the charge is created?

#

payment intent API not required then?

brave eagle
#

Depends on what it is you're doing. A Setup Intent saves a card, no payment

#

The flow is generally the same, intent type interchangeable

clever basin
#

Okay

brave eagle
#

In a Payment Intent scenario, the charge would happen on step 4 assuming success

clever basin
#

Okay

#

One more question, Our plugin now migrate to Stripe app oauth authentication step

#

So customer click the app install link from our plugin settings page, then redirect to their stripe account and install our Stripe app, then return back to the redirect URI and Stripe return few tokens

#

account id, publishable key, Access and refresh token.

Can you confirm Stripe js initialisation is using this publishable key and account id and Server side API call authorization using access token?

brave eagle
#

You should be using the publishable key of your platform (Stripe App publisher), not the account that installed the app

clever basin
#

But in doc

brave eagle
#

Then I guess that works too sure

clever basin
#

should I use this publishable key, or key of Stripe app publisher as you said?

brave eagle
#

I guess the one returned