Class: Laundry::PaymentsGateway::Merchant
- Inherits:
-
Object
- Object
- Laundry::PaymentsGateway::Merchant
- Extended by:
- SOAPModel
- Defined in:
- lib/laundry/payments_gateway/models/merchant.rb
Instance Attribute Summary collapse
-
#api_login_id ⇒ Object
Returns the value of attribute api_login_id.
-
#api_password ⇒ Object
Returns the value of attribute api_password.
-
#id ⇒ Object
Returns the value of attribute id.
-
#transaction_password ⇒ Object
Returns the value of attribute transaction_password.
Class Method Summary collapse
-
.default_merchant(options = nil) ⇒ Object
Deprecated.
Instance Method Summary collapse
- #client_driver ⇒ Object (also: #clients)
-
#initialize(options = {}) ⇒ Merchant
constructor
A new instance of Merchant.
- #login_credentials ⇒ Object
- #socket_driver ⇒ Object
- #transaction_driver ⇒ Object (also: #transactions)
Methods included from SOAPModel
Constructor Details
#initialize(options = {}) ⇒ Merchant
Returns a new instance of Merchant.
22 23 24 25 26 27 28 29 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 22 def initialize( = {}) self.id = [:id] self.api_login_id = [:api_login_id] self.api_password = [:api_password] self.transaction_password = [:transaction_password] end |
Instance Attribute Details
#api_login_id ⇒ Object
Returns the value of attribute api_login_id.
20 21 22 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 20 def api_login_id @api_login_id end |
#api_password ⇒ Object
Returns the value of attribute api_password.
20 21 22 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 20 def api_password @api_password end |
#id ⇒ Object
Returns the value of attribute id.
20 21 22 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 20 def id @id end |
#transaction_password ⇒ Object
Returns the value of attribute transaction_password.
20 21 22 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 20 def transaction_password @transaction_password end |
Class Method Details
Instance Method Details
#client_driver ⇒ Object Also known as: clients
31 32 33 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 31 def client_driver @client_driver ||= ClientDriver.new(self) end |
#login_credentials ⇒ Object
45 46 47 48 49 50 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 45 def login_credentials # Time diff from 1/1/0001 00:00:00 to 1/1/1970 00:00:00 utc_time = (Time.now.to_i + 62135596800).to_s + '0000000' ts_hash = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('md5'), self.api_password, "#{self.api_login_id}|#{utc_time}") {'ticket' => {'APILoginID' => self.api_login_id, 'TSHash' => ts_hash, 'UTCTime' => utc_time}} end |
#socket_driver ⇒ Object
41 42 43 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 41 def socket_driver @socket_driver ||= SocketDriver.new(self) end |
#transaction_driver ⇒ Object Also known as: transactions
36 37 38 |
# File 'lib/laundry/payments_gateway/models/merchant.rb', line 36 def transaction_driver @transaction_driver ||= TransactionDriver.new(self) end |