Class: OnlinePayments::SDK::Domain::PaymentLinkResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentLinkResponse
- Defined in:
- lib/onlinepayments/sdk/domain/payment_link_response.rb
Instance Attribute Summary collapse
-
#expiration_date ⇒ DateTime
The current value of expiration_date.
-
#is_reusable_link ⇒ true/false
The current value of is_reusable_link.
-
#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.
-
#qr_code_base64 ⇒ String
The current value of qr_code_base64.
-
#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 DataObject
Instance Attribute Details
#expiration_date ⇒ DateTime
Returns the current value of expiration_date.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def expiration_date @expiration_date end |
#is_reusable_link ⇒ true/false
Returns the current value of is_reusable_link.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def is_reusable_link @is_reusable_link end |
#payment_id ⇒ String
Returns the current value of payment_id.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def payment_id @payment_id end |
#payment_link_events ⇒ Array<OnlinePayments::SDK::Domain::PaymentLinkEvent>
Returns the current value of payment_link_events.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def payment_link_events @payment_link_events end |
#payment_link_id ⇒ String
Returns the current value of payment_link_id.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def payment_link_id @payment_link_id end |
#payment_link_order ⇒ OnlinePayments::SDK::Domain::PaymentLinkOrderOutput
Returns the current value of payment_link_order.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def payment_link_order @payment_link_order end |
#qr_code_base64 ⇒ String
Returns the current value of qr_code_base64.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def qr_code_base64 @qr_code_base64 end |
#recipient_name ⇒ String
Returns the current value of recipient_name.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def recipient_name @recipient_name end |
#redirection_url ⇒ String
Returns the current value of redirection_url.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def redirection_url @redirection_url end |
#status ⇒ String
Returns the current value of status.
23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 23 def status @status end |
Instance Method Details
#from_hash(hash) ⇒ Object
61 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 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 61 def from_hash(hash) super if hash.has_key? 'expirationDate' @expiration_date = DateTime.parse(hash['expirationDate']) end if hash.has_key? 'isReusableLink' @is_reusable_link = hash['isReusableLink'] end if hash.has_key? 'paymentId' @payment_id = hash['paymentId'] end if hash.has_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 if hash.has_key? 'paymentLinkId' @payment_link_id = hash['paymentLinkId'] 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::PaymentLinkOrderOutput.new_from_hash(hash['paymentLinkOrder']) end if hash.has_key? 'qrCodeBase64' @qr_code_base64 = hash['qrCodeBase64'] end if hash.has_key? 'recipientName' @recipient_name = hash['recipientName'] end if hash.has_key? 'redirectionUrl' @redirection_url = hash['redirectionUrl'] end if hash.has_key? 'status' @status = hash['status'] end end |
#to_h ⇒ Hash
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/onlinepayments/sdk/domain/payment_link_response.rb', line 46 def to_h hash = super hash['expirationDate'] = @expiration_date.iso8601(3) unless @expiration_date.nil? hash['isReusableLink'] = @is_reusable_link unless @is_reusable_link.nil? hash['paymentId'] = @payment_id unless @payment_id.nil? hash['paymentLinkEvents'] = @payment_link_events.collect{|val| val.to_h} unless @payment_link_events.nil? hash['paymentLinkId'] = @payment_link_id unless @payment_link_id.nil? hash['paymentLinkOrder'] = @payment_link_order.to_h unless @payment_link_order.nil? hash['qrCodeBase64'] = @qr_code_base64 unless @qr_code_base64.nil? hash['recipientName'] = @recipient_name unless @recipient_name.nil? hash['redirectionUrl'] = @redirection_url unless @redirection_url.nil? hash['status'] = @status unless @status.nil? hash end |