#johnatran
1 messages ยท Page 1 of 1 (latest)
hey there, can you share an example of how you're using this?
If available for your account, you'd configure bank payments in your dashboard to be enabled for Checkout
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
function sendToStripe() {
console.log(storefrontQuantity)
var stripe = Stripe('secretkey')
stripe.redirectToCheckout({
lineItems: [{price: 'price_id', quantity: storefrontQuantity}],
mode: 'payment',
successUrl: 'https://www.evbib.com/home-new',
cancelUrl: 'https://www.evbib.com/order-storefront',
})
.then(function (result) {
if (result.error) {
console.log("Error sending form data to Stripe")
}
});
}
Ok so this is client-side checkout creation, which has been deprecated for some time
But if you enable the bank account payments in your dashboard, are you still not seeing it there?
Thanks @deft folio I enabled "ACH Direct Debit" in the settings. When I preview my checkout, I see the bank information. However, when I test it on the live site, I do not see bank input possible.
Right, so, only card payments are support when using this client-only pattern, not the other local payment methods
This is what my live payment looks like. I will screenshot preview in the next post.
I see.
If you don't have a server allowing you to create sessions securely before redirecting, you might want to consider switch that checkout redirect code to use payment links:
https://stripe.com/docs/payments/payment-links
Can payment links have a dynamic quantity?
I'm configuring one now and it looks like I have to preset it.
I don't have a server than can securely create sessions before redirecting as I am using a website builder in webflow.
Trying to find stripe docs for payment links. so far I can't find the API spec but I found this page which helps: https://stripe.com/docs/payments/payment-links/api
Customers can adjust quantity yes! if you enable it when setting up the link
You can create them in the dashboard via UI, too
I'll create using API first. Thanks @deft folio I found the API doc here: https://stripe.com/docs/api/payment_links/payment_links/create?event_types-payment_intent.payment_failed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Looks like I can setup redirects and use similar parameters to what I did in the past.
https://stripe.com/docs/payments/payment-links#create-link (dashboard)
https://stripe.com/docs/payments/payment-links/api (API)
You set each line item as adjustable:
https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-line_items-adjustable_quantity
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@deft folio is it okay to programmatically create a payment link each time a customer pays? Or would I get throttled.
I want the checkout to pre-populate with a quantity that the user inputed on a form prior to checkout
You can, its just a little inefficient.
If there a wide range of quantities/products for what you sell?
1-5 each time a form is completed.
You could, eg, make a link for each default amount 1,2,3,4,5 and just swap between those
I guess I can make 5 "if statements"
instead of fully dynamic
yeah
I'd suggest that then -- you'd need a server to create the links anyways, in which case you could do so with Checkout sessions ๐
What's the default after_completion url of the forms created on my dashboard?
Can I specify that on the UI somehow?
I didn't quite see that parameter when created the payment link via UI
yep!
Oh got it. Thanks @deft folio !
NP!