Adds retrieve payment methods customer endpoint#1
Merged
Conversation
hhoopes
reviewed
Feb 25, 2025
macaugh
commented
Feb 25, 2025
Author
macaugh
left a comment
There was a problem hiding this comment.
Still trying to decide our best option here. I'm thinking that this would work for us for now but I don't think it would be appropriate to upstream.
hhoopes
reviewed
Feb 25, 2025
hhoopes
reviewed
Feb 25, 2025
|
It seems like a solid first pass for improving our ability to use this gem! Will be interesting to get to upgrade the gem and start removing manual mocks from our tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new request handler to simulate retrieving a payment method for a customer in the Stripe mock environment. The new handler is registered via the
Customers.includedcallback using the route:The corresponding method,
retrieve_payment_method, extracts the customer ID and payment method ID from the URL, validates the existence of the customer, and then searches for the payment method within the customer's stored sources. If the payment method is not found, it raises an appropriate error.I found based on the docs that to test you need to run the following:
However this led to a lot of errors.
To test the specific functions added you can use the following