#benk - Payment Hold

1 messages · Page 1 of 1 (latest)

floral yew
#

Hi 👋

viscid fog
#

yo

floral yew
#

It's not a react-native thing but we do allow up to a 7 day hold if you create the Payment Intent that way on your server

#

Does that sound like what you're looking for?

viscid fog
#

reading...

#

I think so...

#

So currently I have

async createPaymentMethod(variables: CreatePaymentMethod) {
    const { customer, amount, receipt_email, description } = variables;
    const ephemeralKey = await stripe.ephemeralKeys.create(
      { customer },
      { apiVersion: "2020-08-27" }
    );
    const paymentIntentObject = {
      currency: "usd",
      amount,
      customer,
      description,
    } as {
      currency: string;
      amount: number;
      customer: any;
      receipt_email?: string;
      description: string;
    };
    if (receipt_email) {
      paymentIntentObject.receipt_email = receipt_email;
    }
    const paymentIntent = await stripe.paymentIntents.create(
      paymentIntentObject
    );
    return {
      paymentIntent: paymentIntent.client_secret,
      paymentIntentId: paymentIntent.id,
      ephemeralKey: ephemeralKey.secret,
      newOrExistingCustomerId: customer,
    };
  }
#

I'm guessing I can change paymentIntentObject to make it a hold

floral yew
#

Correct, you would need to include capture_method: 'manual',

#

But the collection of Payment Method details on the front-end would be the same.

viscid fog
#

right, very cool

#

ok, let me work on it and if I get stuck, I hope it's ok I reach out to you again

#

But it looks pretty simple