#ubi
1 messages ยท Page 1 of 1 (latest)
Not that I know of. I did a quick google search for repos too and didn't come up with anything I could fully endorse (i.e. anything Stripe created)
I am getting a bit lost in terms of when I should update the payment intent. At CourseCareers (we are client of yours already), we have either a full-payment of a course or payment plan of 4 payments up to X amount
So I am not sure how to do the payment, ideally I would send the information to the backend (billing address, and whatnot) to calculate the taxes, update the payment intent and then confirm the payment intent in the backend, I think
Most of that actually happens on the front end. It's a matter of PCI compliance that no PII touches your server, so I would recommend against that approach. Have you built anything yet?
10000% agree with you, I dont want to deal with PCI at all
I have few things built, but nothing concrete
the frustrating situation is that Stripe doesn't allow us to do the Payment Plans the way we want it, so here i am doing everything manually (which again, I dont want to do it)
By now, we are trying to see if we can have a call with Stripe Eng to figure out how to move forward (hopefully the volume moved justify it to some extent, I never dealt with Stripe before)
What ideas have you workshopped for getting this system up and running so far? Have you looked at Checkout? The Payment Element?
Also, feel free to drop your account ID in this chat if you think it's helpful for me to have context on your account.
let me find that
Account ID: acct_1DLW9RGnI4RXc2fN
We can't use Checkout due to the Payment Plan needs, and I have done some work already around the Payment Element
const handleSubmit = async (event: any) => {
// We don't want to let default form submission happen here,
// which would refresh the page.
event.preventDefault();
// if (!stripe || !elements) {
if (!stripe || !elements) {
// Stripe.js has not yet loaded.
// Make sure to disable form submission until Stripe.js has loaded.
return;
}
setLoading(true);
// Trigger form validation and wallet collection
const { error: submitError } = await elements.submit();
if (submitError) {
handleError(submitError);
return;
}
// const addressElement = elements.getElement('address');
//
// const {complete, value} = await addressElement.getValue();
//
// if (complete) {
// // Allow user to proceed to the next step
// // Optionally, use value to store the address details
// }
// Create the PaymentMethod using the details collected by the Payment Element
const { error, paymentMethod } = await stripe.createPaymentMethod({
elements,
params: {
billing_details: {
name: 'Jenny Rosen',
},
},
});
if (error) {
// This point is only reached if there's an immediate error when
// creating the PaymentMethod. Show the error to your customer (for example, payment details incomplete)
handleError(error);
return;
}
console.log(paymentMethod);
// Create the PaymentIntent
const res = await fetch('/create-confirm-intent', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
paymentMethodId: paymentMethod.id,
}),
});
const data = await res.json();
// Handle any next actions or errors. See the Handle any next actions step for implementation.
handleServerResponse(data);
};
that is what I am going for thus far more and less
I am not sure if I should use the value from the address component to put it in the billing_details myself manually. Should I?
I also need to send it to the backend to be able to calculate the taxes in the backend
What guide are you following?
by now, honestly like 2-3 pages and putting stuff together
I am using https://stripe.com/docs/tax/custom to figure out the taxes
I am trying to get the full code example to figure out the ... details hehe
Like they have calculateCart endpoint, but how is the confirm payment being handled?
i'm not sure, since calculateCart isn't a stripe method, it's hard to say how that might interact with the payment confirmation
right ... well, that is where I am, like, I dont know how the whole thing suppose to work together
My assumption is that you need to map stripe products and prices to whatever mechanism is being used in the calculateCart method
we dont use Products
We tried
but Products + Subscriptions doesn't cut it for us due to the Payment Plan screwing the whole thing
You can still use products and prices without using subscriptions
Not sure how, the total Price is fixed, but the Payment Plan prices are not
Like, the Product isn't a One-Time purchase, unless we create always two Products
- Full Price of a Course
- Payment Plan Price of a Course (then charge 4x)
No?! Like I am not sure what you are thinking honestly
You can have an infinite amount of products and prices, so creating them on the fly is totally fine
How would that help me?
Not sure how, the total Price is fixed, but the Payment Plan prices are not
You said the total Price is fixed, but if you create it on the fly, it doesn't matter if it's fixed right?
Can you give a step by step example of what you're actually trying to do? I feel like we're getting a bit into the weeds
Please be patient with me, I dont want to burn you out, I am seriously trying to figure this out, reasons why I am been trying to get someone in a Zoom call or whatever
Right hold on!
Let me see if uploading a video would help here
Doesn't have audio 
So basically either One-Time Payment or a Payment Plan of 4 Payments every 2 weeks
Got it. So do you have a working form that accepts/creates payment methods already?
I mean the one we have we are replacing all together, so all of that goes away
I am in the middle of doing everything from scratch at the moment
https://dashboard.stripe.com/test/payment-links/create?price=price_1N6LGYGnI4RXc2fNUKeAxgXq
I am there thus far:
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that would work, but it can only be 4 payments (so it is not recurring forever) and we need it to be bi-weekly
and we need to be able to apply a one-time coupon (so we handle the coupon situation completely)
Okay, so you're starting from scratch. Got it. Okay, so here's how I would handle this going forward.
- Get a prototype of the Payment Element working. This prototype should set up new payment methods for future usage, so that you can work with a Payment Method object: https://stripe.com/docs/payments/quickstart?client=html I would pay particularly close attention to step 5 here called "Save payment details after payment" --> https://stripe.com/docs/payments/quickstart#save
- Once the above is done and working in test mode, focus on just the $499 payment side of things. This will require very little changes to your existing code, since you're only accepting a one-time payment. You can always reference the quickstart guide above if needed.
- Once the above is done, look into integrating with Subscriptions: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements this will teach you how to build a subscription integration that auto-terminates after 4 payments
All of the above guides have a "Custom code" option, and a "Prebuilt Checkout" option. I'll leave it up to you to decide which is best for your use-case
Working on it
@full stratus is there anyway to use the Payment Link where we forced the authenticated user and also apply a coupon behind the scene ourselve?
these two prices should work for us!
I can stop the Subscription after 4 payments I guess, no?! Like the one that say $150 every 2 weeks
No?
๐ Stepping in since my teammate had to run!

