Class: K2ConnectRuby::K2Entity::K2FinancialEntities::PaymentLinks::PaymentLinkRequest

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb

Overview

Request to create a payment link

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kwargs) ⇒ PaymentLinkRequest

Returns a new instance of PaymentLinkRequest.



16
17
18
19
20
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 16

def initialize(kwargs)
  kwargs.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def amount
  @amount
end

#callback_urlObject

Returns the value of attribute callback_url.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def callback_url
  @callback_url
end

#currencyObject

Returns the value of attribute currency.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def currency
  @currency
end

#metadataObject

Returns the value of attribute metadata.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def 
  @metadata
end

#noteObject

Returns the value of attribute note.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def note
  @note
end

#payment_referenceObject

Returns the value of attribute payment_reference.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def payment_reference
  @payment_reference
end

#till_numberObject

Returns the value of attribute till_number.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 11

def till_number
  @till_number
end

Instance Method Details

#endpointObject



36
37
38
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 36

def endpoint
  K2ConnectRuby::K2Utilities::Config::K2Config.endpoint("payment_links")
end

#request_bodyObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/payment_links/payment_link_request.rb', line 22

def request_body
  {
    till_number: till_number,
    currency: currency,
    amount: amount,
    payment_reference: payment_reference,
    note: note,
    metadata: ,
    _links: {
      callback_url: callback_url,
    },
  }
end