#mesudev
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Hi, yes please 🙂
No, you shouldn't send card details directly to Stripe, unless your app is PCI-compliant. In addition, if you test this without the frontend, how do you know if it's actually working? Are you testing how you're sending API requests to Stripe?
We do REST API-based integration testing, for now without any browser / acceptance testing, and would like to stick to this for now. So we want to first of all assure that all of our API requests, including all the flows with our integrated payment service provider, work as intended. We of course won't store any card details in our server / send card details directly to stripe, it's just for the sake of testing the entire flow of storing a payment method.
So you're basically saying that the testing of this flow is exclusively possible using browser-based testing?
Yes.
Would you recommend any tool that proved worthful to do so? There are quite a lot (Codeception, Selenium, etc.) which are proposed, and we would love to lose a minimum amount of time to configure these tests. Could I may ask which tool you use on your end for browser-testing that proved to work without any issues?
(with your stripe.js library)
I can't recommend you a specific tool, but you can probably do it with any frontend testing framework
Are you sure about this? I'm asking because stripe.js requires the payment element to store a payment method, and your docs say:
Automated testing is a common part of application development, both for server and client-side code. Frontend interfaces, like Stripe Checkout or the Payment Element, have security measures in place that prevent automated testing, and Stripe APIs are rate limited.
(https://stripe.com/docs/automated-testing)
So could you please double-check that we can test this, before we start with the implementation in vain? 😄
What we could already test are steps 1 - 4 from this here https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements, and we'd need to test steps 5 and 6 using browser-based testing. It would be very helpful if you could double-check that this is actually possible.
Yeah, as the docs suggest, I am also not 100% sure it's possible to test the happy flow with Elements.
You might just need to mock it all.
It's not clear because at the bottom of the linked automation page, it says:
When you need to perform tests to validate the response of the Stripe API, making requests to the API in test mode is an acceptable approach. You can also use Stripe API requests to periodically validate that Stripe API responses haven’t changed
Which is kind of the opposite of what its saying above. Could you please check on this?
Mocking of course defeats the whole purpose of the acceptance test and makes it useless, as we already tested what can be tested on the side of our API. We have to assure that the integration with stripe (to store a payment method) is working.
The docs say that you can't test the front-end part, except error handling.
But you can test the backend API requests, although it's rate-limited.
Given that manipulating the card input field is a sensitive topic, I can't guarantee there will be a solution for this.
ah ok gotya, cheers!
Happy to help!