#bootsy_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
Hello
How are you rendering Payment Element?
Are you creating a PaymentIntent first and using the client secret?
Or rendering before creating the intent?
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);
}
Gotcha, can you share a PaymentIntent ID that you tested with?
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
Ah that is a SetupIntent
Afterpay is for one-time use only
It doesn't support being set up for future use
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?
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.
Ok thanks
Sure
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?
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.
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
The only way you can do something like that is to use manual capture: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
So it would authorize immediately and then for Afterpay you would have 13 days to actually capture the payment.
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
Yep you do this via your backend
You can't create SetupIntents/PaymentIntents via the frontend
(Wouldn't be secure)
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?
Yes you use CaptureMethod("manual") - https://docs.stripe.com/api/payment_intents/create#create_payment_intent-capture_method
However if you only want that to apply to if Afterpay is selected then you set it at the payment_method_options level: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_options-afterpay_clearpay-capture_method
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
Hi there ๐ taking over, as my colleague needs to step away
Are there any outstanding questions here?
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
Okay, sounds good. Is there a question in there somewhere?
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?
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?
we fix people's cars. we only charge customer after service is complete. so it's not a recurring charge
Okay, so you don't need Setup Intents
You can just use the method that bismarck mentioned with Payment Intents
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
Do you have the Payment Intent ID handy?
pi_3PEHb4Fgy6mCWIbL0SBcUZtu_secret_EH9xi4v1ltMagy3QaCaL8wBOE
It's probably because you created the Payment Intent with setup_future_usage. Try creating one without that
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?
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.