#-7he-judge-_error
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/1423683241751089244
๐ 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.
- -7he-judge-_error, 33 minutes ago, 79 messages
- -7he-judge-_best-practices, 2 days ago, 27 messages
- -7he-judge-_error, 2 days ago, 36 messages
- -7he-judge-_error, 3 days ago, 12 messages
Hello
Can you share a request ID?
It's continue to my last thread
https://discord.com/channels/841573134531821608/1423616248050094162
I do no understand way how to implement it
Let's start with an example request ID so that we're on the same page first
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Can you share a request ID where you're seeing the error?
We have an end to end guide here to set up subscriptions w/ Amazon Pay - https://docs.stripe.com/billing/subscriptions/amazon-pay
req_1DJkxXN5zlqHH1
according to my code
what's wrong there?
{
"error": {
"message": "You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_1DJkxXN5zlqHH1?t=1759503234",
"type": "invalid_request_error"
}
}
const subscription = await this.stripe.subscriptions.create({
customer: stripeCustomer.id,
items: subItems,
add_invoice_items: addInvoiceItems.length > 0 ? addInvoiceItems : undefined,
default_payment_method: defaultPaymentMethod,
discounts: subscriptionDiscounts,
payment_behavior: 'allow_incomplete', // Allow incomplete but try to charge immediately
automatic_tax: { enabled: false },
metadata: typeof dto.metadata === 'object' ? (dto.metadata as any) : {},
});
You're not passing off_session: true
yes, I know
req_uwY4G1jfYqjkYO
Also, I'm not sure how you're saving the payment method prior to the Subscription creation request.
According to the doc - https://docs.stripe.com/billing/subscriptions/amazon-pay?api-integration=setupintents, you should use a SetupIntent to save it first
but transaction - incomplete
subscription - is not active
why are you setting payment_behavior: "allow_incomplete" ?
try just with these parameters - https://docs.stripe.com/billing/subscriptions/amazon-pay?api-integration=setupintents#create-subscription
looking
look at my last disscusion with support
they said the user need to do smth
cause intent has status requires_payment_method
Not exactly.. With off_session: true, we don't expect the user to be around.
Subscriptions API should just charge the payment method at this point
I think you're missing a Step. How exactly did you create the Payment Method before you attempted to use it?
The payment method is missing a mandate
You need to use a SetupIntent and confirm it before you can use that Payment Method with a Subscription
here's my func
๐ changing of the guard, I'll be taking voer the thread,just reading through you code.
okay
Looks like you're trying to create the payment method in advanced with a paymentIntent.
As my colleague, pointed out using setupintents would be better for this.
https://docs.stripe.com/billing/subscriptions/amazon-pay?api-integration=setupintents
Hm, Iโd take a look
But do not close this thread
does this way supports other methods
except for Amazon?
Yes, SetupIntents are the recommended way to createa a payment method in advance before charging.
I'm keep trying to change
๐ Taking over this thread, catching up now
Let me know if you have any further question
I'm confused
What certainly wrong in my variant?
code you look at my code above?
Do we need to adjust logic for each payment method?
Could not work via on implementation?
How are you creating a payment method now? Are you using direct or deferred intent flow? Could you share the code on you create a Payment Method and use it for the subscription?
deffered
I shared right here
Hi taking over here. This thread has been open for a long time. What is your current issue exactly? I don't understand your latest questions
My subscription with Amazon Pay does not work
I tried differect ways, but without result
Can you please share more details. That doesn't give me anything to work with
My colleagues already told you what's wrong with the initial request you shared
So what have you tried since then and what's not working
One moment
I've extended frontent with this code
if (confirmResult.confirmationSecret && confirmResult.requiresAction) {
console.log('Amazon Pay confirmation required');
// Use Stripe.js to confirm Amazon Pay payment
const { error, paymentIntent } = await (stripe as any).confirmAmazonPayPayment(
confirmResult.confirmationSecret,
{
return_url: `${window.location.origin}/checkout/success`,
mandate_data: {
customer_acceptance: {
type: 'online',
online: {
infer_from_client: true,
},
},
},
}
);
if (error) {
onError(error.message || 'Amazon Pay payment failed');
setIsProcessing(false);
return;
}
if (paymentIntent && paymentIntent.status === 'succeeded') {
onSuccess(paymentIntent.id);
} else {
onError('Amazon Pay payment not completed');
}
setIsProcessing(false);
return;
}
is that a correct way?
You should collect payment method via a setupintent per my colleague's advice so mandate is generated at that time
That's how our docs instruct you to do it
hm, after long manipulation
I managed to show authorization page, to accept/decline amazon payment
but after I accept, I being redirected to /checkout page
but not /success
I don't know what you're referring to
You seem to be ignoring our advice and going off and doing things on your own without telling us what those things are
So hard for me to help you
there's a part
responses for authorize payment
how to adjust redirect here correct?
// Handle Amazon Pay confirmation flow
if (
confirmResult.confirmationSecret &&
confirmResult.requiresAction
) {
console.log('Amazon Pay confirmation required');
console.log(
'Using return_url:',
`${window.location.origin}/checkout/success`
);
// Use Stripe.js to confirm Amazon Pay payment
const { error, paymentIntent } = await (
stripe as any
).confirmAmazonPayPayment(confirmResult.confirmationSecret, {
return_url: `${window.location.origin}/checkout/success`,
mandate_data: {
customer_acceptance: {
type: 'online',
online: {
infer_from_client: true,
},
},
},
});```
if (error) {
onError(error.message || 'Amazon Pay payment failed');
setIsProcessing(false);
return;
}
if (paymentIntent && paymentIntent.status === 'succeeded') {
// For Amazon Pay, manually redirect to success page since the return_url might not work as expected
console.log(
'Amazon Pay payment succeeded, redirecting to success page'
);
window.location.href = `${window.location.origin}/checkout/success?payment_intent=${paymentIntent.id}`;
} else if (
paymentIntent &&
paymentIntent.status === 'requires_action'
) {
// Payment requires additional action, but Amazon Pay should handle this automatically
console.log(
'Amazon Pay payment requires action, redirecting to success page'
);
window.location.href = `${window.location.origin}/checkout/success?payment_intent=${paymentIntent.id}`;
} else {
onError('Amazon Pay payment not completed');
}
setIsProcessing(false);
return;
}```