#michael_elements-saved
1 messages ยท Page 1 of 1 (latest)
๐ 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/1278772157681242133
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
michael_elements-saved
@ionic wagon we just recently added support for this to PaymentElement where you can show the saved PaymentMethods in it. See https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#save-payment-methods
Thanks for the info. Can I ask you another question?
I would like to save payment information for a customer, but I need to associate the customer with a particular merchant. Is this possible? Or is the customer only able to be associated with the stripe api key?
Can you clarify what "with a particular merchant" means exactly?
The people who use our product are 'merchants', but those merchants have 'patients', so I need to save payment information for a patient who is associated with a merchant.
When a merchant is processing a payment for a patient, the merchant should only see payment information for their own patients
The merchant should not see payment information for patients that are not their patients
Okay so you are a platform and you use our Stripe Connect product and those "merchants" are connected accounts?
correct
Okay, what type of integration do you use
- Which connected account type: Custom, Express or Standard
- Which flow of funds: Destination Charges, Direct Charges or Separate Charges and Transfers
- Standard connect.
Double checking on #2
Likely Direct Charges since that's the canonical flow for that type of connected account
Assuming it's Direct Charges: Where do you want to save the Customer information?
Do you want to "aggregate them all" on your platform account first so that in the future you can charge them for other merchants?
Or do you want them at the merchant (connected account) level instead because really they are a customer of that merchant. If they were to also be a customer of another merchant they would enter card details again
correct, it is direct charges.
I would prefer the second option. if a patient visited a different merchant on our platform, they would need to re-enter their payment method
I'm glad you said that because the other approach is near impossible to build today ๐
So what you want is fairly straightforward overall. You have a connected account acct_12345 (merchant A) and you have a Customer cus_12345 who is John Doe paying merchant A for something
What you do is use Direct Charges to create a PaymentIntent directly on the connected account today to accept a $100 payment.
What you can do is create a Customer that represents John Doe for merchant A and you get that cus_12345 and you store that in your database "oh John Doe for merchant A is cus_12345". And that Customer can have saved PaymentMethods that you can then display in PaymentElement when they come back a week later to pay merchant A again (using the feature I mentioned above)
how is the customer associated with the merchant?
StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
var options = new CustomerCreateOptions
{
Name = "Jenny Rosen",
Email = "jennyrosen@example.com",
};
var service = new CustomerService();
service.Create(options);
https://docs.stripe.com/payments/save-during-payment
Could the merchant id be used in the customer create options? for example?
I have to run and my colleague @true jolt is taking over.
But really you, as a platform using Direct Charges, are likely already using the Stripe-Account header feature documented at https://stripe.com/docs/connect/authentication#stripe-account-header which lets you make an API Request on a connected account. That's how you must be creating the PaymentIntent today.
And all the calls would work the same way. So the Customer should be created on the connected account with that same option
I see, thanks!