#jorden_code
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/1221895424307363890
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, what is the error that you get for ACSS payments?
Also it sounds like our automatic payment methods functionality may be helpful for you here. It allows you to configure what payment methods you want to be available from the dashboard and then if you create a payment intent with automatic_payment_methods.enabled = true we will automatically populate the available payment methods based on which ones are allowed for the payment intent's configuration.
https://dashboard.stripe.com/settings/payment_methods
I'm happy to help figure out what you can do when manually specifing the payment methods as you are now, just wanted to mention that functionality in case you haven't run in to it yet
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Will this work for checkout and not payment intents? here is my code
const express = require("express");
const stripeSecretKey =
process.env.NODE_ENV === "production"
? process.env.STRIPE_SECRET_KEY_PRODUCTION
: process.env.STRIPE_SECRET_KEY_TEST;
const stripe = require("stripe")(stripeSecretKey);
const router = express.Router();
const crypto = require("crypto");
router.post("/create-checkout-session", async (req, res) => {
try {
const { invoiceNumber, invoiceDescription, amount, invoiceId } = req.body;
const token = crypto.randomUUID();
const successURL =
process.env.NODE_ENV === "production"
? `livewebsite`
: `localwebsite`;
const cancelURL =
process.env.NODE_ENV === "production"
? "livewebsite/search-test-invoice"
: "http://localhost:5000/cancel";
const session = await stripe.checkout.sessions.create({
payment_method_types: ["card", "acss_debit", "us_bank_account"],
line_items: [
{
price_data: {
currency: "usd",
product_data: {
name: `Invoice #${invoiceNumber}`,
description: invoiceDescription,
},
unit_amount: amount * 100, // Amount in cents
},
quantity: 1,
},
],
metadata: {
invoiceID: invoiceId,
invoiceNumber: invoiceNumber,
},
mode: "payment",
success_url: successURL,
cancel_url: cancelURL,
});
res.json({ url: session.url });
} catch (e) {
res.status(500).json({ error: e.message });
}
});
module.exports = router;
The error I'm receiving:
The payment method acss_debit requires `payment_method_options[acss_debit][mandate_options] to be set.
This doc shows how to set those mandate options and what the options mean https://docs.stripe.com/payments/acss-debit/accept-a-payment?platform=web&payment-ui=direct-api#web-create-payment-intent
ok ty ill try this