#chrisdedev
1 messages · Page 1 of 1 (latest)
Can you provide a little more context
That completely depends on what data you need to access at a later date
So I got the setup working to save payment for later
I have only done curl requests for testing
what I want to know is what should I save to be able to charge the customer later
You'd need customer id and payment method id at minimum
Whatever else you want to store depends on your integration and what you need to access
It is fine to save the payment id in the database
It looks like in the sample that you lookup the payment id
You should probably store pm_ and cus_ id's yourself
Yep you can look it up if you want
But if you save the pm_ id yourself, that saves an api call and it'll be faster
I'm just confirming that is fine. Cause It could be possible for my customer to add multiple cards and I would like to allow them to specify a default one to charge.
So thanks for confirming that I can save the pm_id
Yep no prob
So in the sample code it looks up "type=card" is it possible to save other payment types like apple pay for later charges
Yeah. Not all payment methods support future usage, but many do. The payment method docs page for each payment method should indicate whether it's supported
So I added the sample Insufficient funds decline card. It seems to fail before I get a payment method
I'm wondering is it not possible to add the decline cards as payment methods
Hi 👋
I"m taking over as @flint falcon had to go.
- You can add declined cards as payment methods using the PaymentMethod strings (e.g.
pm_card_visa_chargeDeclined). - What is the context here? Where/how do you want to add the card?
I was adding the 9995 card
If you click the Payment Method tab at the top of that table you will see the pm_ tokens you can use to attach to a customer
So I can't just add the card with the numbers. Is that the issue
How are you trying to add them?
I'm using flutter_stripe
paymentIntentClientSecret: clientSecret,
params: PaymentMethodParams.card(
paymentMethodData: PaymentMethodData(
billingDetails: billingDetails,
),
),
);```
that seems to be where it fails.
Okay so you are attempting to use it in a Setup Intent.
_$_StripeException (StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: Your card has insufficient funds., message: Your card has insufficient funds., stripeErrorCode: card_declined, declineCode: insufficient_funds, type: card_error)))
Is this with the Payment Element?
that is the error I get
Because that's the error you would expect
So what I'm wondering is does stripe check cards before adding them as payment methods
I'm creating a SetupIntent
The SetupIntent validates the card
when you attempt to confirm
Of course, with an error like insufficient funds, the card may validate successfully when you set it up but still fail when you attempt to charge it
That was the scenerio I wanted to create by using a insufficient funds card
In that case I would recommend you create a Customer object and directly attach the payment method to them
Then attempt payment with that method
So since I'm making SetupIntents I will just need to use the payment methods ids
If tha tis the way you want to test it. I think creating the Customer directly with the PM and then attempting payment is a bit more straightforward
I want to test how the app behaves with my test accounts. Can I just attach the payment method ids to the customer in the stripe dashboard then make the charges?