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

Add stripe external account model and tests #576

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

joshsmith
Copy link
Contributor

What's in this PR?

@paulsullivanjr's work adding an external account model, migration and test.

References

Fixes #571

Copy link
Contributor Author

@joshsmith joshsmith left a 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])
Copy link
Contributor Author

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 %{}
Copy link
Contributor Author

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.

@joshsmith joshsmith force-pushed the 571-stripe-external-account-model-and-tests branch from e0ceca5 to 7898517 Compare December 14, 2016 06:39
@joshsmith joshsmith merged commit 232e069 into develop Dec 14, 2016
@joshsmith joshsmith deleted the 571-stripe-external-account-model-and-tests branch December 14, 2016 06:49
@joshsmith
Copy link
Contributor Author

🙌 nice work @paulsullivanjr

@paulsullivanjr
Copy link
Contributor

thanks. I can make the changes you suggested. Should be able to do it tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants