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

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/create_payment_link_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputOnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputBase



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#descriptionObject

Deprecated.

A note related to the created payment link. Use paymentLinkSpecificInput/description instead.



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def description
  @description
end

#expiration_dateObject

Deprecated.

The date after which the payment link will not be usable to complete the payment. The date sent cannot be more than 6 months in the future or a past date. It must also contain the UTC offset. Use paymentLinkSpecificInput/expirationDate instead.



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def expiration_date
  @expiration_date
end

#feedbacksOnlinePayments::SDK::Domain::Feedbacks



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def feedbacks
  @feedbacks
end

#fraud_fieldsOnlinePayments::SDK::Domain::FraudFields



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def fraud_fields
  @fraud_fields
end

#hosted_checkout_specific_inputOnlinePayments::SDK::Domain::HostedCheckoutSpecificInput



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def hosted_checkout_specific_input
  @hosted_checkout_specific_input
end


35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def is_reusable_link
  @is_reusable_link
end

#mobile_payment_method_specific_inputOnlinePayments::SDK::Domain::MobilePaymentMethodHostedCheckoutSpecificInput



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def mobile_payment_method_specific_input
  @mobile_payment_method_specific_input
end

#orderOnlinePayments::SDK::Domain::Order



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def order
  @order
end


35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def payment_link_order
  @payment_link_order
end


35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def payment_link_specific_input
  @payment_link_specific_input
end

#recipient_nameObject

Deprecated.

The payment link recipient name. Use paymentLinkSpecificInput/recipientName instead.



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def recipient_name
  @recipient_name
end

#redirect_payment_method_specific_inputOnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificInput



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def redirect_payment_method_specific_input
  @redirect_payment_method_specific_input
end

#sepa_direct_debit_payment_method_specific_inputOnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificInputBase



35
36
37
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 35

def sepa_direct_debit_payment_method_specific_input
  @sepa_direct_debit_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 88

def from_hash(hash)
  super
  if hash.has_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
  if hash.has_key? 'description'
    @description = hash['description']
  end
  if hash.has_key? 'expirationDate'
    @expiration_date = DateTime.parse(hash['expirationDate'])
  end
  if hash.has_key? 'feedbacks'
    raise TypeError, "value '%s' is not a Hash" % [hash['feedbacks']] unless hash['feedbacks'].is_a? Hash
    @feedbacks = OnlinePayments::SDK::Domain::Feedbacks.new_from_hash(hash['feedbacks'])
  end
  if hash.has_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.has_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.has_key? 'isReusableLink'
    @is_reusable_link = hash['isReusableLink']
  end
  if hash.has_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.has_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.has_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.has_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
  if hash.has_key? 'recipientName'
    @recipient_name = hash['recipientName']
  end
  if hash.has_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.has_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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/onlinepayments/sdk/domain/create_payment_link_request.rb', line 69

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