#bootsy_api

1 messages ยท Page 1 of 1 (latest)

austere pendantBOT
#

๐Ÿ‘‹ 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/1237852922411483269

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

boreal sail
#

Hello

#

How are you rendering Payment Element?

#

Are you creating a PaymentIntent first and using the client secret?

#

Or rendering before creating the intent?

torn spire
#
        const options = {
            clientSecret: this.clientSecret,
            appearance: {/*...*/},
        };

        // Set up Stripe.js and Elements using the SetupIntent's client secret
        this.elements = this.stripe.elements(options);

        // Create and mount the Payment Element
        this.paymentElement = this.elements.create('payment', {
            fields: {
                billingDetails: {
                    address: {
                        country: 'never'
                    }
                }
            }
        });
        this.paymentElement.mount(this.paymentForm.nativeElement);
    }

boreal sail
#

Gotcha, can you share a PaymentIntent ID that you tested with?

torn spire
#

yeah one sec

#

is it in here?

boreal sail
#

Not sure what you mean? It is the first part of the client_secret

#

You create it from your server

#

If you have the client secret (this.clientSecret) from above that works too

torn spire
#

ahh ok

#

"seti_1PEGV8Fgy6mCWIbLiqaDtb3h_secret_Q4PJMZeQkIlXMPf3cQT7JBRDDZMRnJA"

boreal sail
#

Ah that is a SetupIntent

#

Afterpay is for one-time use only

#

It doesn't support being set up for future use

torn spire
#

ahhhh interesting

#

what should i use instead of SetupIntent?

boreal sail
#

PaymentIntent

#

That charges immediately though

#

Seems like you are using a SetupIntent because you want to charge later on when the customer is no longer in your flow?

torn spire
#

yeah

#

ok we're prolly for a little bit. can we keep this chat open

boreal sail
#

It will stay open for a little while then threads are closed after a while for inactivity. If that happens you can always repost though and someone will be around to help.

torn spire
#

Ok thanks

boreal sail
#

Sure

torn spire
#

So if we use setupintent, it will return a form where I can enter credit card or switch to afterpay, but if I enter cc then it will charge cc immediately?

boreal sail
#

No

#

A SetupIntent will only collect the payment method

#

Then your integration charges it later on

#

A PaymentIntent both collects the payment method and charges it immediately.

torn spire
#

Oh I mixed them up

#

one more question

#

is there any way to not charge afterpay immediately with stripe

#

like can the user choose afterpay somehow, and then we use an api later to submit the transaction

boreal sail
#

So it would authorize immediately and then for Afterpay you would have 13 days to actually capture the payment.

torn spire
#

how do i implement the paymentIntent on the front end?

#

or maybe that's a bad question, cuz maybe our backend is making the call to get a setupIntent token vs a paymentIntent token

boreal sail
#

Yep you do this via your backend

#

You can't create SetupIntents/PaymentIntents via the frontend

#

(Wouldn't be secure)

torn spire
#

got it

#

ok another question....

#

i see this as an example

  PaymentIntentCreateParams.builder()
    .setAmount(2000L)
    .setCurrency("usd")
    .setAutomaticPaymentMethods(
      PaymentIntentCreateParams.AutomaticPaymentMethods.builder()
        .setEnabled(true)
        .build()
    )
    .build();
PaymentIntent paymentIntent = PaymentIntent.create(params);
#

are there specific configs i need to use with that in odrer to use the place a hold on a payment method option you showed above?

boreal sail
austere pendantBOT
boreal sail
torn spire
#

ok thanks. so we actually never charge our customer right away. we only charge after we complete our service (car repair)

#

so i think we would want to assign manual to both after pay and cc payment types

livid obsidian
#

Hi there ๐Ÿ‘‹ taking over, as my colleague needs to step away

Are there any outstanding questions here?

torn spire
#

ok, yes

#

ok thanks. so we actually never charge our customer right away. we only charge after we complete our service (car repair)
so i think we would want to assign manual to both after pay and cc payment types

livid obsidian
#

Okay, sounds good. Is there a question in there somewhere?

torn spire
#

ahh right...

#

sorry still trying to sort everything out. still trying to determine the best way to implement this

#

currently we use setupIntent, cuz we always wanna charge the customer later, but in order to implement AfterPay we have to use PaymentIntent. and it sounds like we can mimic behavior of setupIntent (in regards to capturing credit card info) by implementing this manual capture feature. is that right?

or do you know if there's a better way to do it?

#

maybe we have two forms on the UI? one that uses setupIntent for CC and payment intent with manual capture for AfterPay?

livid obsidian
#

I'm confused. Why are you trying to setup Afterpay for future payments? Afterpay doesn't support recurring charges, so what's the point of wanting to use Setup Intents to begin with?

torn spire
#

we fix people's cars. we only charge customer after service is complete. so it's not a recurring charge

livid obsidian
#

Okay, so you don't need Setup Intents

#

You can just use the method that bismarck mentioned with Payment Intents

torn spire
#

ok. i just got the paymentintent token back, but my front end still isn't rendering the afterpay option

#

i have it turned on in the sandbox

livid obsidian
#

Do you have the Payment Intent ID handy?

torn spire
#

pi_3PEHb4Fgy6mCWIbL0SBcUZtu_secret_EH9xi4v1ltMagy3QaCaL8wBOE

livid obsidian
#

It's probably because you created the Payment Intent with setup_future_usage. Try creating one without that

torn spire
#

nice. that worked

#

so now, can u get me started on how to use paymentIntents to store cc information instead of charge right away? do i just set:

#

when calling PaymentIntent api?

livid obsidian
#

This is all very well-documented, so for now I'll post the guide for how to do this: https://docs.stripe.com/payments/save-and-reuse

I would also encourage you to read the documentation that bismarck posted, because it seems you aren't fully understanding the methods and parameters you're using and what their intended use-cases are.

Learn how to save payment details and charge your customers later.