Class: Lightrail::LightrailCharge
- Inherits:
-
LightrailObject
- Object
- LightrailObject
- Lightrail::LightrailCharge
- Defined in:
- lib/lightrail_stripe/wrappers/lightrail_charge.rb
Instance Attribute Summary collapse
-
#cardId ⇒ Object
Returns the value of attribute cardId.
-
#codeLastFour ⇒ Object
Returns the value of attribute codeLastFour.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#dateCreated ⇒ Object
Returns the value of attribute dateCreated.
-
#giftbitUserId ⇒ Object
Returns the value of attribute giftbitUserId.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#transactionAccessMethod ⇒ Object
Returns the value of attribute transactionAccessMethod.
-
#transactionId ⇒ Object
Returns the value of attribute transactionId.
-
#transactionType ⇒ Object
Returns the value of attribute transactionType.
-
#userSuppliedId ⇒ Object
Returns the value of attribute userSuppliedId.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cardId ⇒ Object
Returns the value of attribute cardId.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def cardId @cardId end |
#codeLastFour ⇒ Object
Returns the value of attribute codeLastFour.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def codeLastFour @codeLastFour end |
#currency ⇒ Object
Returns the value of attribute currency.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def currency @currency end |
#dateCreated ⇒ Object
Returns the value of attribute dateCreated.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def dateCreated @dateCreated end |
#giftbitUserId ⇒ Object
Returns the value of attribute giftbitUserId.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def giftbitUserId @giftbitUserId end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def @metadata end |
#transactionAccessMethod ⇒ Object
Returns the value of attribute transactionAccessMethod.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def transactionAccessMethod @transactionAccessMethod end |
#transactionId ⇒ Object
Returns the value of attribute transactionId.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def transactionId @transactionId end |
#transactionType ⇒ Object
Returns the value of attribute transactionType.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def transactionType @transactionType end |
#userSuppliedId ⇒ Object
Returns the value of attribute userSuppliedId.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def userSuppliedId @userSuppliedId end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 3 def value @value end |
Class Method Details
.create(charge_params) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 5 def self.create (charge_params) Lightrail::Validator.validate_charge_object! (charge_params) charge_params_to_send_to_lightrail = Lightrail::Translator.charge_params_stripe_to_lightrail(charge_params) charge_method = charge_params_to_send_to_lightrail[:code] ? 'code' : 'cardId' response = (charge_method == 'code') ? Lightrail::Code.charge(charge_params_to_send_to_lightrail) : Lightrail::Card.charge(charge_params_to_send_to_lightrail) self.new(response) end |
.simulate(charge_params) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 18 def self.simulate (charge_params) Lightrail::Validator.validate_charge_object! (charge_params) charge_params_to_send_to_lightrail = Lightrail::Translator.charge_params_stripe_to_lightrail(charge_params) charge_method = charge_params_to_send_to_lightrail[:code] ? 'code' : 'cardId' response = (charge_method == 'code') ? Lightrail::Code.simulate_charge(charge_params_to_send_to_lightrail) : Lightrail::Card.simulate_charge(charge_params_to_send_to_lightrail) self.new(response) end |
Instance Method Details
#cancel!(new_request_body = nil) ⇒ Object
31 32 33 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 31 def cancel! (new_request_body=nil) handle_pending(self, 'void', new_request_body) end |
#capture!(new_request_body = nil) ⇒ Object
35 36 37 |
# File 'lib/lightrail_stripe/wrappers/lightrail_charge.rb', line 35 def capture! (new_request_body=nil) handle_pending(self, 'capture', new_request_body) end |