Class: YaKassa::V3::Router

Inherits:
Object
  • Object
show all
Defined in:
lib/ya_kassa/v3/router.rb

Constant Summary collapse

ENDPOINT =
'https://payment.yandex.net/api/v3/'
PATH =
{
  payments: 'payments',
  refunds: 'refunds',
  receipts: 'receipts'
}

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Router

Returns a new instance of Router.



11
12
13
# File 'lib/ya_kassa/v3/router.rb', line 11

def initialize(params = {})
  @params = params
end

Instance Method Details

#payment_cancel_urlObject



27
28
29
# File 'lib/ya_kassa/v3/router.rb', line 27

def payment_cancel_url
  "#{ENDPOINT}#{PATH[:payments]}/#{@params[:payment_id]}/cancel"
end

#payment_confirmation_urlObject



23
24
25
# File 'lib/ya_kassa/v3/router.rb', line 23

def payment_confirmation_url
  "#{ENDPOINT}#{PATH[:payments]}/#{@params[:payment_id]}/capture"
end

#payment_status_urlObject



19
20
21
# File 'lib/ya_kassa/v3/router.rb', line 19

def payment_status_url
  "#{ENDPOINT}#{PATH[:payments]}/#{@params[:payment_id]}"
end

#payment_urlObject



15
16
17
# File 'lib/ya_kassa/v3/router.rb', line 15

def payment_url
  "#{ENDPOINT}#{PATH[:payments]}"
end

#receipt_urlObject



35
36
37
# File 'lib/ya_kassa/v3/router.rb', line 35

def receipt_url
  "#{ENDPOINT}#{PATH[:receipts]}"
end

#refund_urlObject



31
32
33
# File 'lib/ya_kassa/v3/router.rb', line 31

def refund_url
  "#{ENDPOINT}#{PATH[:refunds]}"
end