Class: AN
Defined Under Namespace
Modules: Luhn Classes: AuthorizationResponse, Client, Response
Constant Summary collapse
- TEMPLATES =
File.("../templates", File.dirname(__FILE__))
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.connect(url = ENV["AUTHORIZE_NET_URL"]) ⇒ Object
In production systems, you can simply set.
Instance Method Summary collapse
- #create_payment_profile(params) ⇒ Object
- #create_profile(params) ⇒ Object
- #create_profile_transaction(params) ⇒ Object
- #get_profile(params) ⇒ Object
-
#initialize(uri) ⇒ AN
constructor
A new instance of AN.
- #transact(params) ⇒ Object
Constructor Details
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
25 26 27 |
# File 'lib/an.rb', line 25 def auth @auth end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
26 27 28 |
# File 'lib/an.rb', line 26 def client @client end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
24 25 26 |
# File 'lib/an.rb', line 24 def url @url end |
Class Method Details
.connect(url = ENV["AUTHORIZE_NET_URL"]) ⇒ Object
In production systems, you can simply set
AUTHORIZE_NET_URL=login:[email protected]/xml/v1/request.api
in the appropriate location (e.g. /etc/profile.d, ~/.bashrc, or whatever you’re most comfortable with.
The TEST URL is apikey.authorize.net/xml/v1/request.api
16 17 18 |
# File 'lib/an.rb', line 16 def self.connect(url = ENV["AUTHORIZE_NET_URL"]) new(URI(url)) end |
Instance Method Details
#create_payment_profile(params) ⇒ Object
41 42 43 |
# File 'lib/an.rb', line 41 def create_payment_profile(params) call("createCustomerPaymentProfileRequest", params) end |
#create_profile(params) ⇒ Object
37 38 39 |
# File 'lib/an.rb', line 37 def create_profile(params) call("createCustomerProfileRequest", params) end |
#create_profile_transaction(params) ⇒ Object
45 46 47 |
# File 'lib/an.rb', line 45 def create_profile_transaction(params) call("createCustomerProfileTransactionRequest", params) end |
#get_profile(params) ⇒ Object
49 50 51 |
# File 'lib/an.rb', line 49 def get_profile(params) call("getCustomerProfileRequest", params) end |
#transact(params) ⇒ Object
33 34 35 |
# File 'lib/an.rb', line 33 def transact(params) call("createTransactionRequest", params) end |