#blue_api

1 messages ¡ Page 1 of 1 (latest)

surreal troutBOT
#

👋 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.

deep pewter
#

I don't understand what you mean by "paying directly on the invoice page without saving any payment intent?". Can you explain?

random flicker
#

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?

deep pewter
#

I still struggle to understand what you want to achieve

random flicker
#

let me reword--

The goal here is a test case:

  1. Create customer
  2. Send invoice
  3. 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.

deep pewter
#

Is it about automation test?

random flicker
#

yeah, end to end testing

deep pewter
random flicker
#

Thanks, so it doesn't seem possible directly