Class: Reggora::SchedulePaymentApp
- Inherits:
-
Object
- Object
- Reggora::SchedulePaymentApp
- Defined in:
- lib/reggora/Entity/Lender/schedule_payment_app.rb
Instance Method Summary collapse
- #consumer_app_link(order_id, consumer_id, link_type) ⇒ Object
-
#initialize(client) ⇒ SchedulePaymentApp
constructor
A new instance of SchedulePaymentApp.
- #payment_attributes(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') ⇒ Object
- #send_payment_app(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') ⇒ Object
- #send_scheduling_app(consumer_emails, order_id) ⇒ Object
Constructor Details
#initialize(client) ⇒ SchedulePaymentApp
Returns a new instance of SchedulePaymentApp.
3 4 5 |
# File 'lib/reggora/Entity/Lender/schedule_payment_app.rb', line 3 def initialize(client) @client = client end |
Instance Method Details
#consumer_app_link(order_id, consumer_id, link_type) ⇒ Object
19 20 21 |
# File 'lib/reggora/Entity/Lender/schedule_payment_app.rb', line 19 def consumer_app_link(order_id, consumer_id, link_type) @client.get("/#{order_id}/#{consumer_id}/#{link_type}") end |
#payment_attributes(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/reggora/Entity/Lender/schedule_payment_app.rb', line 23 def payment_attributes(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') attributes = { consumer_email: consumer_email, order_id: order_id, user_type: user_type, payment_type: payment_type, amount: amount } attributes.merge!({firstname: firstname, lastname: lastname, paid: false}) if user_type == 'manual' attributes end |
#send_payment_app(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') ⇒ Object
7 8 9 10 |
# File 'lib/reggora/Entity/Lender/schedule_payment_app.rb', line 7 def send_payment_app(consumer_email, order_id, user_type, payment_type, amount, firstname = '', lastname = '') payment_params = payment_attributes(consumer_email, order_id, user_type, payment_type, amount, firstname, lastname) @client.post('/consumer/payment', payment_params) end |
#send_scheduling_app(consumer_emails, order_id) ⇒ Object
12 13 14 |
# File 'lib/reggora/Entity/Lender/schedule_payment_app.rb', line 12 def send_scheduling_app(consumer_emails, order_id) @client.post("/consumer/scheduling", {consumer_emails: consumer_emails, order_id: order_id}) end |