Class: DineroMail::Client
- Inherits:
-
Object
- Object
- DineroMail::Client
- Includes:
- Operations
- Defined in:
- lib/dinero_mail/client.rb
Constant Summary
Constants included from Operations
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#credential ⇒ Object
readonly
Returns the value of attribute credential.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize(credentials = {}, secret = nil) ⇒ Client
constructor
A new instance of Client.
Methods included from Operations
#do_payment_with_credit_card, #do_payment_with_reference, #do_with_draw, #get_balance, #get_operations, #get_payment_ticket, #send_money
Methods included from Security
Constructor Details
#initialize(credentials = {}, secret = nil) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 16 |
# File 'lib/dinero_mail/client.rb', line 11 def initialize(credentials = {}, secret = nil) url = DineroMail.configuration.test? ? 'https://sandboxapi.dineromail.com/DMAPI.asmx?WSDL' : 'https://api.dineromail.com/dmapi.asmx?WSDL' @credential = { 'APIUserName' => DineroMail.configuration.username, 'APIPassword' => DineroMail.configuration.password } @secret = DineroMail.configuration.secret || Digest::SHA2.hexdigest(Time.now.to_s) @client = Savon::Client.new(url) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
9 10 11 |
# File 'lib/dinero_mail/client.rb', line 9 def client @client end |
#credential ⇒ Object (readonly)
Returns the value of attribute credential.
9 10 11 |
# File 'lib/dinero_mail/client.rb', line 9 def credential @credential end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/dinero_mail/client.rb', line 9 def response @response end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
9 10 11 |
# File 'lib/dinero_mail/client.rb', line 9 def secret @secret end |