-
Notifications
You must be signed in to change notification settings - Fork 52
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
Using Address and Credit Card struct #74
Conversation
Notice that you have 2 commits (8bc5b77, 830da82) that introduce exactly the same changes. This happened because you pulled this branch back into your local, instead of doing a force push. Could you please clean up your local and do a force push? |
a5f97f5
to
c1d51d7
Compare
lib/gringotts/gateways/stripe.ex
Outdated
@@ -1,9 +1,9 @@ | |||
defmodule Gringotts.Gateways.Stripe do | |||
|
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.
@jyotigautam you have changed stripe.ex
unnecessarily, there will be no breaking changes this time, but before committing code you should check that you are not adding any other unnecessary files.
lib/gringotts/gateways/trexle.ex
Outdated
def store(payment, opts \\ []) do | ||
params = [email: opts[:email]]++card_params(payment) | ||
params = [ | ||
email: opts[:email] |
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.
no need to separate email in three different lines, you can do something like this
[email: opts[:email]]
++ card_params(payment)
++ address_params(opts[:billing_address])
first_name: "John", | ||
last_name: "Doe", | ||
verification_code: "123", | ||
brand: "visa" | ||
} | ||
|
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.
@jyotigautam you are assigning a value for card whereas you are declaring module attribute for address, since these examples are going to be executed in iex
, module attribute will not work. change it to below throughout the examples.
address = %Address{
+ street1: "123 Main",
+ street2: "Suite 100",
+ city: "New York",
+ region: "NY",
+ country: "US",
+ postal_code: "11111",
+ phone: "(555)555-5555"
+ }
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.
Have assigned this address struct to a variable instead of using it as a module attribute as you said.
29b52cd
to
ac911d6
Compare
Removed changes made to stripe. Modified accessors according to a struct. Indentation fixes.
ac911d6
to
47b334a
Compare
@jyotigautam coverage decreased please add necessary test cases. |
68f7ba6
to
b1f6b07
Compare
@pkrawat1 same functions were added twice, that's why the coverage decreased.I have amended the code. |
* Address and Credit Card struct usage
Following a proper format for Address and Credit Card using structs to maintain the consistency.