#mesudev

1 messages · Page 1 of 1 (latest)

weak pelicanBOT
spark needle
#

Hi! Let me help you with this.

somber slate
#

Hi, yes please 🙂

spark needle
#

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?

somber slate
#

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?

spark needle
#

Yes.

somber slate
#

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)

spark needle
#

I can't recommend you a specific tool, but you can probably do it with any frontend testing framework

somber slate
#

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? 😄

Learn how to use automated testing in your Stripe integration.

spark needle
#

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.

somber slate
#

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.

spark needle
#

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.

somber slate
#

ok thanks

#

any plans on providing a testing solution for this?

spark needle
#

Given that manipulating the card input field is a sensitive topic, I can't guarantee there will be a solution for this.

somber slate
#

ah ok gotya, cheers!

spark needle
#

Happy to help!