#jmak-pricingtable-customization
1 messages · Page 1 of 1 (latest)
Are you looking for a no-code option? Or an API custom integration option?
Either is fine. I imagine API gets me more flexibility since I will need to update something in my backend but no code is welcome too
So there's the Pricing Table: https://stripe.com/docs/payments/checkout/pricing-table , which is a no-code option
Then there's a bunch of other ways to do the custom integration. You would need to create your own landing page that has custom displays to show each of the different pricing plans, then once the user selects one you could either direct them to Stripe Checkout (low-code: https://stripe.com/docs/payments/checkout) or redirect to the Payment Element (more-code: https://stripe.com/docs/payments/payment-element)
after they select a plan how do i modify my backend? I assume its something i track via events?
Yep! You'd configure a webhook endpoint to listen for key events: https://stripe.com/docs/payments/checkout/pricing-table#handle-fulfillment-with-the-stripe-api
Here are the docs for webhook endpoints: https://stripe.com/docs/webhooks
okay. Lets say I want to do the code version because I don't actually want them to be subscriptions per month. I want it to instead be different payment plans they can purchase for tokens to be used on my site
can the no code version support that?
for example $5 for 500 credits, $10 for $1100, etc
Yeah, that's supported. You would just need to create the amount on the fly based off of user input. Obviously the token tracking would need to happen on your end, but I don't see any reason that wouldn't work
Or just create a Price with an amount of $1 and then update the quantity on it
Yes, our pricing tables have functionality to highlight a certain product
wow nice!
is there any other branding I can add to this?
or multiple ways to highlight different products
for example i want some to be best deal
and some to be most popular
I don't know if there is a way to highlight multiple but can check
For branding are you talking about customizing colors and such?
yeah like can i add a logo or something
also i notice that the code is live, is there a way to test via test mode?
specifically because there are a lot of different payment events on my site and i need to properly track
As long as you have "test mode" toggled on in your dashboard the pricing table will be created in test mode
Our docs show the ability to add pictures but I am not seeing if that is something you set on the table or if it is just the product/price info https://stripe.com/docs/payments/checkout/pricing-table
ohh
i see
it doesnt carry over
got it ok
i just want a little more brandin on the page cos it seems bland
So it looks like the image and description are the ones from the product
Not seeing a way to specify multiple highlighted prices though. I can put in a feature request for that
got it okay
so i cant add like a custom background or anything
its just like that white color
I think so
jmak-pricingtable-customization
you can configure the color in the Dashboard, but not add a custom background
okay got it
and after i set each price point, is there a way to differentiate in the events
which one was purchased
i see a unique price ID for this listing
i assume thats just also a unique object id
also, is there a way to prefill some of the info of th pricing table if i have that info
also redirect and whatnot
it looks like there is no way to show a confirmation and then also redirect
it looks like though it the checkout.session.completed event, i'm not sure where I can see what was purchased
by default we don't tell you what's in the Checkout Session
but you can ask the API explicitly for the line items and get that information
how do i do that using the no code version?
not sure what you mean. There's no no-code version to do anything like this. Or you manually look in the Dashboard
oh, your colleagues recommended that I make the payment table using the no code version
how do i include the properties i want inside the pricing table?
I'm sorry I have no idea what you are asking
the PricingTable is a nocode version that lets you render a UI offering multiple pricing option. That works. You were explicitly asking about something completely separate for reconciliation after someone pays
The pricing table is created, but I currently am getting checkout session completed events after paying. I want to know which product they brought from the pricing table
how do i do that
otherwise i can't properly communicate to my BE on updating the user records
That's what I explained to you. You have a back-end, it's not "no code". Like you, in your own backend/webhook handler, write code to get that information
yes i understand that
so i am asking you how to include proper checkout information for the products in the pricing table
you haven't answered that question
but I don't understand that question
?
im simply asking how to transmit product info for products inside my pricing table
the PricingTable is a client-side no code integration. You configure the Dashboard with a list of Prices, you get the UI client-side, it sends your customer to Checkout. There's alreayd "including products in your pricing table"
but it doesn't include product ID
otherwise how do you even know what the customer has purchased
lol
I'm sorry we're talking a bit past each other right now
Can you confirm that you are solely trying to figure who bought what in your webhook handler on your back end code?
perfect, so that's what I was explaining. Let's agree that this is completely unrelated to the PricingTable itself which is the client-side UI to offer pricing options. It is solely about after the payment which is handled by Checkout.
Your code/webhook handler gets a checkout.session.completed Event to indicate someone paid on Checkout. That Event contains information about the Session itself like the Customer id if any, the amount, etc.
It does not include the line items information by default. This information exists and you can request it but you have to make an explicit API request, that's what is documented in the link I gave you earlier: https://stripe.com/docs/expand#includable-properties
If you make that explicitly call you can see the line item(s) on that Session, the Price details and the underlying Product id if needed
so by default the pricingTable products already have that information, I just need to expand it in the webhook handler
correct
okay that makes sense to me thank you
then my next question is regarding microtransactions
assume one of the payment options is a $1 microtransaction, should the pricing table then just have a $0/mo plan but then a line item with $1?
because i don't see that as an option in the pricing table
I don't really understand your ask sorry
I am trying to make a microtransaction item for purchase
according the stripe documentation you recommend grouping them together via this $0/mo plan and then invoicing by line item
sure but that requires you writing all of this entirely yourself. The PricingTable doesn't support anything like this. It's an easy no-code solution to offer various pricing options and take a payment upfront or start a subscription
so if i had a $1 option on the pricingtable, there is no way to instead batch it ?
I don't get what batch it means. I'm sorry, I'm not trying to be difficult but this is super vague. Batch what, in which context? Like the customer comes and pays on the PricingTable 7 times that day and you want to batch all $1 payments as one big $7 payment? Something else? I would need you to be a lot more explicit about what you are trying to achieve here
option 2 or option 1
they both in essence batch txns together
I mean there's no two options in my sentence. Please take a minute to write full sentences explaining what you are really trying to achieve.
But the concrete example I gave is definitely impossible with PricingTable which would literally just take a $1 payment 7 times separately
i dont get how this is misunderstood -- if you read the documentation that was instructed it literally tells you how they are bundled
but yes you would batch the txns for customer on some time period, say at EOD or EOW
but you have answered my question saying the pricing table would not support this
Would the other option be then to engineer my own pricing table modal and include 3 individual checkout sessions
the documentation which you just took a picture of (so not sure which one it is, we have hundreds of docs) is not for the PricingTable though.
Would the other option be then to engineer my own pricing table modal and include 3 individual checkout sessions
I don't think so. Like if you want to "batch" transactions, you need a lot more than this. You need to collect payment method details upfront, you need to track transactions over a certain period, you need a cron job that will charge the customer for that amount, handle declines, etc.
there are many ways to build this and it depends a lot on what you are really after
okay but how do i actually do the part where it says subscribe them to a $0/mo plan and then add in line items
So you can use the PricingTable for the $0/day or week recurring Price. But the rest you have to build yourself. Like in your app whenever someone goes and donates say $0.50 or something, you would create an InvoiceItem for that amount (what the doc indicated) and then each day/week (depends on your choice) we will cut a new Invoice for the Customer and charge them "all the InvoiceItems" together
so I visit your app, when I want to pay you send me to Checkout to create a $0/week subscription. Then you add an InvoiceItem for $1 today
On Thursday I come and donate $1.5 so you add a new one.
On Sunday I come and donate $2.75 and you add a new one.
Next Wednesday, the new weekly billing cycle starts, so we create an Invoice for the $0/week Price, and we pull in the pending InvoiceItems so we charge you $0 + $1 + $1.5 + $2.75 = $5.25 for that week
yeah okay so this part
"so I visit your app, when I want to pay you send me to Checkout to create a $0/week subscription. Then you add an InvoiceItem for $1 today"
is not possible via pricingTable right?
I don't see a configurable option where It can be a $0/mo charge and then $1 line item
correct, you do the $0/month part and after, with code, when you get checkout.session.completed you add the InvoiceItem for $1
okay i get it.
One last question -- I've indexed into LineItems.Data[0].ID to get the ID but it doesn't seem to be product ID, its like an id that starts with li_
maybe thats just the line item ID, but how do i get the actual product ID?
the client reference ID is also null from the PricingTable
yes i am looking at this right now
but i don't see the proper field for the product ID
Ore here https://github.com/stripe/stripe-go/blob/master/lineitem.go#L31-L55 in stripe-go
Sure because there's a Price ID which is what you are selling. And a Price is associated with a parent Product itself. So you need to expand the Price to get to the Price details and see the parent Product id
okay so i should use the price_ id instead of the prod_ id right
because i see two associated ID's here
I mean you can get the Product ID too with what I explained above
it's important to understand that many of our API resources are "connected" to each other, a bit like foreign keys on a database
oh i see it
A Checkout Session points to LineItems, those point each to a Price, which each points to a Product, etc.
its like data.price.product.id
and the Expand feature https://stripe.com/docs/expand allows you to get more details all with one request
got it so the price IDs are unique and linked right
like if there are two $4 items, the price Ids are still unique
so yeah when you call https://stripe.com/docs/api/checkout/sessions/retrieve then you can expand line_items.data.price to get back a full Price id and have product: 'prod_123' in that response
and yes
also i had more of an operational question here
if tax is not immediately collected, is the alternative to have my accountant do these tax calculations for my business?
I would assume so, sorry I can't really speak to that, you should talk to your accountant who likely will tell you you have to collect tax as part of the original payment, or make it inclusive or something
okay no worries thank you for all the help i think i have enough to proceed