#ruul_api

1 messages ยท Page 1 of 1 (latest)

cyan coveBOT
cosmic hazelBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

cyan coveBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1245299192482762812

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

arctic widget
#
   * Lists customer's payment methods
   * @param customer stripe customer id
   * @param type type of the payment method (card, bank_account, etc.)
   * @returns payment method list
   */
  public async listCustomerPaymentMethods(
    customer: string,
    type: Stripe.PaymentMethodListParams.Type,
    starting_after?: string,
    ending_before?: string
  ): Promise<Stripe.ApiList<Stripe.PaymentMethod>> {
    return this.stripe.paymentMethods.list({
      customer: customer,
      type: type,
      ...(starting_after && { starting_after }),
      ...(ending_before && { ending_before }),
    });
  }```
#
   * Creates a Stripe Checkout Session for setting up a customer card
   * without specifying any currency or price.
   * @param customerId - The ID of the customer for whom the card is being saved.
   * @returns The URL of the Checkout Session for setting up the card.
   */
  public async createSetupCheckoutSession(customerId: string): Promise<string> {
    const session = await this.stripe.checkout.sessions.create({
      payment_method_types: ["card"],
      mode: "setup",
      customer: customerId,
      success_url: env.STRIPE_SUBSCRIPTION_CHECKOUT_SESSION_SUCCESS_URL,
      cancel_url: env.STRIPE_SUBSCRIPTION_CHECKOUT_SESSION_CANCEL_URL,
    });

    return session.url;
  }
austere bluff
#

hi there!

arctic widget
#

hello

#

related snippets are attached mentioned in the main question

austere bluff
#

yes that looks correct. have you tested it? is it working?

arctic widget
#

also on test checkout page I saw gpay option aswell even though I didn't specify it in the payment method types

austere bluff
#

Google Pay and Apple PAy are treated as card payment methods

#

you could disable them in your dashboard setting if needed.

arctic widget
#

so it'Ll work out fine with the method above even if I try to get last4 etc ?

#

if that's the case it's perfect

austere bluff
#

so it'Ll work out fine with the method above even if I try to get last4 etc ?
you need to test this in test mode to make sure it works

#

but yes that looks correct to me

arctic widget
#

alright tyvm

cyan coveBOT
plain folio
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

arctic widget
#

ty I believe it's ok for now I can reopen the ticket again if something happens

#

no need to keep you guys busy