-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add stripe external account model and tests #576
Add stripe external account model and tests #576
Conversation
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.
@paulsullivanjr we could use some minor changes here.
Thanks for doing this!
def changeset(struct, params \\ %{}) do | ||
struct | ||
|> cast(params, [:id_from_stripe, :account_id_from_stripe, :account_holder_name, :account_holder_type, :bank_name, :country, :currency, :default_for_currency, :fingerprint, :last4, :routing_number, :status]) | ||
|> validate_required([:id_from_stripe, :account_id_from_stripe, :account_holder_name, :account_holder_type, :bank_name, :country, :currency, :default_for_currency, :fingerprint, :last4, :routing_number, :status]) |
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.
Should probably split these out into an @
.
Also don't know if we should mark all as required
. I think only ones required would be id_from_stripe
and account_id_from_stripe
.
alias CodeCorps.StripeExternalAccount | ||
|
||
@valid_attrs %{account_holder_name: "some content", account_holder_type: "some content", account_id_from_stripe: "some content", bank_name: "some content", country: "some content", currency: "some content", default_for_currency: "some content", fingerprint: "some content", id_from_stripe: "some content", last4: "some content", routing_number: "some content", status: "some content"} | ||
@invalid_attrs %{} |
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.
Per the comment below, can probably use less attrs here for it to be valid.
e0ceca5
to
7898517
Compare
🙌 nice work @paulsullivanjr |
thanks. I can make the changes you suggested. Should be able to do it tonight. |
What's in this PR?
@paulsullivanjr's work adding an external account model, migration and test.
References
Fixes #571