Class: ShopeePayService::CreateInvoice
- Defined in:
- app/services/shopee_pay_service/create_invoice.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(reservation, options = {}) ⇒ CreateInvoice
constructor
A new instance of CreateInvoice.
Constructor Details
#initialize(reservation, options = {}) ⇒ CreateInvoice
Returns a new instance of CreateInvoice.
6 7 8 9 |
# File 'app/services/shopee_pay_service/create_invoice.rb', line 6 def initialize(reservation, = {}) @reservation = reservation @options = .reverse_merge(platform_type: 'pc') end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/shopee_pay_service/create_invoice.rb', line 11 def execute response = super ActiveRecord::Base.transaction do @reservation.charges.build(charge_attribute(response)) @reservation.charges.each(&:save!) end response end |