Class: Vpago::Acleda::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/acleda/base.rb', line 6
def initialize(payment, options = {})
@options = options
@payment = payment
end
|
Instance Method Details
#acleda_company_name ⇒ Object
66
67
68
|
# File 'lib/vpago/acleda/base.rb', line 66
def acleda_company_name
@payment.payment_method.preferences[:acleda_company_name]
end
|
#acleda_payment_card ⇒ Object
70
71
72
|
# File 'lib/vpago/acleda/base.rb', line 70
def acleda_payment_card
@payment.payment_method.preferences[:acleda_payment_card]
end
|
#action_url ⇒ Object
106
107
108
|
# File 'lib/vpago/acleda/base.rb', line 106
def action_url
"#{host}/#{merchant_name}/paymentPage.jsp"
end
|
#app_checkout ⇒ Object
15
16
17
|
# File 'lib/vpago/acleda/base.rb', line 15
def app_checkout
app_checkout? ? '1' : '0'
end
|
#app_checkout? ⇒ Boolean
19
20
21
22
23
|
# File 'lib/vpago/acleda/base.rb', line 19
def app_checkout?
return false if @options[:app_checkout].blank?
@options[:app_checkout]
end
|
#error_url ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/vpago/acleda/base.rb', line 42
def error_url
preferred_error_url = @payment.payment_method.preferred_error_url
return nil if preferred_error_url.blank?
query_string = {
app_checkout:,
order_number:
}.to_query
"#{preferred_error_url}?#{query_string}"
end
|
#expiry_time ⇒ Object
94
95
96
|
# File 'lib/vpago/acleda/base.rb', line 94
def expiry_time
@payment.payment_method.preferences[:payment_expiry_time_in_mn]
end
|
#host ⇒ Object
25
26
27
|
# File 'lib/vpago/acleda/base.rb', line 25
def host
@payment.payment_method.preferences[:host]
end
|
#login_id ⇒ Object
74
75
76
|
# File 'lib/vpago/acleda/base.rb', line 74
def login_id
@payment.payment_method.preferences[:login_id]
end
|
#merchant_id ⇒ Object
82
83
84
|
# File 'lib/vpago/acleda/base.rb', line 82
def merchant_id
@payment.payment_method.preferences[:merchant_id]
end
|
#merchant_name ⇒ Object
86
87
88
|
# File 'lib/vpago/acleda/base.rb', line 86
def merchant_name
@payment.payment_method.preferences[:merchant_name]
end
|
#order_number ⇒ Object
102
103
104
|
# File 'lib/vpago/acleda/base.rb', line 102
def order_number
@payment.order.number
end
|
#other_url ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/vpago/acleda/base.rb', line 54
def other_url
preferred_other_url = @payment.payment_method.preferred_other_url
return nil if preferred_other_url.blank?
query_string = {
app_checkout:,
order_number:
}.to_query
"#{preferred_other_url}?#{query_string}"
end
|
#password ⇒ Object
78
79
80
|
# File 'lib/vpago/acleda/base.rb', line 78
def password
@payment.payment_method.preferences[:password]
end
|
#payment_number ⇒ Object
11
12
13
|
# File 'lib/vpago/acleda/base.rb', line 11
def payment_number
@payment.number
end
|
#purchase_date ⇒ Object
98
99
100
|
# File 'lib/vpago/acleda/base.rb', line 98
def purchase_date
@payment.created_at.strftime('%d-%m-%Y')
end
|
#signature ⇒ Object
90
91
92
|
# File 'lib/vpago/acleda/base.rb', line 90
def signature
@payment.payment_method.preferences[:signature]
end
|
#success_url ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/vpago/acleda/base.rb', line 29
def success_url
preferred_success_url = @payment.payment_method.preferred_success_url
return nil if preferred_success_url.blank?
query_string = {
app_checkout:,
order_number:,
order_channel: @payment.order.channel
}.to_query
"#{preferred_success_url}?#{query_string}"
end
|