Class: SolidusOpenPay::Builders::Charge
- Inherits:
-
Object
- Object
- SolidusOpenPay::Builders::Charge
- Defined in:
- app/models/solidus_open_pay/builders/charge.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source:, amount:, options: {}) ⇒ Charge
constructor
A new instance of Charge.
- #payload ⇒ Object
Constructor Details
#initialize(source:, amount:, options: {}) ⇒ Charge
Returns a new instance of Charge.
8 9 10 11 12 |
# File 'app/models/solidus_open_pay/builders/charge.rb', line 8 def initialize(source:, amount:, options: {}) @source = source @amount = amount @options = end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
6 7 8 |
# File 'app/models/solidus_open_pay/builders/charge.rb', line 6 def amount @amount end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/models/solidus_open_pay/builders/charge.rb', line 6 def @options end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'app/models/solidus_open_pay/builders/charge.rb', line 6 def source @source end |
Instance Method Details
#payload ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/solidus_open_pay/builders/charge.rb', line 14 def payload { 'source_id' => token_id, 'method' => 'card', 'amount' => amount / 100, 'currency' => 'MXN', 'capture' => capture, 'description' => 'Cargo inicial', 'order_id' => order_id, 'device_session_id' => device_session_id, 'customer' => { 'name' => first_name, 'last_name' => last_name, 'phone_number' => phone_number, 'email' => email } } end |