#afenster-terminal-future-use
1 messages · Page 1 of 1 (latest)
Here's the guide you're looking for: https://stripe.com/docs/terminal/features/saving-cards/overview
afenster-terminal-future-use
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.
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
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?
Apologies, I mixed your thread up with someone else's (juggling a few at the moment). Let me circle back here real quick
So I think you'll need to follow this guide for that: https://stripe.com/docs/terminal/features/saving-cards/save-cards-directly
And it looks like you will need to create a Customer and attach the Payment Method to them in order for it to be charged at a later time
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?
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
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.
Ahhh, okay. Unfortunately I don't know of a way to get around using Customers with Setup Intents.
Keep in mind, a Customer object doesn't need to have any information on it when you create it, so it can be programmatically created without any intervention from the person at the register: https://stripe.com/docs/api/customers/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
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.
Obviously deleting Customers is an option too, though I'm unsure how/if this would affect a per-Customer fee: https://stripe.com/docs/api/customers/delete
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks. That answers my questions. I appreciate your assistance. That was helpful.
Sure thing!