Created
June 6, 2018 17:31
-
-
Save oyeb/bcf80db5634c0b7e5fe5d1ebc8e1308b to your computer and use it in GitHub Desktop.
Some handy IEx bindings for the SagePay gateway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias Gringotts.{CreditCard, Response} | |
card = %CreditCard{ | |
number: "4929000005559", | |
month: 3, | |
year: 20, | |
first_name: "SAM", | |
last_name: "JONES", | |
verification_code: "123", | |
brand: "VISA" | |
} | |
amount = Money.new(100, :GBP) | |
address = %{ | |
address1: "407 St. John Street", | |
city: "London", | |
postalCode: "EC1V 4AB", | |
country: "GB" | |
} | |
opts = [ | |
config: %{ | |
auth_id: | |
"aEpZeHN3N0hMYmo0MGNCOHVkRVM4Q0RSRkxodUo4RzU0TzZyRHBVWHZFNmhZRHJyaWE6bzJpSFNyRnliWU1acG1XT1FNdWhzWFA1MlY0ZkJ0cHVTRHNocktEU1dzQlkxT2lONmh3ZDlLYjEyejRqNVVzNXU=", | |
vendor: "sandbox" | |
}, | |
transactionType: "Deferred", | |
vendorTxCode: "demotransaction-71", | |
description: "Demo Payment", | |
customerFirstName: "Sam", | |
customerLastName: "Jones", | |
billingAddress: address | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment