#sricar09_bacs-debit-payments
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/1290692315593048158
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'll post some code snippets
For the API request from our server. We're on an older version of the API, and in the process of upgrading that as well. Not certain if we need a newer version for this, or if we need to include automatic_payment_methods: {enabled: true}
Stripe::PaymentIntent.create(
{
amount: donation_amount_in_cents,
application_fee_amount: application_fee,
confirm: true,
confirmation_method: 'manual',
currency: currency,
customer: customer_id,
on_behalf_of: stripe_connected_stripe_account_id,
payment_method: payment_method_id,
payment_method_types: ['card', 'bacs_debit'],
statement_descriptor: statement_descriptor,
transfer_data: { destination: stripe_connected_stripe_account_id },
expand: %w[charges.data.transfer]
},
api_key: api_key
)
For the payment element, we're using something like this:
var elements = stripe.elements({
mode: "payment",
currency: 'gbp',
amount: 50,
onBehalfOf: stripeConnectedAccountId
});
We've confirmed in test mode that our connected accounts have bacs direct debit enabled.
Hi there ๐ you mentioned creating a Payment Method. Are you using Elements to create Payment Methods, or are you using it do directly confirm a Payment Intent as we show in our BACS guide that you linked to?
Previously collected card data with the card element. We collect the payment method first, and then create a payment intent on our backend. The amount can vary based on what the user submits. In some scenarios, we do confirm a payment intent on the back end for certain card types like 3DS
That's not going to work with BACS. If you need to handle things in a fashion similar to that (rather than using the Payment Element to confirm a Payment Intent as shown in our referenced guide), then you'll want to reach out to our Support team, with a clear explanation of your business use case, to see if there is an alternative approach they can enable for you.
https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I see, thanks for the explanation Toby. In the accept a payment section here: https://docs.stripe.com/payments/bacs-debit/accept-a-payment?payment-ui=elements#web-payment-element-bacs-specific. It seems like it could create the payment intent from server.rb? I'm trying to find the referenced guide you are mentioning.
So it sounds like we setup the payment intent in the front end, the mandate creation would occur with some attributes passed to the creation request, and then in the server side it can be confirmed. Otherwise, we need to reach out to support and enable an alternative approach if available.
You do create the intent server-side, but you confirm it client-side. Sorry, I thought that guide was more detailed, I overlooked that it relies on another guide so heavily.
https://docs.stripe.com/payments/quickstart#submit-event
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
Ohh ok, thank you. No worries, I'll check those out. It sounds like the only way (or at least the best practice way) of confirming the intent is client side then? Since that is what allows the payment element to trigger the needed mandate?
Yup exactly!
Ok! Thank you! We'll reach out if we have any follow up questions. Thank you so much!
Any time, happy to help!
Pardon for reopening, a follow-up question, as we're exploring how we'll update our current integration. It seems like it would be possible to create the payment intent client side as well right? and then confirm it?
Hi ๐
I'm stepping in as my colleague has to go.
What kind of integration are you building? Is it using Terminal on mobile devices?
No problem! Thanks Snufkin. It's a web application. We're in the process of migrating over to the payment element after using the card element on an older API version, and adding bacs direct debit.
Okay in that case you can only create payment intents on the server. Creating them client side would be insecure
Ah gotcha. Yeah, for credit cards we've created payment intents server side. Certain cards like 3DS we've used handleCardAction. Thank you for the confirmation!
Okay yes that sounds like a the recommended integration
Yeah, I was trying to understand if there was a way I could make the payment flow similar for the three processes. I'll check out the docs shared with me.