You could use PaymentLinks but having to monitor and cancel the subscriptions after 4 payments might be more of a hassle
How do you recommend it to do it then?
I recommend looking into Subscription Schedules to organize the installments: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans
You could build in the logic to automatically cancel the subscription after X number of iterations
I recommend building your one-time payment integration as two-shoes mentioned above, and also using test clocks to play around with the subscription piece: https://stripe.com/docs/billing/testing/test-clocks
alright, sending the version version to one-time payment
I dont see the Taxes being applied there 
Should I use "Product" id to simplify things?
Okay, not sure I follow your question. Is your goal to have Stripe prompt customers for their address details and automatically calculate tax, or will you collect those address details yourself and pass these to Stripe for tax calculation?
Ideally, Stripe collects the address and calculate the taxes for us
Intent: calculate taxes
Got it. In that case you'll want to integrate with Stripe Checkout instead of creating the PaymentIntent yourself
Is that the Payment Links or something else?
How could I use the Checkout and apply a coupon behind the scene for users? they dont enter anythiong
You can set the coupon when creating the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts
PaymentLinks use Sessions under the hood but if you need to add a coupon/discount, you should create the Checkout Session yourself, not use PaymentLinks
almost there 
I need mental support with this one, thank you so much peeps for the help thus far
LETS GOOOOOOOOO
50% of the problems solved!
I need the payment plan now!
Is there anyway to do the Checkout with the subscriptions now?!
Yep, there's subscription mode for Checkout, though you'd still need to handle the number of billing cycles separately: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-mode
normally, every 14 days up to 4 payments
In other words, you'll still need to either track the number of billing cycles yourself to know when to cancel the subscription, or you'll need to add a Schedule to the subscription that gets created with the Checkout Session
I recommend playing around with Schedules and test clocks, then coming back to this channel if you run into any issues
could I use price thingy to be the one that I setup to be $150 every 2 weeks type of thing?
regardless, I can deal with the canceling situation for sure, that isn't a big deal
You could, yes. Since that's a recurring price, you'd need to use subscription mode when creating the Session
so, to follow up, I did add the second pricing
but now I need to control in my end that the user made 4 payments
Is there anything in Stripe to control that at all?
๐ taking over here
Could you elaborate a bit more on controlling the user made 4 payments?
Like you want a customer can only put maximum of 4 payments?
so I have a Price that is $150 every 2 weeks, I need to control a subscription for 4 payments
Yeah but what is exactly control for 4 payments?
Ideally, Stripe
Check that link
It says "$130.00 every 2 weeks" what it is missing is that it will be 4 payments in total
In other words, you'll still need to either track the number of billing cycles yourself to know when to cancel the subscription, or you'll need to add a Schedule to the subscription that gets created with the Checkout Session
That
I am not sure how to do the Schedule part of the subscription
or you'll need to add a Schedule to the subscription that gets created with the Checkout Session
I would like to to do that

Hi, sorry I am juggling between threads. I see that you want only total of 4 payments, so it's total of 4 billing cycles, correct?
My colleague meant to create a normal Subscription via Checkout first, then create a Subscription Schedule from it and modify the Subscription Schedule so it only has 4 cycles.
You can refer to this doc: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription and then play with it in Test mode!
I will resume tomorrow, but honestly, it is going over my head right now the situation. Thank you for the help today. Really helpful.