#hugues9308
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- hugues9308, 10 hours ago, 6 messages
Hi, let me help you with this.
If you call the API directly, the request params need to be application/x-www-form-urlencoded: https://stripe.com/docs/api
How inconvenient! Thanks anyway.
Happy to help.
How should I translate the following in application/x-www-form-urlencoded?:
{
"customer": "a@a.ca",
"payment_method_options": {
"acss_debit": {
"currency": "cad",
"mandate_options": {
"payment_schedule": "interval",
"interval_description": "First day of every month",
"transaction_type": "personal"
},
"verification_method": "instant"
}
}
}
I don't know what to do with properties with nested objects or arrays? Is there a better way than the following?
curl -X POST -H "Authorization: Bearer sk_test_123" http://localhost:12111/v1/setup_intents \
-d "payment_method_types[]"=acss_debit \
-d customer=hjoly@xn.com \
-d "payment_method_options[acss_debit[currency]]"=cad \
...
Are you sure you don't want to use a Stripe SDK for this?
That's my intention. But first, I want to see how stripe-mock respond to basic requests: I've read that it is quite limited in its replies.
You can see examples of how nested properties are defined in Stripe API Reference: https://stripe.com/docs/api/payment_intents/create?lang=curl
e.g.
-d "payment_method_options[acss_debit][currency]"=cad
It is definitely less capable than Test mode, which can also be used for testing.
Ideally, I'd like to use the Dashboard in test mode in my integration tests but the API doesn't permit a total cleanup of the test artefacts (as it should be at the end of the integration tests)
You can automate it, list all objects of all types used, e.g. all Customers, PaymentIntents, and then delete them.
You can create a separate Stripe account just for testing.
So it doesn't mess with your manual testing data.
I know that there's a way to clean all of the content of a Stripe account. Is it what your referring to? Is this cleanup invokable programmatically?
Are you still there?
I don't think there's a way. But let me double check.
It doesn't seem so. As I said, you will have to list all items and delete them one by one.
To my knowledge, I don't think that the API permits the deletion of any kind of object: for example, you can't delete a subscription, you can only cancel it
Yes, but you can delete a Customer that holds the Subscriptions: https://stripe.com/docs/api/customers/delete
Also if you use Test Clocks, the Customer objects created with it will be deleted after 3 months: https://stripe.com/docs/api/test_clocks