#ubi

1 messages ยท Page 1 of 1 (latest)

void fableBOT
full stratus
#

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)

patent token
#

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

full stratus
#

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?

patent token
#

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)

full stratus
#

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.

patent token
#

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

full stratus
#

What guide are you following?

patent token
#

by now, honestly like 2-3 pages and putting stuff together

#

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?

full stratus
#

i'm not sure, since calculateCart isn't a stripe method, it's hard to say how that might interact with the payment confirmation

patent token
#

right ... well, that is where I am, like, I dont know how the whole thing suppose to work together

full stratus
#

My assumption is that you need to map stripe products and prices to whatever mechanism is being used in the calculateCart method

patent token
#

we dont use Products

#

We tried

#

but Products + Subscriptions doesn't cut it for us due to the Payment Plan screwing the whole thing

full stratus
#

You can still use products and prices without using subscriptions

patent token
#

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

  1. Full Price of a Course
  2. Payment Plan Price of a Course (then charge 4x)
#

No?! Like I am not sure what you are thinking honestly

full stratus
#

You can have an infinite amount of products and prices, so creating them on the fly is totally fine

patent token
#

How would that help me?

full stratus
#

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

patent token
#

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 facepalm

#

So basically either One-Time Payment or a Payment Plan of 4 Payments every 2 weeks

full stratus
#

Got it. So do you have a working form that accepts/creates payment methods already?

patent token
#

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

#

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)

full stratus
#

Okay, so you're starting from scratch. Got it. Okay, so here's how I would handle this going forward.

  1. 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
  2. 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.
  3. 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

void fableBOT
patent token
#

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?

nova acorn
#

๐Ÿ‘‹ Stepping in since my teammate had to run!

patent token
nova acorn
#

You could use PaymentLinks but having to monitor and cancel the subscriptions after 4 payments might be more of a hassle

patent token
#

How do you recommend it to do it then?

nova acorn
#

You could build in the logic to automatically cancel the subscription after X number of iterations

patent token
#

alright, sending the version version to one-time payment

#

I dont see the Taxes being applied there ThinkforaseK

#

Should I use "Product" id to simplify things?

nova acorn
#

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?

patent token
#

Ideally, Stripe collects the address and calculate the taxes for us

#

Intent: calculate taxes

nova acorn
#

Got it. In that case you'll want to integrate with Stripe Checkout instead of creating the PaymentIntent yourself

patent token
#

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

nova acorn
patent token
#

almost there sad

#

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?!

nova acorn
patent token
#

normally, every 14 days up to 4 payments

nova acorn
#

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

void fableBOT
nova acorn
#

I recommend playing around with Schedules and test clocks, then coming back to this channel if you run into any issues

patent token
#

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

nova acorn
#

You could, yes. Since that's a recurring price, you'd need to use subscription mode when creating the Session

patent token
#

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?

waxen thunder
#

๐Ÿ‘‹ taking over here

patent token
#

just to triple confirm by now

#

@waxen thunder wavey

waxen thunder
#

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?

patent token
#

so I have a Price that is $150 every 2 weeks, I need to control a subscription for 4 payments

waxen thunder
#

Yeah but what is exactly control for 4 payments?

patent token
#

Ideally, Stripe

patent token
#

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

patent token
waxen thunder
#

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.

patent token
#

I will resume tomorrow, but honestly, it is going over my head right now the situation. Thank you for the help today. Really helpful.