Class: Gillbus::BuyBooking::Request

Inherits:
Gillbus::BaseRequest show all
Defined in:
lib/gillbus/buy_booking.rb

Constant Summary collapse

METHOD_CASH =

1 – наличный;

1
METHOD_CARD =

2 – кредитной карточкой;

2
METHOD_NOCASH =

3 – безналичный;

3
METHOD_SERVICE =

4 – сервисный;

4
METHOD_ACQUIRING =

5 – эквайринг.

5

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Gillbus::BaseRequest

#initialize, #method

Constructor Details

This class inherits a constructor from Gillbus::BaseRequest

Instance Attribute Details

#order_idsObject

Returns the value of attribute order_ids.



31
32
33
# File 'lib/gillbus/buy_booking.rb', line 31

def order_ids
  @order_ids
end

#payment_methodObject

paymentMethod (не обязательный) Способ оплаты заказа.



10
11
12
# File 'lib/gillbus/buy_booking.rb', line 10

def payment_method
  @payment_method
end

#ticket_countObject

ticketCount Кол-во выкупаемых билетов. 1..k



26
27
28
# File 'lib/gillbus/buy_booking.rb', line 26

def ticket_count
  @ticket_count
end

#ticket_numbersObject

Номера билетов с порядковым номером



29
30
31
# File 'lib/gillbus/buy_booking.rb', line 29

def ticket_numbers
  @ticket_numbers
end

Instance Method Details

#paramsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gillbus/buy_booking.rb', line 33

def params
  numbers = ticket_numbers.map.with_index do |num, i|
    [:"ticketNumber#{i}", num]
  end.to_h

  orders = order_ids.map.with_index do |val, i|
    [:"orderId#{i}", val]
  end.to_h

  compact(
    paymentMethod: payment_method,
    ticketCount: ticket_count,
    **numbers,
    **orders,
  )
end

#pathObject



6
# File 'lib/gillbus/buy_booking.rb', line 6

def path; '/online2/buyBooking' end