Skip to content

Commit

Permalink
Merged in wirecard (pull request aviabird#4)
Browse files Browse the repository at this point in the history
Wirecard

Approved-by: Ashish singh <[email protected]>
  • Loading branch information
kartikjagdale authored and ashish173 committed Dec 14, 2017
2 parents 143cdd3 + b162182 commit ff46c64
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/kuber_hex/credit_card.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
defmodule Kuber.Hex.CreditCard do
defstruct [:name, :number, :expiration, :cvc, :brand]
defstruct [:number, :month, :year, :first_name, :last_name, :verification_code, :brand]
end
11 changes: 6 additions & 5 deletions lib/kuber_hex/gateways/monei.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ defmodule Kuber.Hex.Gateways.Monei do
defp card_params(card) do
{expiration_year, expiration_month} = card.expiration
["card.number": card.number,
"card.holder": card.name,
"card.holder": "#{card.first_name} #{card.last_name}",
"card.expiryMonth": expiration_month |> Integer.to_string |> String.pad_leading(2, "0"),
"card.expiryYear": expiration_year |> Integer.to_string,
"card.cvv": card.cvc,
"card.cvv": card.verification_code,
"paymentBrand": card.brand]
end

Expand Down Expand Up @@ -148,18 +148,19 @@ alias Kuber.Hex.Gateways.Monei
alias Kuber.Hex.{CreditCard, Address, Response}
cc = %CreditCard{
name: "Jo Doe",
first_name: "Jo",
last_name: "Doe",
number: "4200000000000000",
expiration: {2019, 12},
cvc: "123",
verification_code: "123",
brand: "VISA"
}
bad_cc = %CreditCard{
name: "Jo Doe",
number: "4200000000000000",
expiration: {2011, 12},
cvc: "123",
verification_code: "123",
brand: "VISA"
}
Expand Down
2 changes: 1 addition & 1 deletion lib/kuber_hex/gateways/stripe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ defmodule Kuber.Hex.Gateways.Stripe do
["card[number]": card.number,
"card[exp_year]": expiration_year,
"card[exp_month]": expiration_month,
"card[cvc]": card.cvc,
"card[cvc]": card.verification_code,
"card[name]": card.name]
end

Expand Down
Loading

0 comments on commit ff46c64

Please sign in to comment.