#afenster-terminal-future-use

1 messages · Page 1 of 1 (latest)

drowsy cedarBOT
shy sundial
#

afenster-terminal-future-use

narrow lance
#

Does that mean, in the case of Terminal payments, the Customer has to be created and attached to the PaymentIntent BEFORE processing the payment?

In the case of PaymentElement payments, the Customer can be created after the payment.

shy sundial
#

Not necessarily. A Payment Intent doesn't need a Customer. It A Payment method just needs to exist and be added to the Payment Intent, so that the Payment Intent knows to use it when attempting to capture a charge

narrow lance
#

I don't follow that.

I create a PaymentIntent:

var options = new PaymentIntentCreateOptions
{
Description = cart.CompanyName,
Currency = "usd",
Amount = Convert.ToInt32(cart.Total * 100M),
CaptureMethod = "manual",
SetupFutureUsage = "off_session",
PaymentMethodTypes = new List<string> { "card", "card_present" },
Metadata = metaData.ToDictionary()
};

No Customer there. Then I set up the Reader. Someone swipes a card. I create a ReaderService and call ProcessPaymentIntent.

The call goes to Stripe. Stripe approves the PaymentIntent and calls my webhook. Now I have a PI in requires_capture status. I want to save the PaymentMethod for future use. What do I do?

shy sundial
#

Apologies, I mixed your thread up with someone else's (juggling a few at the moment). Let me circle back here real quick

narrow lance
#

OK

#

Thank you

shy sundial
narrow lance
#

Yes, but that gets me back to my original question. When I create a customer and try to save the PaymentMethod, I get an error: "PaymentMethods of typ 'card_present' cannot be save to customer."

#

So maybe I need to create the Customer and attach it to the PaymentIntent before I display anything in the Terminal?

shy sundial
#

Are you creating a Setup Intent before you actually collect card credentials? The guide I sent you describes in detail exactly how to do this

narrow lance
#

Sometimes it's a SetupIntent and sometimes it's a PaymentIntent. Sometimes the initial transaction is a payment, and sometimes it's just a setup. I was working with a PaymentIntent when I got the error.

#

The example in the directions creates the Customer before processing / confirming. I was just hoping to avoid that.

shy sundial
#

Ahhh, okay. Unfortunately I don't know of a way to get around using Customers with Setup Intents.

narrow lance
#

OK. I'll create it first. Before calling Stripe to confirm.

The reason I was hoping to avoid this is because my manager says he has some kind of Stripe service which charges him per Customer. So I didn't want to create the Customer unless the payment is actually confirmed. I can end up with orphan Customers.

#

Maybe we can figure out a way to delete those at the end of each month.

shy sundial
#

Hmmm, it might be worth looking into some type of "remember customer" functionality, so that returning Customers don't result in duplicate Customer objects in that case.

narrow lance
#

Thanks. That answers my questions. I appreciate your assistance. That was helpful.

shy sundial
#

Sure thing!