Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCR integration #320

Merged
merged 9 commits into from
Oct 8, 2024
Merged

VCR integration #320

merged 9 commits into from
Oct 8, 2024

Conversation

beingmattlevy
Copy link
Collaborator

Initial checkin
payment spec first cassettes

Initial checkin
payment spec first cassettes
Move payment received functionality to model
added specs
Copy link
Collaborator

@kigster kigster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work man! Tests now pass in 6 seconds!!! Whoohoo!

Can you add to README instructions on how to regenerate cassettes if any of the APIs change? Or how to turn off using cassettes and turn on cassette generation?

I left a couple of tiny questions but this is nearly ready to go.

@@ -141,6 +141,7 @@ def retrieve_payment_intent
end

Rails.logger.debug { "retrieve_payment_intent payment => #{inspect}}" }
self.payment_intent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove self since it's a reader

# mark payment received and ticket request completed
# Send off PaymentMailer for payment received
def request_completed
mark_received
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to wrap these two in a transaction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move the transaction from the controller.

ticket_request.mark_complete
Payment.transaction do
# set payment and ticket request status
mark_received
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@kigster kigster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, minus the extraneous begin/rescue in a method.

any method entry works just like begin and so you can rescue any exception within the method without the explicit and unnecessary begin

@beingmattlevy beingmattlevy merged commit 5cd4ece into main Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants