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

#card_payment_method_specific_inputOnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputBase

Returns the current value of card_payment_method_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#descriptionString

Returns the current value of description.

Returns:

  • (String)

    the current value of description



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def description
  @description
end

#expiration_dateString

Returns the current value of expiration_date.

Returns:

  • (String)

    the current value of expiration_date



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def expiration_date
  @expiration_date
end

#fraud_fieldsOnlinePayments::SDK::Domain::FraudFields

Returns the current value of fraud_fields.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def fraud_fields
  @fraud_fields
end

#hosted_checkout_specific_inputOnlinePayments::SDK::Domain::HostedCheckoutSpecificInput

Returns the current value of hosted_checkout_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def hosted_checkout_specific_input
  @hosted_checkout_specific_input
end

#mobile_payment_method_specific_inputOnlinePayments::SDK::Domain::MobilePaymentMethodHostedCheckoutSpecificInput

Returns the current value of mobile_payment_method_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def mobile_payment_method_specific_input
  @mobile_payment_method_specific_input
end

#orderOnlinePayments::SDK::Domain::Order

Returns the current value of order.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def order
  @order
end

Returns the current value of payment_link_order.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def payment_link_order
  @payment_link_order
end

Returns the current value of payment_link_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def payment_link_specific_input
  @payment_link_specific_input
end

#recipient_nameString

Returns the current value of recipient_name.

Returns:

  • (String)

    the current value of recipient_name



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def recipient_name
  @recipient_name
end

#redirect_payment_method_specific_inputOnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificInput

Returns the current value of redirect_payment_method_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def redirect_payment_method_specific_input
  @redirect_payment_method_specific_input
end

#sepa_direct_debit_payment_method_specific_inputOnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificInputBase

Returns the current value of sepa_direct_debit_payment_method_specific_input.

Returns:



30
31
32
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 30

def sepa_direct_debit_payment_method_specific_input
  @sepa_direct_debit_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 62

def from_hash(hash)
  super
  if hash.key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputBase.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  @description = hash['description'] if hash.key? 'description'
  @expiration_date = hash['expirationDate'] if hash.key? 'expirationDate'
  if hash.key? 'fraudFields'
    raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']] unless hash['fraudFields'].is_a? Hash
    @fraud_fields = OnlinePayments::SDK::Domain::FraudFields.new_from_hash(hash['fraudFields'])
  end
  if hash.key? 'hostedCheckoutSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificInput']] unless hash['hostedCheckoutSpecificInput'].is_a? Hash
    @hosted_checkout_specific_input = OnlinePayments::SDK::Domain::HostedCheckoutSpecificInput.new_from_hash(hash['hostedCheckoutSpecificInput'])
  end
  if hash.key? 'mobilePaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificInput']] unless hash['mobilePaymentMethodSpecificInput'].is_a? Hash
    @mobile_payment_method_specific_input = OnlinePayments::SDK::Domain::MobilePaymentMethodHostedCheckoutSpecificInput.new_from_hash(hash['mobilePaymentMethodSpecificInput'])
  end
  if hash.key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = OnlinePayments::SDK::Domain::Order.new_from_hash(hash['order'])
  end
  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
  if hash.key? 'paymentLinkSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentLinkSpecificInput']] unless hash['paymentLinkSpecificInput'].is_a? Hash
    @payment_link_specific_input = OnlinePayments::SDK::Domain::PaymentLinkSpecificInput.new_from_hash(hash['paymentLinkSpecificInput'])
  end
  @recipient_name = hash['recipientName'] if hash.key? 'recipientName'
  if hash.key? 'redirectPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificInput']] unless hash['redirectPaymentMethodSpecificInput'].is_a? Hash
    @redirect_payment_method_specific_input = OnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificInput.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
  end
  if hash.key? 'sepaDirectDebitPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificInput']] unless hash['sepaDirectDebitPaymentMethodSpecificInput'].is_a? Hash
    @sepa_direct_debit_payment_method_specific_input = OnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificInputBase.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
  end
end

#to_hHash

Returns:

  • (Hash)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 45

def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h if @card_payment_method_specific_input
  hash['description'] = @description unless @description.nil?
  hash['expirationDate'] = @expiration_date unless @expiration_date.nil?
  hash['fraudFields'] = @fraud_fields.to_h if @fraud_fields
  hash['hostedCheckoutSpecificInput'] = @hosted_checkout_specific_input.to_h if @hosted_checkout_specific_input
  hash['mobilePaymentMethodSpecificInput'] = @mobile_payment_method_specific_input.to_h if @mobile_payment_method_specific_input
  hash['order'] = @order.to_h if @order
  hash['paymentLinkOrder'] = @payment_link_order.to_h if @payment_link_order
  hash['paymentLinkSpecificInput'] = @payment_link_specific_input.to_h if @payment_link_specific_input
  hash['recipientName'] = @recipient_name unless @recipient_name.nil?
  hash['redirectPaymentMethodSpecificInput'] = @redirect_payment_method_specific_input.to_h if @redirect_payment_method_specific_input
  hash['sepaDirectDebitPaymentMethodSpecificInput'] = @sepa_direct_debit_payment_method_specific_input.to_h if @sepa_direct_debit_payment_method_specific_input
  hash
end