-
-
Notifications
You must be signed in to change notification settings - Fork 708
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
Replaces Stripe stubs with the real account IDs #11950
Replaces Stripe stubs with the real account IDs #11950
Conversation
ea062e6
to
e164d93
Compare
1997f85
to
159af3b
Compare
end | ||
end | ||
|
||
context "when the Stripe API disconnect succeeds" do | ||
before { Stripe.client_id = client_id } | ||
|
||
it "destroys the record" do | ||
# returns status 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this example I'm getting status 401 as well:
(Bugsnag).notify(#<RuntimeError: StripeDeauthorizeFailure>, {:enterprise_id=>177, :stripe_account=>"acct_1FiqEsKuuB1fWySn"})
expected: 0 times with any arguments
received: 1 time with arguments: (#<RuntimeError: StripeDeauthorizeFailure>, {:enterprise_id=>177, :stripe_account=>"acct_1FiqEsKuuB1fWySn"})
Not sure why this is happening. To be continued...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is that apparently, stripe_account
is not connected:
{
"error": "invalid_client",
"error_description": "This application is not connected to stripe account <HIDDEN_ACCOUNT>, or that account does not exist."
}
So, it does no pass the disconnect test. This is the case, even if use create_account
from lib/stripe/account_connector.rb
... Maybe I should test this file before proceeding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it now - we can actually create a simple account with a direct API call to Stripe, and then pass it as an argument to our deauthorize_and_destroy
method defined here.
If we do this, then the account can be disconnected and Bugsnag is not triggered.
Adds STRIPE_ACCOUNT as sensitive data to VCR setup Rubocop fixes and re-recording of cassettes Adds bogus client_id to local test file - for CI to run
586a553
to
8f003c3
Compare
Re-records cassettes Creates a bogus publishable key We need to feed some value to the ENV variables which are picked up from the local test environment, for the build to run. We could also store them all as environment secrets on our repo, but I don'r think this is necessary, as we only run recorderd API/VCR calls on our build, and never real API calls.
8f003c3
to
d8d874f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
expect { | ||
stripe_account.deauthorize_and_destroy | ||
}.to change( | ||
StripeAccount.where(stripe_user_id:), :count | ||
).from(1).to(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
What? Why?
Related to Epic #11890.
Closes #11949.
Sets up the spec with Stripe credentials, so our code can actually make the real calls to Stripe; Records responses.
Also adds STRIPE_ACCOUNT as sensitive data to VCR setup.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates