#blue_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/1335873862805491742
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I don't understand what you mean by "paying directly on the invoice page without saving any payment intent?". Can you explain?
For example, when I handle the checkout process, I can call endpoints to pay directly with a payment method
async payCheckoutSession(id: string) {
const session = await this.stripe.checkout.sessions.retrieve(id);
// Not sure what this is used for, but I have seen the GET in another fixture.
//https://github.com/stripe/stripe-cli/issues/516
// Possibly something to trigger an internal process.
void await supertest("https://api.stripe.com")
.get("/v1/payment_pages/" + session.id)
.auth(Config.stripe_secret, "")
.expect(200);
const paymentMethod = await this.getPaymentMethod();
// Make the payment.
await supertest("https://api.stripe.com")
.post("/v1/payment_pages/" + session.id + "/confirm")
.auth(Config.stripe_secret, "")
.type("form")
.send({
payment_method: paymentMethod.id,
})
.expect(200);
}
and that payment method isn't saved
i'm not sure if "intent" is the right word, but the invoice pay endpiont requires a payment method saved with the customer, which makes sense. but is there a way to simulate them paying through the web ui while not saving their payment method?
like if they went here directly (test mode): https://invoice.stripe.com/i/acct_1Gb9HMEzdi6yG8Gs/test_YWNjdF8xR2I5SE1FemRpNnlHOEdzLF9SaGZoSVFNOE5pMmtMS0lFVHJDQ28wcnJpcXdDRXl5LDEyOTEwNzcxNQ0200gN4GQ4CQ?s=db - they wouldn't need a payment method saved, would they?
I still struggle to understand what you want to achieve
https://docs.stripe.com/testing?testing-method=payment-methods#cards are you looking for some test payment method IDs?
let me reword--
The goal here is a test case:
- Create customer
- Send invoice
- Pay invoice <-- I'm on this step
The Stripe API can pay the invoice if a paymentMethod is registered with the customer. I can do that, but I'm wondering if there is a way to simulate using the payment portal (i.e. the invoice.stripe.com link). That is, they visit the portal and pay directly, without saving a payment method on their account.
Is it about automation test?
yeah, end to end testing
Front-end interfaces, such as Stripe Checkout or the Payment Element, have security measures in place that prevent automated testing
https://docs.stripe.com/automated-testing#client-side-testing
Thanks, so it doesn't seem possible directly