class Reggora::SchedulePaymentApp
Public Class Methods
new(client)
click to toggle source
# File lib/reggora/Entity/Lender/schedule_payment_app.rb, line 3 def initialize(client) @client = client end
Public Instance Methods
consumer_app_link(order_id, consumer_id, link_type)
click to toggle source
@param [String] order_id @param [String] link_type : payment/schedule/both @param [String] consumer_id
# 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 = '')
click to toggle source
# 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 = '')
click to toggle source
# 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)
click to toggle source
# 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