Class: Vpago::PaymentUrlConstructor
- Inherits:
-
Object
- Object
- Vpago::PaymentUrlConstructor
- Defined in:
- app/services/vpago/payment_url_constructor.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
Returns the value of attribute order.
-
#payment ⇒ Object
Returns the value of attribute payment.
Instance Method Summary collapse
- #checkout_url ⇒ Object
-
#initialize(payment) ⇒ PaymentUrlConstructor
constructor
A new instance of PaymentUrlConstructor.
-
#offsite_payment? ⇒ Boolean
true money use case.
- #process_payment_url ⇒ Object
- #processing_url ⇒ Object
- #query ⇒ Object
- #success_deeplink_url ⇒ Object
- #success_url ⇒ Object
- #web_checkout_url ⇒ Object
Constructor Details
#initialize(payment) ⇒ PaymentUrlConstructor
Returns a new instance of PaymentUrlConstructor.
7 8 9 10 |
# File 'app/services/vpago/payment_url_constructor.rb', line 7 def initialize(payment) @payment = payment @order = payment.order end |
Instance Attribute Details
#order ⇒ Object
Returns the value of attribute order.
5 6 7 |
# File 'app/services/vpago/payment_url_constructor.rb', line 5 def order @order end |
#payment ⇒ Object
Returns the value of attribute payment.
5 6 7 |
# File 'app/services/vpago/payment_url_constructor.rb', line 5 def payment @payment end |
Instance Method Details
#checkout_url ⇒ Object
12 |
# File 'app/services/vpago/payment_url_constructor.rb', line 12 def checkout_url = "#{base_url}/vpago_payments/checkout?#{query}&platform=app" |
#offsite_payment? ⇒ Boolean
true money use case
32 33 34 |
# File 'app/services/vpago/payment_url_constructor.rb', line 32 def offsite_payment? payment.payment_method.type_true_money? end |
#process_payment_url ⇒ Object
20 |
# File 'app/services/vpago/payment_url_constructor.rb', line 20 def process_payment_url = "#{base_url}/vpago_payments/process_payment?#{query}" |
#processing_url ⇒ Object
15 |
# File 'app/services/vpago/payment_url_constructor.rb', line 15 def processing_url = "#{base_url}/vpago_payments/processing?#{query}" |
#query ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/services/vpago/payment_url_constructor.rb', line 22 def query { payment_number: payment.number, order_number: order.number, order_jwt_token: order_jwt_token, offsite_payment: offsite_payment? ? true : nil }.compact.to_query end |
#success_deeplink_url ⇒ Object
18 |
# File 'app/services/vpago/payment_url_constructor.rb', line 18 def success_deeplink_url = "#{app_scheme}://#{URI(base_url).host}/book/payment?number=#{order.number}&tk=#{order.token}" |
#success_url ⇒ Object
17 |
# File 'app/services/vpago/payment_url_constructor.rb', line 17 def success_url = "#{base_url}/vpago_payments/success?#{query}" |
#web_checkout_url ⇒ Object
13 |
# File 'app/services/vpago/payment_url_constructor.rb', line 13 def web_checkout_url = "#{base_url}/vpago_payments/checkout?#{query}&platform=web" |