Class: Lightrail::Refund

Inherits:
LightrailObject
  • Object
show all
Defined in:
lib/lightrail_stripe/wrappers/refund.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#cardIdObject

Returns the value of attribute cardId.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def cardId
  @cardId
end

#codeLastFourObject

Returns the value of attribute codeLastFour.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def codeLastFour
  @codeLastFour
end

#currencyObject

Returns the value of attribute currency.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def currency
  @currency
end

#dateCreatedObject

Returns the value of attribute dateCreated.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def dateCreated
  @dateCreated
end

#giftbitUserIdObject

Returns the value of attribute giftbitUserId.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def giftbitUserId
  @giftbitUserId
end

#metadataObject

Returns the value of attribute metadata.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def 
  @metadata
end

#parentTransactionIdObject

Returns the value of attribute parentTransactionId.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def parentTransactionId
  @parentTransactionId
end

#transactionAccessMethodObject

Returns the value of attribute transactionAccessMethod.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def transactionAccessMethod
  @transactionAccessMethod
end

#transactionIdObject

Returns the value of attribute transactionId.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def transactionId
  @transactionId
end

#transactionTypeObject

Returns the value of attribute transactionType.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def transactionType
  @transactionType
end

#userSuppliedIdObject

Returns the value of attribute userSuppliedId.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def userSuppliedId
  @userSuppliedId
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 3

def value
  @value
end

Class Method Details

.create(original_transaction_response, new_request_body = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lightrail_stripe/wrappers/refund.rb', line 5

def self.create(original_transaction_response, new_request_body = {})
  hash_of_original_transaction_response = original_transaction_response.clone
  hash_of_original_transaction_response = Lightrail::Translator.charge_instance_to_hash!(hash_of_original_transaction_response)

  Lightrail::Validator.validate_transaction_response! (hash_of_original_transaction_response)

  transaction_id = Lightrail::Validator.get_transaction_id(hash_of_original_transaction_response)

  body = new_request_body
  body[:userSuppliedId] ||= Lightrail::Validator.get_or_create_user_supplied_id_with_action_suffix(body, transaction_id, 'refund')

  response = Lightrail::Transaction.handle_transaction(hash_of_original_transaction_response, :refund, body)

  self.new(response)
end