Class: Vpago::WingSdk::Base
Instance Method Summary
collapse
#amount, #amount_with_fee, #transaction_fee, #transaction_fee_fix, #transaction_fee_percentage
Constructor Details
#initialize(payment, options = {}) ⇒ Base
Returns a new instance of Base.
6
7
8
9
|
# File 'lib/vpago/wing_sdk/base.rb', line 6
def initialize(payment, options = {})
@options = options
@payment = payment
end
|
Instance Method Details
#action_url ⇒ Object
53
54
55
|
# File 'lib/vpago/wing_sdk/base.rb', line 53
def action_url
host
end
|
#app_checkout ⇒ Object
39
40
41
|
# File 'lib/vpago/wing_sdk/base.rb', line 39
def app_checkout
app_checkout? ? 'yes' : 'no'
end
|
#app_checkout? ⇒ Boolean
43
44
45
46
47
|
# File 'lib/vpago/wing_sdk/base.rb', line 43
def app_checkout?
return false if @options[:app_checkout].blank?
@options[:app_checkout]
end
|
#biller_code ⇒ Object
19
20
21
|
# File 'lib/vpago/wing_sdk/base.rb', line 19
def biller_code
@payment.payment_method.preferences[:biller_code]
end
|
#host ⇒ Object
49
50
51
|
# File 'lib/vpago/wing_sdk/base.rb', line 49
def host
@payment.payment_method.preferences[:host]
end
|
#merchant_name ⇒ Object
31
32
33
|
# File 'lib/vpago/wing_sdk/base.rb', line 31
def merchant_name
@payment.payment_method.preferences[:merchant_name] || 'VTenh'
end
|
#payment_number ⇒ Object
11
12
13
|
# File 'lib/vpago/wing_sdk/base.rb', line 11
def payment_number
@payment.number
end
|
#rest_api_key ⇒ Object
27
28
29
|
# File 'lib/vpago/wing_sdk/base.rb', line 27
def rest_api_key
@payment.payment_method.preferences[:rest_api_key]
end
|
#return_url ⇒ Object
35
36
37
|
# File 'lib/vpago/wing_sdk/base.rb', line 35
def return_url
"#{ENV.fetch('DEFAULT_URL_HOST', nil)}/webhook/wings/#{payment_number}/return?app_checkout=#{app_checkout}"
end
|
#sandbox ⇒ Object
15
16
17
|
# File 'lib/vpago/wing_sdk/base.rb', line 15
def sandbox
@payment.payment_method.preferences[:sandbox] ? '1' : '0'
end
|
#username ⇒ Object
23
24
25
|
# File 'lib/vpago/wing_sdk/base.rb', line 23
def username
@payment.payment_method.preferences[:username]
end
|