#feloe_wallet-manual-capture
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/1243247323128004661
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
it can be inferred that Google Pay and Apple Pay do NOT support the ability to place a hold on a payment and then capture the funds later?
no that's not correct though I get why you think that. ApplePay and GooglePay work like a card and support manual capture
feloe_wallet-manual-capture
Ah ok that's great to hear. So in order to fix this error do I have to add these lines to my payment intent?
automatic_payment_methods: {
enabled: false,
},
Do you absolutely want to do card and ApplePay/GooglePay only and nothing else?
Because no, the better fix would be to handle the redirect as required and have a return_url
I guess I'm not understanding correctly.
Does this list include all the payment methods which support manual capture?
cards
Affirm
Afterpay
Cash App Pay
Klarna
PayPal
Apple Pay
GooglePay
Hi ๐
I'm stepping in as my colleague needs to go soon.
Apple Pay and Google Pay are just wrappers around Card payment method types. So in our docs https://docs.stripe.com/payments/place-a-hold-on-a-payment-method#auth-capture-limitations when we say
Payment methods that support this include cards, Affirm, Afterpay, Cash App Pay, Klarna, and PayPal
that includes Apple/Google pay
Hello, hope you're having a great day.
So is it only Bank Redirects that require the return_url?
Or can you tell me which methods require the return_url?
So is it only Bank Redirects that require the return_url?
No, that is not accurate. I recommend providing a return url
Where can I read more about how to handle the redirect?
Can you provide a list of the payment methods that typically redirect?
If you are using Stripe.js we will handle the redirect for you. What is the workflow you are trying to develop?
The way it currently works is
user fills cart
goes to checkout
If logged in automatically select primary card or let user enter new card information
if not logged in present card form
user places order - calls stripe.createPaymentMethod()
api creates and confirms payment intent using the payment method id
Restaurant receives notification of new order
Restaurant accepts order and at this point the payment intent is captured
So you are creating and confirming the payment intent with the method you just saved?
Is there a reason you don't create and save the payment method in the same API call as confirming the payment intent?
I'm using the Stripe Elements for the form
Client side code looks like this
stripe.createPaymentMethod({
elements: paymentForm.value, // <-- the elements form
params: {
billing_details: {
name: `${order.value.firstName} ${order.value.lastName}`,
email: order.value.email,
phone: `${order.value.phoneFormatted}` || undefined,
},
}
}).then( async (res) => {
// POST api with id in body
await placeOrder(res.paymentMethod.id)
})
Server side
createOrder() {
const stripeIntent = {
amount: 100
currency: 'USD',
payment_method: paymentMethodId, // from request body
confirmation_method: 'manual',
confirm: true,
// If a mobile client passes `useStripeSdk`, set `use_stripe_sdk=true`
// to take advantage of new authentication features in mobile SDKs
use_stripe_sdk: useStripeSdk,
metadata: {},
capture_method: 'manual',
}
}
Further down in create order, if the user is logged in the payment method is attached to the user
Okay, but I don't see any reason why you are going this route instead of saving the payment method as part of the payment flow like we show in this guide:
https://docs.stripe.com/payments/save-during-payment
Can we proceed without creating the Stripe customer? Ideally those are created when the user creates an account in our platform.
The difference I'm seeing is that the intent is created before creating the payment method?
The other big difference I see is the way the payment intent is captured. Currently we are using this method:
const transaction = await getStoredOrderDetails()
const intent = await Stripe.paymentIntents.capture(transaction.stripeIntentId, {
stripeAccount: account.stripeAccount,
})
Would that no longer be usable?
If you already know the customer ID you can just provide it instead of creating a new one.
For the capture request, you are using a Stripe Account header (Connect). You would need to make sure to use that for all your API requests .
Yes we provide that if the user is logged in but the users can checkout as guest so no customer is created
I'm seeing in step 7 another intent is created? Why is another payment intent created instead of capturing the original?
If no customer is created then you don't save the payment method. In that case you can just use our canonical accept a payment guide: https://docs.stripe.com/payments/accept-a-payment
For step 7, we are showing how you can used the saved payment method in for a later payment.
I believe I was following a combination of that guide + https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
I was using version 12 of the API and updated to 15 without checking the breaking changes ๐
Do you mean the stripe-node SDK? Our API version numbers use date formats. The most recent is 2024-04-10.
So if I understand correctly I can update my flow to:
allow the user to fill out the form
create the payment intent and return the secret
update the elements page to include the secret
call stripe.confirmPayment()
Hey there, just stepping in as my colleague needs to step away.
That sounds mostly correct, though I don't think you need a step here:
update the elements page to include the secret
Instead you end up passing theclientSecretas a parameter inconfirmPayment
He grew tired of my million questions. I understand I would too ๐
If I have to any questions after updating my code ( I have to step away to a meeting) should I open a new thread or will this one remain open?