Class: OnlinePayments::SDK::Domain::PaymentLinkResponse
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PaymentLinkResponse
- Defined in:
- lib/onlinepayments/sdk/domain/payment_link_response.rb
Instance Attribute Summary collapse
-
#expiration_date ⇒ String
The current value of expiration_date.
-
#payment_id ⇒ String
The current value of payment_id.
-
#payment_link_events ⇒ Array<OnlinePayments::SDK::Domain::PaymentLinkEvent>
The current value of payment_link_events.
-
#payment_link_id ⇒ String
The current value of payment_link_id.
-
#payment_link_order ⇒ OnlinePayments::SDK::Domain::PaymentLinkOrderOutput
The current value of payment_link_order.
-
#recipient_name ⇒ String
The current value of recipient_name.
-
#redirection_url ⇒ String
The current value of redirection_url.
-
#status ⇒ String
The current value of status.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#expiration_date ⇒ String
Returns the current value of expiration_date.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def expiration_date @expiration_date end |
#payment_id ⇒ String
Returns the current value of payment_id.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def payment_id @payment_id end |
#payment_link_events ⇒ Array<OnlinePayments::SDK::Domain::PaymentLinkEvent>
Returns the current value of payment_link_events.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def payment_link_events @payment_link_events end |
#payment_link_id ⇒ String
Returns the current value of payment_link_id.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def payment_link_id @payment_link_id end |
#payment_link_order ⇒ OnlinePayments::SDK::Domain::PaymentLinkOrderOutput
Returns the current value of payment_link_order.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def payment_link_order @payment_link_order end |
#recipient_name ⇒ String
Returns the current value of recipient_name.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def recipient_name @recipient_name end |
#redirection_url ⇒ String
Returns the current value of redirection_url.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def redirection_url @redirection_url end |
#status ⇒ String
Returns the current value of status.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 19 def status @status end |
Instance Method Details
#from_hash(hash) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 43 def from_hash(hash) super @expiration_date = hash['expirationDate'] if hash.key? 'expirationDate' @payment_id = hash['paymentId'] if hash.key? 'paymentId' if hash.key? 'paymentLinkEvents' raise TypeError, "value '%s' is not an Array" % [hash['paymentLinkEvents']] unless hash['paymentLinkEvents'].is_a? Array @payment_link_events = [] hash['paymentLinkEvents'].each do |e| @payment_link_events << OnlinePayments::SDK::Domain::PaymentLinkEvent.new_from_hash(e) end end @payment_link_id = hash['paymentLinkId'] if hash.key? 'paymentLinkId' 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::PaymentLinkOrderOutput.new_from_hash(hash['paymentLinkOrder']) end @recipient_name = hash['recipientName'] if hash.key? 'recipientName' @redirection_url = hash['redirectionUrl'] if hash.key? 'redirectionUrl' @status = hash['status'] if hash.key? 'status' end |
#to_h ⇒ Hash
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 30 def to_h hash = super hash['expirationDate'] = @expiration_date unless @expiration_date.nil? hash['paymentId'] = @payment_id unless @payment_id.nil? hash['paymentLinkEvents'] = @payment_link_events.collect(&:to_h) if @payment_link_events hash['paymentLinkId'] = @payment_link_id unless @payment_link_id.nil? hash['paymentLinkOrder'] = @payment_link_order.to_h if @payment_link_order hash['recipientName'] = @recipient_name unless @recipient_name.nil? hash['redirectionUrl'] = @redirection_url unless @redirection_url.nil? hash['status'] = @status unless @status.nil? hash end |