#asifarub_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1349755911161380951
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- asifarub_code, 16 hours ago, 29 messages
- asifarub_docs, 1 day ago, 46 messages
Hello there
How are you collecting the PaymentMethod here?
Have you confirmed that you are using the correct client secret here?
hello
sorry what do you mean by client secret?
i received it after subscription, but i am not using it after
since i set confirm=True in setupIntent api
Gotcha, you don't want to use the SetupIntents API at all here.
How are you collecting the PaymentMethod?
Are you using Payment Element?
Okay so at this step where it talks about calling confirmPayment() (https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#submit-the-payment) you use the latest_invoice.payment_intent.client_secret
That will confirm the initial Invoice's PaymentIntent on the Subscription and move the Subscription to active.
client secret will be the secret from subscription api
Yes, you access it from latest_invoice.payment_intent.client_secret in the Subscription creation request's response
IntegrationError: Element confirming payment is "expressCheckout", but stripe.confirmPayment() was not called within the "confirm" event. Please call stripe.confirmPayment() in the "confirm" event (
stripe.SetupIntent.create(confirm=True, customer=customer.third_party_id,
confirmation_token=data['card']['confirmation_token'])
this is my setupIntent before creating subscription
ok sorry
The Subscription creation creates a PaymentIntent for you
let me remove that code then
And you use that PaymentIntent to both collect the payment method and pay the initial Invoice
getting the same error
Can you show me your relevant code?
Ah okay no need to create a confirmationToken here.
this is a recurring subscription
this is the client secret created from subscription
ClientSecret: pi_3R2DOn4auD8P2Izr0C74hiYj_secret_yPX29Ld1aVFz859mOdX8gOTxp
error
ClientSecret pi_3R2DOn4auD8P2Izr0C74hiYj_secret_yPX29Ld1aVFz859mOdX8gOTxp
IntegrationError: You must pass in a clientSecret when calling stripe.confirmPayment().
subscription backend api, this is how i am retrieving the secret
client_secret = primary_subscription['latest_invoice']['payment_intent']['client_secret']
Have you logged out the client secret on your frontend?
yes, i printed client secrent on my frontend console
console.log("ClientSecret",clientSecretPurchase);
and are you passing it as an object or directly as a string?
as a string
quiestion, previously when i had intent everything went through fine. But my payment was incomplete because it is my actual credit card in google wallet. Do i have to add test card?
Yeah it should be clientSecret: clientSecretPurchase in that case.
๐
you can close this chat