Class: SplititWebApiV4::PaymentLinkRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SplititWebApiV4::PaymentLinkRequest
- Defined in:
- lib/splitit_web_api_v4/models/payment_link_request.rb
Overview
PaymentLinkRequest Model.
Instance Attribute Summary collapse
-
#amount ⇒ String
TODO: Write general description for this method.
-
#checkout_url_validity ⇒ DateTime
TODO: Write general description for this method.
-
#currency ⇒ String
TODO: Write general description for this method.
-
#merchant_details ⇒ OffersMerchantDetails
TODO: Write general description for this method.
-
#merchant_order_reference ⇒ String
TODO: Write general description for this method.
-
#metadata ⇒ Array[MetadataItem]
TODO: Write general description for this method.
-
#processing_data ⇒ ProcessingData
TODO: Write general description for this method.
-
#purchase_method ⇒ PurchaseMethod
TODO: Write general description for this method.
-
#redirect_urls ⇒ RedirectUrls
TODO: Write general description for this method.
-
#shopper_details ⇒ OffersShopperDetails
TODO: Write general description for this method.
-
#three_ds ⇒ ThreeDsExecute
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(amount:, currency:, purchase_method:, shopper_details:, merchant_order_reference: SKIP, merchant_details: SKIP, checkout_url_validity: SKIP, metadata: SKIP, redirect_urls: SKIP, processing_data: SKIP, three_ds: SKIP, additional_properties: nil) ⇒ PaymentLinkRequest
constructor
A new instance of PaymentLinkRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_checkout_url_validity ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(amount:, currency:, purchase_method:, shopper_details:, merchant_order_reference: SKIP, merchant_details: SKIP, checkout_url_validity: SKIP, metadata: SKIP, redirect_urls: SKIP, processing_data: SKIP, three_ds: SKIP, additional_properties: nil) ⇒ PaymentLinkRequest
Returns a new instance of PaymentLinkRequest.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 92 def initialize(amount:, currency:, purchase_method:, shopper_details:, merchant_order_reference: SKIP, merchant_details: SKIP, checkout_url_validity: SKIP, metadata: SKIP, redirect_urls: SKIP, processing_data: SKIP, three_ds: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @amount = amount @currency = currency @merchant_order_reference = merchant_order_reference unless merchant_order_reference == SKIP @purchase_method = purchase_method @shopper_details = shopper_details @merchant_details = merchant_details unless merchant_details == SKIP @checkout_url_validity = checkout_url_validity unless checkout_url_validity == SKIP @metadata = unless == SKIP @redirect_urls = redirect_urls unless redirect_urls == SKIP @processing_data = processing_data unless processing_data == SKIP @three_ds = three_ds unless three_ds == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 15 def amount @amount end |
#checkout_url_validity ⇒ DateTime
TODO: Write general description for this method
39 40 41 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 39 def checkout_url_validity @checkout_url_validity end |
#currency ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 19 def currency @currency end |
#merchant_details ⇒ OffersMerchantDetails
TODO: Write general description for this method
35 36 37 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 35 def merchant_details @merchant_details end |
#merchant_order_reference ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 23 def merchant_order_reference @merchant_order_reference end |
#metadata ⇒ Array[MetadataItem]
TODO: Write general description for this method
43 44 45 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 43 def @metadata end |
#processing_data ⇒ ProcessingData
TODO: Write general description for this method
51 52 53 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 51 def processing_data @processing_data end |
#purchase_method ⇒ PurchaseMethod
TODO: Write general description for this method
27 28 29 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 27 def purchase_method @purchase_method end |
#redirect_urls ⇒ RedirectUrls
TODO: Write general description for this method
47 48 49 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 47 def redirect_urls @redirect_urls end |
#shopper_details ⇒ OffersShopperDetails
TODO: Write general description for this method
31 32 33 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 31 def shopper_details @shopper_details end |
#three_ds ⇒ ThreeDsExecute
TODO: Write general description for this method
55 56 57 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 55 def three_ds @three_ds end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 115 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash.key?('Amount') ? hash['Amount'] : nil currency = hash.key?('Currency') ? hash['Currency'] : nil purchase_method = hash.key?('PurchaseMethod') ? hash['PurchaseMethod'] : nil shopper_details = OffersShopperDetails.from_hash(hash['ShopperDetails']) if hash['ShopperDetails'] merchant_order_reference = hash.key?('MerchantOrderReference') ? hash['MerchantOrderReference'] : SKIP merchant_details = OffersMerchantDetails.from_hash(hash['MerchantDetails']) if hash['MerchantDetails'] checkout_url_validity = if hash.key?('CheckoutUrlValidity') (DateTimeHelper.from_rfc3339(hash['CheckoutUrlValidity']) if hash['CheckoutUrlValidity']) else SKIP end # Parameter is an array, so we need to iterate through it = nil unless hash['Metadata'].nil? = [] hash['Metadata'].each do |structure| << (MetadataItem.from_hash(structure) if structure) end end = SKIP unless hash.key?('Metadata') redirect_urls = RedirectUrls.from_hash(hash['RedirectUrls']) if hash['RedirectUrls'] processing_data = ProcessingData.from_hash(hash['ProcessingData']) if hash['ProcessingData'] three_ds = ThreeDsExecute.from_hash(hash['ThreeDS']) if hash['ThreeDS'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PaymentLinkRequest.new(amount: amount, currency: currency, purchase_method: purchase_method, shopper_details: shopper_details, merchant_order_reference: merchant_order_reference, merchant_details: merchant_details, checkout_url_validity: checkout_url_validity, metadata: , redirect_urls: redirect_urls, processing_data: processing_data, three_ds: three_ds, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'Amount' @_hash['currency'] = 'Currency' @_hash['merchant_order_reference'] = 'MerchantOrderReference' @_hash['purchase_method'] = 'PurchaseMethod' @_hash['shopper_details'] = 'ShopperDetails' @_hash['merchant_details'] = 'MerchantDetails' @_hash['checkout_url_validity'] = 'CheckoutUrlValidity' @_hash['metadata'] = 'Metadata' @_hash['redirect_urls'] = 'RedirectUrls' @_hash['processing_data'] = 'ProcessingData' @_hash['three_ds'] = 'ThreeDS' @_hash end |
.nullables ⇒ Object
An array for nullable fields
88 89 90 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 88 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 75 def self.optionals %w[ merchant_order_reference merchant_details checkout_url_validity metadata redirect_urls processing_data three_ds ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
186 187 188 189 190 191 192 193 194 195 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 186 def inspect class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount.inspect}, currency: #{@currency.inspect},"\ " merchant_order_reference: #{@merchant_order_reference.inspect}, purchase_method:"\ " #{@purchase_method.inspect}, shopper_details: #{@shopper_details.inspect},"\ " merchant_details: #{@merchant_details.inspect}, checkout_url_validity:"\ " #{@checkout_url_validity.inspect}, metadata: #{@metadata.inspect}, redirect_urls:"\ " #{@redirect_urls.inspect}, processing_data: #{@processing_data.inspect}, three_ds:"\ " #{@three_ds.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_checkout_url_validity ⇒ Object
170 171 172 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 170 def to_custom_checkout_url_validity DateTimeHelper.to_rfc3339(checkout_url_validity) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
175 176 177 178 179 180 181 182 183 |
# File 'lib/splitit_web_api_v4/models/payment_link_request.rb', line 175 def to_s class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount}, currency: #{@currency}, merchant_order_reference:"\ " #{@merchant_order_reference}, purchase_method: #{@purchase_method}, shopper_details:"\ " #{@shopper_details}, merchant_details: #{@merchant_details}, checkout_url_validity:"\ " #{@checkout_url_validity}, metadata: #{@metadata}, redirect_urls: #{@redirect_urls},"\ " processing_data: #{@processing_data}, three_ds: #{@three_ds}, additional_properties:"\ " #{@additional_properties}>" end |