#jnarowski

1 messages ยท Page 1 of 1 (latest)

honest tangleBOT
honest spruce
#

Do you want to use an invoice?

#

It's one option, but not required

honest tangleBOT
robust egret
#

I don't need invoice

#

can i create and charge if i have customer cc already?

#

can i associate price/product with payment intent

teal kernel
#

PaymentIntents don't interface with Prices and Products, you can informally use them together by referencing the price when setting the amount for the intent but they don't have parameters that reference each other or anything

#

You can directly create a PI to charge any CC that you have saved and set up for future use

robust egret
#

A user is purchasing a one-off product. Which api do you recommend?

#

Seems like invoices might create a nice paper trial. Can I create invoice, add line items and charge it all at once?

#

Not opposed to PI

teal kernel
#

Either can work. Invoices do provide a more robust paper trail though PaymentIntents can send out receipts which are sufficient for some uses. https://stripe.com/docs/receipts

#

The Invoice API will require separate calls to create the invoice items and to create the invoice. Can't be done all at once but is still feasible to use for many flows

robust egret
#
    const invoice = await stripe.invoices.create({
      customer: organization.stripe_customer_id,
      collection_method: 'charge_automatically',
    })

    const invoiceItem = await stripe.invoiceItems.create({
      customer: organization.stripe_customer_id,
      invoice: invoice.id,
      price: product.stripe_price,
    })
#

will that do what I want, or do I need another call to actually process the invoice?

teal kernel
#

Though you can also swap those steps and make sure to pass auto_advance: true when creating the invoice, that will tell the invoice to automatically finalize and charge the user in an hour

honest tangleBOT
robust egret
#

ok sounds good. THanks1

#

I think I will try it with payment intents first to keep things simple

#

another question, can we use stripe checkout but pass in an existing customer source if they already have one, or is the credit card always have to be typed in manually?

teal kernel
honest tangleBOT
robust egret
#

ok thanks.

#

can I create and charge a paymentIntent in a single call?

neon quiver
#

If the Payment Method is attached to a Customer you will need to provide the Customer ID as well

robust egret
#

got it. Thanks