#cho_code

1 messages ¡ Page 1 of 1 (latest)

reef caveBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1254835361583206462

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

cedar reef
#

my specific question is:
I see this code:
expressCheckoutElement.on("click", (e) => {
const options = {
applePay: {
recurringPaymentRequest: {
paymentDescription: "Standard Subscription",
regularBilling: {
amount: 1000,
label: "Standard Package",
recurringPaymentStartDate: new Date("2023-03-31"),
recurringPaymentEndDate: new Date("2024-03-31"),
recurringPaymentIntervalUnit: "year",
recurringPaymentIntervalCount: 1,
},
billingAgreement: "billing agreement",
managementURL: "https://stripe.com",
},
},
};
e.resolve(options);
});

And I was wondering how this worked in conjunction with setup intents and charging the customer

#

There may be times where we swap the price or delay the cadence based on the customer's needs and how they wish to use the product

median girder
cedar reef
#

Awesome

#

Am I able to do this with the express checkout element and the onConfirm prop here or will I need a different element?

#

correct me if I'm wrong, after reading the article and the end paragraph, I will do it in this way:

  1. Create an empty setup intent and load customer into it.
  2. Have the onConfirm's function reference the token that is created from the customer interacting with the express checkout element
  3. Use said token to create a payment method with the setup future usage off session
  4. finish setup intent
median girder
#

Yep those steps look good to me. One quick thing: is this subscription starting immediately? Or is this a setup for a subscription that won't start until later?

cedar reef
#

until later.

median girder
#

Awesome, if it started immediately I was going to suggest confirming the subscription's first payment intent up front but that is not relevant here

cedar reef
#

ohh yeah for sure haha

#

tysm