#richard_20727

1 messages · Page 1 of 1 (latest)

lethal smeltBOT
brazen solar
#

I see the same thing in test mode, that sounds expected there for me. Is this causing you some kind of issue when testing?

red mirage
#

we just don't know what our end users will expereince in production. I thought perhaps it was because we didn't have a PAD mandate? "In order to use Canadian pre-authorized debits, you must obtain authorization from your customer for one-time and recurring debits using a pre-authorized debit agreement (see PAD Mandates). The Mandate object records this agreement and authorization."

brazen solar
#

Have you tried submitting a payment with just those details in test mode? It looks like those are the only details collected in the Stripe.js iframe and after submission it is expected that a modal will pop up that the user can log in to their bank or manually enter bank details from

red mirage
#

hitting pay now with the email and full name i get this error: "Please provide complete payment details."

#

i grabbed this from the network tab:
{
"error": {
"message": "A mandate is required. Please either provide the id of an existing mandate on confirmation, or provide payment_method_options[acss_debit][mandate_options].",
"request_log_url": "https://dashboard.stripe.com/acct_1NzRsOBI9pDZFXKz/test/logs/req_DIic78HAvaQD0g?t=1698955288",
"type": "invalid_request_error"
}
}

brazen solar
#

Can you show me your code for the Stripe call that you are making that gets that error?

red mirage
#

I have the javascript code as well.

Stripe::PaymentIntent.create(
  {
    amount: amount,
    currency: currency,
    automatic_payment_methods: { enabled: true },
    description: "Invoice ##{invoice.number}",
    receipt_email: email,
    application_fee_amount: fee
  },
  stripe_account: stripe_account
)
#

I get the error only when i hit submit. so that js code looks like this:

async function handleSubmit(e) {
  e.preventDefault();
  setLoading(true);

  // Get the button element by its ID
  const submitButton = document.getElementById('submit');

  const { error } = await stripe.confirmPayment({
    elements,
    confirmParams: {
      // Make sure to change this to your payment completion page
      return_url: 'http://' + theUrl + "/customer_portal/process_final_payment?invoice_id=" + theInvoiceID + "&slug=" + slug + "&token=" + token,
      receipt_email: emailAddress,
      payment_method_data: {
        billing_details: {
          email: emailAddress
        }
      }
    },
  });
brazen solar
#

Ah gotcha, so yes in that case you will want to supply mandate data when creating the payment intent. ACSS requires info from you on how the bank account will be charged

  amount: amount,
  ...
  payment_method_options: {
    acss_debit: {
      mandate_options: {
        payment_schedule: 'interval',
        interval_description: 'First day of every month',
        transaction_type: 'personal',
      },
    },
  },
});```
https://stripe.com/docs/payments/acss-debit/accept-a-payment#web-create-payment-intent
#

And that doc has explanations on the different values that you might provide for each of the mandate_option parameters

red mirage
#

Ok. i notice you're adding payment_method_options now. is that something that should always be there in the paymentIntent create?

brazen solar
#

I believe so at least for payments where you potentially want to take ACSS payments.

#

Double checking on that, I don't think that Stripe defaults those fields if they are not set