#jc-ashley_api

1 messages ยท Page 1 of 1 (latest)

tall trailBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1251197278635430091

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

quartz matrixBOT
real timber
#

Hi there ๐Ÿ‘‹ sorry, but I don't understand the scenario you're trying to describe.

Are you using Checkout Sessions in your flow, and want to enable Invoice creation for that flow? Or are you wanting to manually create an Invoice and then process a payment for it?

real timber
#

@torpid forge are you still around to provide more clarity on what you're trying to accomplish?

torpid forge
#

yes sory

#

I saw your first message and though it was automated lol

#

basically we have created a checkout page where we are charging the customer using their stripeId the transaction goes through but no invoice is created. I want an invoice like a recept to be generated for the customer.

real timber
#

Do you want an actual Invoice, or a receipt?

tall trailBOT
torpid forge
#

well when my manager and I were talking about setting this up we said inoices.

#

they just want when someone subscribes an inoice is recorded and on every payment after that one is made.

#

we have a profile page where the invoices will be displayed and they can view them from there.

#

basically I am using a payment method here that charges the customer:

const { error } = await stripe.confirmPayment({
  customer: paymentInfo.customerId,
  clientSecret,
  elements,
  invoice: true,
  invoice_items: [
    {
      amount: paymentInfo.amount,
      currency: 'usd',
      // description: description,
    },
  ],
  one_time: true,
  subscription: {
    plan: 'price_123',
  },
  confirmParams: {
    return_url: `${window.location.origin}/completion`,
  },
});
#

the inoice keys here are just my attempts to activate the invoice part.

real timber
#

It sounds like this whole flow may be easier if you use Subscriptions instead:
https://docs.stripe.com/subscriptions

But if you want to manually handle processing your recurring payment and want an Invoice for those payments, you need to build your flow the other way around. Instead of processing a transaction and then trying to get an Invoice, you need to first create the Invoice and then process the payment for it.
https://docs.stripe.com/invoicing/integration

torpid forge
#

ok that makes since. so I need to create the invoice then charge the invoice to the customer is what you are saying?

real timber
#

Yup

torpid forge
#

ok for how the workflow goes:

  1. The customer selects the product they want
  2. the checkout page loads with the paymentIntent
  3. the customer is charged for the product they want.

I think where the invoice creation is needed is between step 2 and 3. am I right?

real timber
#

Between 1 and 2, you need to generate the Invoice so you can use the Payment Intent it creates for rendering your payment form.

torpid forge
#

ok. now if the customer goes back and selected a new plan then a new invoice will be created then also.

Does this make since should I talk to my manager about just displaying transaction history

#

thanks for helping me I am an intern and scared to screw something up lol