#Error with payment using credit or debit cards and rupay cards

1 messages · Page 1 of 1 (latest)

thorny belfry
#

Need Help: Card Payments Skipping OTP (3DS) in DodoPayments

Hi! I’m integrating DodoPayments in my Next.js app and facing an issue with card payments + OTP (3D Secure).

❗ Problem

When I create a payment:

It gets initiated successfully

User is redirected to the Dodo checkout page

But for real cards, it immediately redirects to the success page

No card input form

No OTP (3D Secure)

Payment status shows “initiated”, not authorized/captured

✔ What I want

A proper card flow:

  1. User enters card details

  2. User receives OTP / 3DS authentication

  3. On success → redirect to success URL

  4. On failure → redirect to failure URL

📌 My current server code

const payment = await dodopayments.payments.create({
billing: { city: "city", country: countryCode, state: "state", street: "street", zipcode: "zipcode" },
customer: { email, name },
metadata: { supabaseid: id },
payment_link: true,
return_url: process.env.DODO_PAYMENTS_RETURN_URL,
product_cart: [{ product_id: productId, quantity: 1, amount: amt }],
});

❓ Need Clarification On

  1. Is payment_link: true the correct mode for OTP/3DS?
    Or should I use something like:
    mode: "payment" + payment_method_types: ["card"]?

  2. Does my merchant account need specific features enabled for OTP?
    (e.g., 3D Secure / SCA, card authorization mode)

  3. Can anyone share a working example config for DodoPayments that:

shows card input

triggers OTP

authorizes before redirect?

Any guidance or step-by-step setup would really help. Thanks!

tough glenBOT
#

To achieve the desired card payment flow with OTP (3D Secure) in Dodo Payments, here are some steps and configurations you should consider:

  1. Correct Mode for OTP/3DS:

    • Instead of using payment_link: true, you should configure your payment creation request with mode: "payment" and specify payment_method_types: ["card"]. This setup is more appropriate for triggering the card input form and 3D Secure (3DS) authentication process .
  2. Merchant Account Features:

    • Ensure that your merchant account has 3D Secure (3DS) enabled. This might require contacting Dodo Payments support or checking your account settings to verify that 3DS and card authorization features are activated .
  3. Example Configuration:

    • Here's a sample configuration for creating a payment that should trigger the card input and 3DS authentication:
      const payment = await dodopayments.payments.create({
        billing: { city: "city", country: countryCode, state: "state", street: "street", zipcode: "zipcode" },
        customer: { email, name },
        metadata: { supabaseid: id },
        mode: "payment",
        payment_method_types: ["card"],
        return_url: process.env.DODO_PAYMENTS_RETURN_URL,
        product_cart: [{ product_id: productId, quantity: 1, amount: amt }],
        force_3ds: true
      });
      
    • Setting force_3ds: true explicitly requests 3D Secure authentication during the payment process .
  4. Webhooks for Payment Status:

    • Implement webhooks to handle payment.succeeded and payment.failed events to track the payment status accurately. This ensures that your application responds correctly to the outcome of the payment .
  5. Testing and Troubleshooting:

#
  • Test your configuration in test mode first to ensure everything works as expected before going live. This can be done by using test card numbers and monitoring the flow through Dodo Payments' test environment .

By following these guidelines, you should be able to set up a payment flow that correctly handles card inputs and triggers 3D Secure authentication. If you encounter any issues, ensure that your webhook configurations are correct and that your merchant account settings support 3DS.

Helpful Links

Dodo Payments Documentation

The Dodo Payments API provides comprehensive endpoints for payment processing, subscription management, and digital product delivery. Our RESTful API follows industry standards with detailed responses for all operations.

Dodo Payments Documentation

A modern TypeScript library for embedding Dodo Payments overlay checkout and listening to checkout events in real-time.

Dodo Payments Documentation

Learn the difference between Test Mode and Live Mode and how to switch between them.

Dodo Payments Documentation

This guide will help you integrate the Dodo Payments API into your website.