#blackoutapp

1 messages · Page 1 of 1 (latest)

rotund crescentBOT
split ivy
#

Are you using Stripe receipts right now? Or a different 3rd party receipt sender?

coral plover
#

right now i'm using stripe receipts but then I have to manually create a PDF receipt for my users who need to show VAT

#

I was on with support last night thinking I could use the API to grab the latest checkout session after listening to a completed checkout, then grab the items, and literally use pdfkit to create an invoice that I could send out but there seems to be problems with getting all of this information in one checkout session. Like I can get the product list but it only gives the descriptions and not the names? Everything else I can get - customer, card type, address, total, etc.

#

pdfkit in a node.js script

split ivy
#

Why not just use Invoices for all your payments? That feels like a much simpler and well-dcoumented path to success here. If that's not feasible though, we can work on getting the info you need, which will likely require you to make additional API calls form your Checkout Session event handler to get more info that's not included in the event

coral plover
#

how would i use invoices for all my payments? As in send an invoice before payment? I just have people go to my website, and click on purchase and it goes to a stripe checkout session

split ivy
#

You would create the Invoice ahead of them getting to the payment form, then you can either send them an email or redirect them to the Stripe-hosted Invoice page. Here's an overview of different integration paths: https://stripe.com/docs/invoicing

here's the quickstart guide if you want to spin up an integration really quick: https://stripe.com/docs/invoicing/integration/quickstart

Create and manage invoices for one-time payments with Stripe Invoicing.

Learn how to create and send an invoice with code.

coral plover
#

so they'd get the invoice with the "due" amount. They'd click into a stripe checkout session and complete it. What would be the receipt saying they actually paid though? A typical stripe receipt?

#

or would this invoice change to "paid" somehow

split ivy
#

They would be redirected to the Invoice payment page, not Checkout. The invoice itself would be shown to them, and the receipt in this case would just be a paid Invoice

coral plover
#

Right but when they download the final invoice it will show it's paid?

split ivy
#

If they paid it, yes

coral plover
#

ok I like that. I could work on that. but could you answer me, from a checkout session list of items object, how can I get the names of the products?

#

i only see description right now. or under the price object, I see a product ID but that doesn't match with any of my products...

#

[ { id: 'li_1NJC1cJ7tfGRbSV6FA5CXh3n', object: 'item', amount_discount: 0, amount_subtotal: 50000, amount_tax: 0, amount_total: 50000, currency: 'usd', description: 'Patch in your lights via the cloud-based fixture database\n' + 'Create and manage your Groups Looks and Favorites quickly and easily using the sidebar\n' + 'Intuitively control every parameter of your fixtures through Fixture Controls\n' + 'Apply preset favorites or looks across groups of lights instantly\n' + 'Customize your Look transitions and make adjustments to your channels blindly without affecting the live set in Looks Expanded\n' + 'Create and deploy virtually any effect across any fixture type using our advanced effects engine\n' + 'Create your own profiles using the custom fixture editor', price: { id: 'price_1KjCEMJ7tfGRbSV6f7Whrf9w', object: 'price', active: false, billing_scheme: 'per_unit', created: 1648687878, currency: 'usd', custom_unit_amount: null, livemode: true, lookup_key: null, metadata: {}, nickname: null, product: 'prod_LCZ4MD2H12E7H5', recurring: null, tax_behavior: 'unspecified', tiers_mode: null, transform_quantity: null, type: 'one_time', unit_amount: 50000, unit_amount_decimal: '50000' }, quantity: 1 } ]

split ivy
#

how can I get the names of the products?
You can create Products and Prices ahead of time, which will show up in the Invoice's lines hash

#

The Product is this: prod_LCZ4MD2H12E7H5

coral plover
#

yes i see htat

#

but my list of products is
prod_Jcq87XdsHJE8W3: 'Additional 2 Devices for Basic + 2U', prod_JL0252J8xf7j84: 'Additional 2 Devices', prod_HWRmxJqEaxS3NZ: 'Premium Upgrade', prod_HWRluPRAdkLPXX: 'Premium Plan', prod_HWRjoeBcUObrKa: 'Additional Universe Unlock (Addon)', prod_HWRetbn2tYQXSY: 'Basic Plan'

split ivy
#

Are all those products included in this particular invoice? You only listed 1 line item, so just looking at the payload you sent leads me to believe that you have an invoice with only 1 line item

coral plover
#

that's correct

#

an invoice with 1 item

#

oh shoot so you're saying this is not properly implemented in my backend

#

like it's not actually using the correct products when we go to a checkout session

#

the above list of products was me doing a GET request on list all products via your API

#

I just put them in a dictionary for quick lookup

split ivy
#

AH, okay yeah if you did a GET request to List All Products in the API, then you should get back all the Products you've created so far

coral plover
#

ok thanks I'll look into this more