Class: SpreedlyCore::PurchaseTransaction

Inherits:
Transaction show all
Includes:
HasIpAddress, NullifiableTransaction
Defined in:
lib/spreedly_core/transactions.rb

Instance Attribute Summary collapse

Attributes included from HasIpAddress

#ip

Attributes inherited from Transaction

#amount, #created_at, #currency_code, #gateway_token, #message, #on_test_gateway, #response, #succeeded, #token, #transaction_type, #updated_at

Instance Method Summary collapse

Methods included from NullifiableTransaction

#credit, #void

Methods inherited from Transaction

find, handles

Methods inherited from Base

configure, gateway_token, login, verify_get, verify_options, verify_post, verify_put, verify_request

Constructor Details

#initialize(attrs = {}) ⇒ PurchaseTransaction

Returns a new instance of PurchaseTransaction.



113
114
115
116
117
# File 'lib/spreedly_core/transactions.rb', line 113

def initialize(attrs={})
  @payment_method = PaymentMethod.new(attrs.delete("payment_method") || {})
  @response = Response.new(attrs.delete("response") || {})
  super(attrs)
end

Instance Attribute Details

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



111
112
113
# File 'lib/spreedly_core/transactions.rb', line 111

def payment_method
  @payment_method
end