#elias117-checkout-session

1 messages ยท Page 1 of 1 (latest)

hoary jackal
#

Hi there ๐Ÿ‘‹ you can definitely create a checkout session to charge for a specified amount, but let me double check coupling that with Stripe Tax.

sand ferry
#

Ok !

hoary jackal
sand ferry
#

ok is there a guide on the .net core stripe package

#

I'd like to be able to create a checkout session with the amount and credit card information

hoary jackal
#

When you're looking at the code snippets in our guides, they should have an option to toggle the language that they display in. The point of a checkout session is to collect the customer's payment information, if you already have the card details, then a checkout session may not be the right path. Can you tell me a bit more about the flow you're trying to accomplish?

sand ferry
#

certainly

#

I have the amount I want to charge and I have the credit card information and billing address of the customer

#

all I want to do is make a call to an api endpoint that takes all that information and calculates the tax automatically

#

and charges the card

#

returns if it succeeded or not

hoary jackal
sand ferry
#

yes it is

#

or I at least can make a payment method object with the info if need be

#

right now i believe i have it as this

StripeCreditCardPaymentInfo Object

#

I do have it in a payment method object

#

var paymentMethod = new PaymentMethodCreateOptions
{
Type = "card",
Card = new PaymentMethodCardCreateOptions
{
ExpYear = info.ExpirationYear,
ExpMonth = info.ExpirationMonth,
Cvc = info.Cvc,
Number = info.CreditCardNumber.Replace(" ", ""),
},
BillingDetails = new BillingDetailsOptions
{
Name = info.CardHolderName,
}
};

#

I use that to create the payment method

hoary jackal
#

Gotcha, so you can't do automatic tax directly on a Payment Intent, which leaves you with a couple options.

  1. You could create a subscription, this doesn't sound like the right fit as sounds like you're trying a one time charge
  2. You could create a checkout session, but if you already have the payment method this may not make much sense
  3. You can create an invoice to handle this flow. There are a couple steps to this as you'll need to have a customer object created, add the invoice line(s) to them, and then create the invoice.

Please bear with me a moment, I'm going to test something and see if that might work for your needs.

sand ferry
#

yeah this would be a one time charge

hoary jackal
#

Apologies about that, the test didn't do what I'd hoped.

#

So given the provided information, I think invoices are going to be the path that you want.

sand ferry
#

ok creation on invoices

#

are there docs on that

hoary jackal
sand ferry
#

I see rather than creating a price object I can just pass in the price_data instead. Am I understanding correctly?

hoary jackal
#

Yup. You may still need to create a product object though. That will depend on what you're selling, and if you're going to need different tax codes for them. If you only sell one type of product, then you set a default tax code at your account level that will be applied whenever using automatic_tax, but if you're selling different types of products then you'll need product objects to map them to the various tax codes.
https://stripe.com/docs/tax/products-prices-tax-codes-tax-behavior

sand ferry
#

yeah unfortunately this may not be the path we need to take. Its a food delivery business and we are trying to grow across several regions. we cant create product objects for all our vendors menu items

#

well we can but it may be too much work

#

is there anyway we can take tax on a payment intent automatically?

hoary jackal
#

No, you can't use do automatic tax calculation on a payment intent. It's also worth noting that in order for us to automatically calculate tax, you have to tell us what is being sold as tax rates fluctuate based on this information.

sand ferry
#

oh ok

#

well thanks so much is there a way I can keep this thread open

hoary jackal
#

I can leave it open until the end of my shift (about another hour), but if it's archived you can always send us a new message in #dev-help and we can re-open this one or create a new one.

sand ferry
#

is there a way I can see it when it is archived

hoary jackal
#

I think so. In my view there is a # icon near the top of the window (near the notification bell and pin icon). Clicking on that shows me all threads and I can search in there, do you see something similar?

sand ferry
#

yes i do

#

thanks

hoary jackal
#

Awesome! Happy to help ๐Ÿ˜„