#anurag_api

1 messages ¡ Page 1 of 1 (latest)

gray mountainBOT
#

👋 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/1390230355818319973

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

ember cargo
#

This is the code (used stripe node.js library):

async function run() {
  try {
    const paymentIntent = await stripe.paymentIntents.create({
      amount: 1000, // $10.00
      currency: 'usd',
      capture_method: 'manual',
      confirmation_method: 'manual',
      payment_method_types: ['card'],
      payment_method_options: {
        card: {
          request_incremental_authorization: 'if_available',
        },
      },
    });

    console.log('PaymentIntent created:', paymentIntent.id);

    const confirmedIntent = await stripe.paymentIntents.confirm(paymentIntent.id, {
      payment_method_data: {
        type: 'card',
        card: {
          number: '4111111111111111',
          exp_month: 12,
          exp_year: 2026,
          cvc: '123',
        },
      },
    });

    console.log('PaymentIntent confirmed, status:', confirmedIntent.status);

    if (confirmedIntent.status !== 'requires_capture') {
      throw new Error('PaymentIntent is not in requires_capture state, cannot increment.');
    }

    const incrementedIntent = await stripe.paymentIntents.incrementAuthorization(
      confirmedIntent.id,
      {
        amount: 500,
      }
    );

    console.log('Authorization incremented. New capturable amount:', incrementedIntent.amount_capturable);
  } catch (err) {
    console.error('Error:', err);
  }
}

run();
sinful sparrow
ember cargo
#

Hi @sinful sparrow, I am not sure if we are an IC+ user or not, this is our account_id: acct_1QWxwpE9cSvqiivY. Can you please enable incremental auth feature for our sandbox account as we are planning to use it in the near future.

sinful sparrow
#

You'll need to reach out to Stripe support (support.stripe.com) if you want access to this feature