Class: OnlinePayments::SDK::Domain::CreatePaymentLinkRequest

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/create_payment_link_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#descriptionString

Returns the current value of description.

Returns:

  • (String)

    the current value of description



14
15
16
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 14

def description
  @description
end

#expiration_dateString

Returns the current value of expiration_date.

Returns:

  • (String)

    the current value of expiration_date



14
15
16
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 14

def expiration_date
  @expiration_date
end

Returns the current value of payment_link_order.

Returns:



14
15
16
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 14

def payment_link_order
  @payment_link_order
end

#recipient_nameString

Returns the current value of recipient_name.

Returns:

  • (String)

    the current value of recipient_name



14
15
16
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 14

def recipient_name
  @recipient_name
end

Instance Method Details

#from_hash(hash) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def from_hash(hash)
  super
  @description = hash['description'] if hash.key? 'description'
  @expiration_date = hash['expirationDate'] if hash.key? 'expirationDate'
  if hash.key? 'paymentLinkOrder'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentLinkOrder']] unless hash['paymentLinkOrder'].is_a? Hash
    @payment_link_order = OnlinePayments::SDK::Domain::PaymentLinkOrderInput.new_from_hash(hash['paymentLinkOrder'])
  end
  @recipient_name = hash['recipientName'] if hash.key? 'recipientName'
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 21

def to_h
  hash = super
  hash['description'] = @description unless @description.nil?
  hash['expirationDate'] = @expiration_date unless @expiration_date.nil?
  hash['paymentLinkOrder'] = @payment_link_order.to_h if @payment_link_order
  hash['recipientName'] = @recipient_name unless @recipient_name.nil?
  hash
end