hamza-payments-query-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +136 -0
- data/lib/payments/api_helper.rb +10 -0
- data/lib/payments/client.rb +78 -0
- data/lib/payments/configuration.rb +145 -0
- data/lib/payments/controllers/base_controller.rb +60 -0
- data/lib/payments/controllers/m3_ds_actions_controller.rb +97 -0
- data/lib/payments/controllers/manage_payments_controller.rb +272 -0
- data/lib/payments/controllers/payment_controller.rb +51 -0
- data/lib/payments/controllers/payment_queries_controller.rb +134 -0
- data/lib/payments/exceptions/api_exception.rb +21 -0
- data/lib/payments/exceptions/error_response_exception.rb +51 -0
- data/lib/payments/exceptions/header_error_response_exception.rb +58 -0
- data/lib/payments/exceptions/pq_querybydaterange400_response_exception.rb +51 -0
- data/lib/payments/exceptions/pq_querybypaymentid404_response_error_exception.rb +51 -0
- data/lib/payments/exceptions/pq_queryhistoricalpayments400_response_exception.rb +51 -0
- data/lib/payments/exceptions/validation_error_response_exception.rb +58 -0
- data/lib/payments/http/auth/basic_auth.rb +50 -0
- data/lib/payments/http/http_call_back.rb +10 -0
- data/lib/payments/http/http_method_enum.rb +10 -0
- data/lib/payments/http/http_request.rb +10 -0
- data/lib/payments/http/http_response.rb +10 -0
- data/lib/payments/http/proxy_settings.rb +13 -0
- data/lib/payments/models/accept_enum.rb +21 -0
- data/lib/payments/models/account_history.rb +110 -0
- data/lib/payments/models/account_updater_message1_enum.rb +44 -0
- data/lib/payments/models/account_updater_message_enum.rb +41 -0
- data/lib/payments/models/advice.rb +62 -0
- data/lib/payments/models/applepay_payments_instruction.rb +151 -0
- data/lib/payments/models/authentication.rb +161 -0
- data/lib/payments/models/authorization_action_list.rb +90 -0
- data/lib/payments/models/authorization_failed.rb +103 -0
- data/lib/payments/models/authorization_refused.rb +124 -0
- data/lib/payments/models/authorization_requested.rb +94 -0
- data/lib/payments/models/authorization_succeeded.rb +104 -0
- data/lib/payments/models/authorization_timed_out.rb +94 -0
- data/lib/payments/models/authorization_type1_enum.rb +23 -0
- data/lib/payments/models/authorization_type_enum.rb +23 -0
- data/lib/payments/models/avs_not_matched_enum.rb +25 -0
- data/lib/payments/models/base_model.rb +110 -0
- data/lib/payments/models/billing_address.rb +147 -0
- data/lib/payments/models/browser_color_depth_enum.rb +41 -0
- data/lib/payments/models/cancel_response.rb +71 -0
- data/lib/payments/models/cancellation.rb +88 -0
- data/lib/payments/models/cancellation_failed.rb +94 -0
- data/lib/payments/models/cancellation_request_submitted.rb +94 -0
- data/lib/payments/models/cancellation_requested.rb +94 -0
- data/lib/payments/models/cancellation_timed_out.rb +94 -0
- data/lib/payments/models/card.rb +159 -0
- data/lib/payments/models/card1.rb +106 -0
- data/lib/payments/models/card3.rb +72 -0
- data/lib/payments/models/card_authorized_payment_response.rb +195 -0
- data/lib/payments/models/card_payment_instrument.rb +76 -0
- data/lib/payments/models/card_payments_instruction.rb +164 -0
- data/lib/payments/models/category_enum.rb +23 -0
- data/lib/payments/models/challenge.rb +100 -0
- data/lib/payments/models/challenge_info.rb +91 -0
- data/lib/payments/models/challenge_response201.rb +75 -0
- data/lib/payments/models/challenge_response202.rb +62 -0
- data/lib/payments/models/challenged_action_list.rb +65 -0
- data/lib/payments/models/challenged_response.rb +96 -0
- data/lib/payments/models/channel1_enum.rb +27 -0
- data/lib/payments/models/channel_enum.rb +24 -0
- data/lib/payments/models/conflict_payment_instrument.rb +104 -0
- data/lib/payments/models/content_type_enum.rb +20 -0
- data/lib/payments/models/custom.rb +241 -0
- data/lib/payments/models/customer.rb +146 -0
- data/lib/payments/models/customer_agreement.rb +120 -0
- data/lib/payments/models/cvc_not_matched_enum.rb +24 -0
- data/lib/payments/models/detail_enum.rb +23 -0
- data/lib/payments/models/device_data.rb +200 -0
- data/lib/payments/models/device_data_collection.rb +79 -0
- data/lib/payments/models/device_data_request.rb +71 -0
- data/lib/payments/models/device_data_required_action_list.rb +66 -0
- data/lib/payments/models/device_data_required_response.rb +89 -0
- data/lib/payments/models/device_data_response201.rb +95 -0
- data/lib/payments/models/embedded.rb +71 -0
- data/lib/payments/models/embedded1.rb +71 -0
- data/lib/payments/models/error.rb +81 -0
- data/lib/payments/models/exemption.rb +106 -0
- data/lib/payments/models/expiry_date.rb +90 -0
- data/lib/payments/models/expiry_date1.rb +84 -0
- data/lib/payments/models/fraud.rb +73 -0
- data/lib/payments/models/fraud_high_risk_response.rb +88 -0
- data/lib/payments/models/funding_type_enum.rb +32 -0
- data/lib/payments/models/googlepay_payments_instruction.rb +151 -0
- data/lib/payments/models/identifier_type_enum.rb +26 -0
- data/lib/payments/models/installment_plan.rb +76 -0
- data/lib/payments/models/installment_type_enum.rb +26 -0
- data/lib/payments/models/issuer.rb +63 -0
- data/lib/payments/models/issuer1.rb +76 -0
- data/lib/payments/models/issuer_response_enum.rb +23 -0
- data/lib/payments/models/last_event_enum.rb +95 -0
- data/lib/payments/models/links.rb +123 -0
- data/lib/payments/models/links1.rb +70 -0
- data/lib/payments/models/links2.rb +60 -0
- data/lib/payments/models/links3.rb +97 -0
- data/lib/payments/models/merchant.rb +88 -0
- data/lib/payments/models/message_enum.rb +34 -0
- data/lib/payments/models/method_enum.rb +38 -0
- data/lib/payments/models/mnext.rb +62 -0
- data/lib/payments/models/mself.rb +62 -0
- data/lib/payments/models/name_enum.rb +51 -0
- data/lib/payments/models/narrative.rb +86 -0
- data/lib/payments/models/narrative1.rb +87 -0
- data/lib/payments/models/narrative2.rb +71 -0
- data/lib/payments/models/number.rb +85 -0
- data/lib/payments/models/number3.rb +62 -0
- data/lib/payments/models/outcome16_enum.rb +21 -0
- data/lib/payments/models/outcome17_enum.rb +21 -0
- data/lib/payments/models/outcome6_enum.rb +42 -0
- data/lib/payments/models/outcome7_enum.rb +26 -0
- data/lib/payments/models/outcome_enum.rb +50 -0
- data/lib/payments/models/partial_refund_action_list.rb +64 -0
- data/lib/payments/models/partial_refund_response.rb +81 -0
- data/lib/payments/models/partial_settle_action_list.rb +102 -0
- data/lib/payments/models/partial_settle_response.rb +81 -0
- data/lib/payments/models/payment.rb +192 -0
- data/lib/payments/models/payment1.rb +86 -0
- data/lib/payments/models/payment_instrument.rb +62 -0
- data/lib/payments/models/payment_instrument4.rb +81 -0
- data/lib/payments/models/payment_instrument6.rb +71 -0
- data/lib/payments/models/payment_instrument7.rb +171 -0
- data/lib/payments/models/payment_refused_response.rb +187 -0
- data/lib/payments/models/payment_request.rb +96 -0
- data/lib/payments/models/payments_action_cancel.rb +71 -0
- data/lib/payments/models/payments_action_complete3ds_challenge.rb +72 -0
- data/lib/payments/models/payments_action_partial_refund.rb +71 -0
- data/lib/payments/models/payments_action_partial_settle.rb +73 -0
- data/lib/payments/models/payments_action_refund.rb +71 -0
- data/lib/payments/models/payments_action_settle.rb +71 -0
- data/lib/payments/models/payments_action_supply3ds_device_data.rb +73 -0
- data/lib/payments/models/payments_bank_account.rb +119 -0
- data/lib/payments/models/payments_cancel.rb +72 -0
- data/lib/payments/models/payments_card_account.rb +69 -0
- data/lib/payments/models/payments_card_on_file_customer_agreement.rb +85 -0
- data/lib/payments/models/payments_card_plain_payment_instrument.rb +149 -0
- data/lib/payments/models/payments_customer_agreement.rb +79 -0
- data/lib/payments/models/payments_email_account.rb +69 -0
- data/lib/payments/models/payments_events.rb +72 -0
- data/lib/payments/models/payments_exemption.rb +102 -0
- data/lib/payments/models/payments_fraud.rb +107 -0
- data/lib/payments/models/payments_funds_recipient.rb +139 -0
- data/lib/payments/models/payments_funds_sender.rb +120 -0
- data/lib/payments/models/payments_funds_transfer.rb +108 -0
- data/lib/payments/models/payments_gift_cards_purchase.rb +81 -0
- data/lib/payments/models/payments_installment_customer_agreement.rb +133 -0
- data/lib/payments/models/payments_instruction.rb +309 -0
- data/lib/payments/models/payments_link.rb +62 -0
- data/lib/payments/models/payments_network_token_payment_instrument.rb +126 -0
- data/lib/payments/models/payments_partial_refund_request.rb +68 -0
- data/lib/payments/models/payments_partial_settle.rb +72 -0
- data/lib/payments/models/payments_partial_settle_request.rb +81 -0
- data/lib/payments/models/payments_payment_facilitator.rb +88 -0
- data/lib/payments/models/payments_payment_instrument.rb +78 -0
- data/lib/payments/models/payments_phone_account.rb +69 -0
- data/lib/payments/models/payments_recipient.rb +110 -0
- data/lib/payments/models/payments_recipient_account.rb +81 -0
- data/lib/payments/models/payments_recipient_address.rb +72 -0
- data/lib/payments/models/payments_response.rb +69 -0
- data/lib/payments/models/payments_response202.rb +90 -0
- data/lib/payments/models/payments_response_payment_instrument.rb +158 -0
- data/lib/payments/models/payments_sequence.rb +69 -0
- data/lib/payments/models/payments_settle.rb +72 -0
- data/lib/payments/models/payments_shipping_address.rb +148 -0
- data/lib/payments/models/payments_social_network_account.rb +71 -0
- data/lib/payments/models/payments_sub_merchant.rb +108 -0
- data/lib/payments/models/payments_sub_merchant_address.rb +99 -0
- data/lib/payments/models/payments_subscription_customer_agreement.rb +106 -0
- data/lib/payments/models/payments_three_ds.rb +217 -0
- data/lib/payments/models/payments_transfer_address.rb +112 -0
- data/lib/payments/models/payments_unscheduled_customer_agreement.rb +87 -0
- data/lib/payments/models/payments_wallet_account.rb +70 -0
- data/lib/payments/models/placement_enum.rb +21 -0
- data/lib/payments/models/pq_querybydaterange200_response.rb +68 -0
- data/lib/payments/models/pq_querybypaymentid200_response.rb +230 -0
- data/lib/payments/models/pq_queryhistoricalpayments200_response.rb +72 -0
- data/lib/payments/models/preference_enum.rb +29 -0
- data/lib/payments/models/preferred_card_brand_enum.rb +51 -0
- data/lib/payments/models/purpose_enum.rb +78 -0
- data/lib/payments/models/query_action_list.rb +114 -0
- data/lib/payments/models/query_events_response.rb +71 -0
- data/lib/payments/models/reason_enum.rb +50 -0
- data/lib/payments/models/refund_failed.rb +94 -0
- data/lib/payments/models/refund_request_submitted.rb +94 -0
- data/lib/payments/models/refund_requested.rb +124 -0
- data/lib/payments/models/refund_response.rb +71 -0
- data/lib/payments/models/refund_timed_out.rb +94 -0
- data/lib/payments/models/result_enum.rb +29 -0
- data/lib/payments/models/reversal_failed.rb +94 -0
- data/lib/payments/models/reversal_request_submitted.rb +94 -0
- data/lib/payments/models/reversal_requested.rb +103 -0
- data/lib/payments/models/reversal_timed_out.rb +94 -0
- data/lib/payments/models/risk_enum.rb +29 -0
- data/lib/payments/models/risk_factor.rb +82 -0
- data/lib/payments/models/routing.rb +74 -0
- data/lib/payments/models/sale_failed.rb +103 -0
- data/lib/payments/models/sale_refused.rb +124 -0
- data/lib/payments/models/sale_requested.rb +94 -0
- data/lib/payments/models/sale_succeeded.rb +104 -0
- data/lib/payments/models/sale_timed_out.rb +94 -0
- data/lib/payments/models/scheme.rb +75 -0
- data/lib/payments/models/self1.rb +72 -0
- data/lib/payments/models/self2.rb +62 -0
- data/lib/payments/models/self3.rb +62 -0
- data/lib/payments/models/sent_for_cancellation_response.rb +185 -0
- data/lib/payments/models/sent_for_settlement_action_list.rb +76 -0
- data/lib/payments/models/sent_for_settlement_response.rb +195 -0
- data/lib/payments/models/session_payment_instrument.rb +119 -0
- data/lib/payments/models/settle_action_list.rb +76 -0
- data/lib/payments/models/settle_response.rb +81 -0
- data/lib/payments/models/settlement.rb +88 -0
- data/lib/payments/models/settlement_failed.rb +94 -0
- data/lib/payments/models/settlement_request_submitted.rb +94 -0
- data/lib/payments/models/settlement_requested.rb +125 -0
- data/lib/payments/models/settlement_timed_out.rb +94 -0
- data/lib/payments/models/shipping.rb +130 -0
- data/lib/payments/models/stored_card_usage1_enum.rb +24 -0
- data/lib/payments/models/stored_card_usage_enum.rb +24 -0
- data/lib/payments/models/time_frame_enum.rb +29 -0
- data/lib/payments/models/token.rb +168 -0
- data/lib/payments/models/token_creation.rb +95 -0
- data/lib/payments/models/token_payment_instrument.rb +118 -0
- data/lib/payments/models/token_response_conflicts.rb +90 -0
- data/lib/payments/models/transaction_history.rb +127 -0
- data/lib/payments/models/transaction_type1_enum.rb +26 -0
- data/lib/payments/models/transaction_type_enum.rb +26 -0
- data/lib/payments/models/type10_enum.rb +23 -0
- data/lib/payments/models/type12_enum.rb +35 -0
- data/lib/payments/models/type1_enum.rb +26 -0
- data/lib/payments/models/type2_enum.rb +23 -0
- data/lib/payments/models/type3_enum.rb +20 -0
- data/lib/payments/models/type4_enum.rb +20 -0
- data/lib/payments/models/type5_enum.rb +41 -0
- data/lib/payments/models/type6_enum.rb +29 -0
- data/lib/payments/models/type7_enum.rb +23 -0
- data/lib/payments/models/type8_enum.rb +23 -0
- data/lib/payments/models/type9_enum.rb +35 -0
- data/lib/payments/models/type_enum.rb +23 -0
- data/lib/payments/models/unsuccessful_authentication_response.rb +76 -0
- data/lib/payments/models/updated_payment_instrument.rb +159 -0
- data/lib/payments/models/updated_payment_instrument1.rb +93 -0
- data/lib/payments/models/user_type_enum.rb +35 -0
- data/lib/payments/models/value.rb +94 -0
- data/lib/payments/models/value1.rb +91 -0
- data/lib/payments/models/value2.rb +91 -0
- data/lib/payments/models/value3.rb +91 -0
- data/lib/payments/models/value4.rb +91 -0
- data/lib/payments/models/verification.rb +173 -0
- data/lib/payments/models/wallet_payment_instrument.rb +100 -0
- data/lib/payments/models/window_size_enum.rb +34 -0
- data/lib/payments/models/wp_api_version_enum.rb +20 -0
- data/lib/payments/utilities/date_time_helper.rb +11 -0
- data/lib/payments/utilities/file_wrapper.rb +28 -0
- data/lib/payments/utilities/union_type_lookup.rb +78 -0
- data/lib/payments.rb +280 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_payment_controller.rb +161 -0
- data/test/controllers/test_payment_queries_controller.rb +68 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +374 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# An object containing device data for 3DS & Fraud assessment.
|
|
8
|
+
class DeviceData < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Used by the issuer to check if the customer's browser is compatible with
|
|
13
|
+
# the issuer 3DS challenge display.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :accept_header
|
|
16
|
+
|
|
17
|
+
# Used by issuers as part of risk analysis and correctly displaying the
|
|
18
|
+
# challenge. Must conform to RFC 7321.
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_accessor :user_agent_header
|
|
21
|
+
|
|
22
|
+
# Your customer's browser language that can be used by the issuer in risk
|
|
23
|
+
# analysis. Must conform to the language tags defined by IETF. E.g. en-GB,
|
|
24
|
+
# fr-FR.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :browser_language
|
|
27
|
+
|
|
28
|
+
# Defines whether Java is enabled on your customers browser.
|
|
29
|
+
# @return [TrueClass | FalseClass]
|
|
30
|
+
attr_accessor :browser_java_enabled
|
|
31
|
+
|
|
32
|
+
# The color depth of your customers browser
|
|
33
|
+
# @return [BrowserColorDepthEnum]
|
|
34
|
+
attr_accessor :browser_color_depth
|
|
35
|
+
|
|
36
|
+
# Defines the pixel height of the customers browser.
|
|
37
|
+
# @return [Integer]
|
|
38
|
+
attr_accessor :browser_screen_height
|
|
39
|
+
|
|
40
|
+
# Defines the pixel width of the customers browser.
|
|
41
|
+
# @return [Integer]
|
|
42
|
+
attr_accessor :browser_screen_width
|
|
43
|
+
|
|
44
|
+
# Time zone offset in minutes between UTC and your customer's browser local
|
|
45
|
+
# time.
|
|
46
|
+
# Example time zone offset values in minutes:
|
|
47
|
+
# If UTC -5 hours:
|
|
48
|
+
# `300`
|
|
49
|
+
# `+300`
|
|
50
|
+
# If UTC +5 hours:
|
|
51
|
+
# `-300`
|
|
52
|
+
# @return [String]
|
|
53
|
+
attr_accessor :time_zone
|
|
54
|
+
|
|
55
|
+
# Defines whether Javascript is enabled on your customers browser.
|
|
56
|
+
# @return [TrueClass | FalseClass]
|
|
57
|
+
attr_accessor :browser_javascript_enabled
|
|
58
|
+
|
|
59
|
+
# Determines the channel that the transaction came through. `native` should
|
|
60
|
+
# only be set if using the Cardinal 3DS SDK (iOS/Android)
|
|
61
|
+
# @return [ChannelEnum]
|
|
62
|
+
attr_accessor :channel
|
|
63
|
+
|
|
64
|
+
# A mapping from model property names to API property names.
|
|
65
|
+
def self.names
|
|
66
|
+
@_hash = {} if @_hash.nil?
|
|
67
|
+
@_hash['accept_header'] = 'acceptHeader'
|
|
68
|
+
@_hash['user_agent_header'] = 'userAgentHeader'
|
|
69
|
+
@_hash['browser_language'] = 'browserLanguage'
|
|
70
|
+
@_hash['browser_java_enabled'] = 'browserJavaEnabled'
|
|
71
|
+
@_hash['browser_color_depth'] = 'browserColorDepth'
|
|
72
|
+
@_hash['browser_screen_height'] = 'browserScreenHeight'
|
|
73
|
+
@_hash['browser_screen_width'] = 'browserScreenWidth'
|
|
74
|
+
@_hash['time_zone'] = 'timeZone'
|
|
75
|
+
@_hash['browser_javascript_enabled'] = 'browserJavascriptEnabled'
|
|
76
|
+
@_hash['channel'] = 'channel'
|
|
77
|
+
@_hash
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# An array for optional fields
|
|
81
|
+
def self.optionals
|
|
82
|
+
%w[
|
|
83
|
+
browser_language
|
|
84
|
+
browser_java_enabled
|
|
85
|
+
browser_color_depth
|
|
86
|
+
browser_screen_height
|
|
87
|
+
browser_screen_width
|
|
88
|
+
time_zone
|
|
89
|
+
browser_javascript_enabled
|
|
90
|
+
channel
|
|
91
|
+
]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# An array for nullable fields
|
|
95
|
+
def self.nullables
|
|
96
|
+
[]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def initialize(accept_header = nil, user_agent_header = nil,
|
|
100
|
+
browser_language = SKIP, browser_java_enabled = SKIP,
|
|
101
|
+
browser_color_depth = SKIP, browser_screen_height = SKIP,
|
|
102
|
+
browser_screen_width = SKIP, time_zone = SKIP,
|
|
103
|
+
browser_javascript_enabled = SKIP, channel = SKIP)
|
|
104
|
+
@accept_header = accept_header
|
|
105
|
+
@user_agent_header = user_agent_header
|
|
106
|
+
@browser_language = browser_language unless browser_language == SKIP
|
|
107
|
+
@browser_java_enabled = browser_java_enabled unless browser_java_enabled == SKIP
|
|
108
|
+
@browser_color_depth = browser_color_depth unless browser_color_depth == SKIP
|
|
109
|
+
@browser_screen_height = browser_screen_height unless browser_screen_height == SKIP
|
|
110
|
+
@browser_screen_width = browser_screen_width unless browser_screen_width == SKIP
|
|
111
|
+
@time_zone = time_zone unless time_zone == SKIP
|
|
112
|
+
unless browser_javascript_enabled == SKIP
|
|
113
|
+
@browser_javascript_enabled =
|
|
114
|
+
browser_javascript_enabled
|
|
115
|
+
end
|
|
116
|
+
@channel = channel unless channel == SKIP
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Creates an instance of the object from a hash.
|
|
120
|
+
def self.from_hash(hash)
|
|
121
|
+
return nil unless hash
|
|
122
|
+
|
|
123
|
+
# Extract variables from the hash.
|
|
124
|
+
accept_header = hash.key?('acceptHeader') ? hash['acceptHeader'] : nil
|
|
125
|
+
user_agent_header =
|
|
126
|
+
hash.key?('userAgentHeader') ? hash['userAgentHeader'] : nil
|
|
127
|
+
browser_language =
|
|
128
|
+
hash.key?('browserLanguage') ? hash['browserLanguage'] : SKIP
|
|
129
|
+
browser_java_enabled =
|
|
130
|
+
hash.key?('browserJavaEnabled') ? hash['browserJavaEnabled'] : SKIP
|
|
131
|
+
browser_color_depth =
|
|
132
|
+
hash.key?('browserColorDepth') ? hash['browserColorDepth'] : SKIP
|
|
133
|
+
browser_screen_height = Number.from_hash(hash['browserScreenHeight']) if
|
|
134
|
+
hash['browserScreenHeight']
|
|
135
|
+
browser_screen_width = Number.from_hash(hash['browserScreenWidth']) if
|
|
136
|
+
hash['browserScreenWidth']
|
|
137
|
+
time_zone = hash.key?('timeZone') ? hash['timeZone'] : SKIP
|
|
138
|
+
browser_javascript_enabled =
|
|
139
|
+
hash.key?('browserJavascriptEnabled') ? hash['browserJavascriptEnabled'] : SKIP
|
|
140
|
+
channel = hash.key?('channel') ? hash['channel'] : SKIP
|
|
141
|
+
|
|
142
|
+
# Create object from extracted values.
|
|
143
|
+
DeviceData.new(accept_header,
|
|
144
|
+
user_agent_header,
|
|
145
|
+
browser_language,
|
|
146
|
+
browser_java_enabled,
|
|
147
|
+
browser_color_depth,
|
|
148
|
+
browser_screen_height,
|
|
149
|
+
browser_screen_width,
|
|
150
|
+
time_zone,
|
|
151
|
+
browser_javascript_enabled,
|
|
152
|
+
channel)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Validates an instance of the object from a given value.
|
|
156
|
+
# @param [DeviceData | Hash] The value against the validation is performed.
|
|
157
|
+
def self.validate(value)
|
|
158
|
+
if value.instance_of? self
|
|
159
|
+
return (
|
|
160
|
+
APIHelper.valid_type?(value.accept_header,
|
|
161
|
+
->(val) { val.instance_of? String }) and
|
|
162
|
+
APIHelper.valid_type?(value.user_agent_header,
|
|
163
|
+
->(val) { val.instance_of? String })
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
return false unless value.instance_of? Hash
|
|
168
|
+
|
|
169
|
+
(
|
|
170
|
+
APIHelper.valid_type?(value['acceptHeader'],
|
|
171
|
+
->(val) { val.instance_of? String }) and
|
|
172
|
+
APIHelper.valid_type?(value['userAgentHeader'],
|
|
173
|
+
->(val) { val.instance_of? String })
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Provides a human-readable string representation of the object.
|
|
178
|
+
def to_s
|
|
179
|
+
class_name = self.class.name.split('::').last
|
|
180
|
+
"<#{class_name} accept_header: #{@accept_header}, user_agent_header: #{@user_agent_header},"\
|
|
181
|
+
" browser_language: #{@browser_language}, browser_java_enabled: #{@browser_java_enabled},"\
|
|
182
|
+
" browser_color_depth: #{@browser_color_depth}, browser_screen_height:"\
|
|
183
|
+
" #{@browser_screen_height}, browser_screen_width: #{@browser_screen_width}, time_zone:"\
|
|
184
|
+
" #{@time_zone}, browser_javascript_enabled: #{@browser_javascript_enabled}, channel:"\
|
|
185
|
+
" #{@channel}>"
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
189
|
+
def inspect
|
|
190
|
+
class_name = self.class.name.split('::').last
|
|
191
|
+
"<#{class_name} accept_header: #{@accept_header.inspect}, user_agent_header:"\
|
|
192
|
+
" #{@user_agent_header.inspect}, browser_language: #{@browser_language.inspect},"\
|
|
193
|
+
" browser_java_enabled: #{@browser_java_enabled.inspect}, browser_color_depth:"\
|
|
194
|
+
" #{@browser_color_depth.inspect}, browser_screen_height: #{@browser_screen_height.inspect},"\
|
|
195
|
+
" browser_screen_width: #{@browser_screen_width.inspect}, time_zone: #{@time_zone.inspect},"\
|
|
196
|
+
" browser_javascript_enabled: #{@browser_javascript_enabled.inspect}, channel:"\
|
|
197
|
+
" #{@channel.inspect}>"
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# DeviceDataCollection Model.
|
|
8
|
+
class DeviceDataCollection < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# A digitally signed token that contains additional details required for
|
|
13
|
+
# DDC.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :jwt
|
|
16
|
+
|
|
17
|
+
# A `POST` action on the DDC form. Used to redirect to the issuers DDC page.
|
|
18
|
+
# This URL can could change so should not be hardcoded.
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_accessor :url
|
|
21
|
+
|
|
22
|
+
# First six digits of the card number (Bank Identification Number), used as
|
|
23
|
+
# part of DDC.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :bin
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['jwt'] = 'jwt'
|
|
31
|
+
@_hash['url'] = 'url'
|
|
32
|
+
@_hash['bin'] = 'bin'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# An array for nullable fields
|
|
42
|
+
def self.nullables
|
|
43
|
+
[]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(jwt = nil, url = nil, bin = nil)
|
|
47
|
+
@jwt = jwt
|
|
48
|
+
@url = url
|
|
49
|
+
@bin = bin
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Creates an instance of the object from a hash.
|
|
53
|
+
def self.from_hash(hash)
|
|
54
|
+
return nil unless hash
|
|
55
|
+
|
|
56
|
+
# Extract variables from the hash.
|
|
57
|
+
jwt = hash.key?('jwt') ? hash['jwt'] : nil
|
|
58
|
+
url = hash.key?('url') ? hash['url'] : nil
|
|
59
|
+
bin = hash.key?('bin') ? hash['bin'] : nil
|
|
60
|
+
|
|
61
|
+
# Create object from extracted values.
|
|
62
|
+
DeviceDataCollection.new(jwt,
|
|
63
|
+
url,
|
|
64
|
+
bin)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Provides a human-readable string representation of the object.
|
|
68
|
+
def to_s
|
|
69
|
+
class_name = self.class.name.split('::').last
|
|
70
|
+
"<#{class_name} jwt: #{@jwt}, url: #{@url}, bin: #{@bin}>"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
74
|
+
def inspect
|
|
75
|
+
class_name = self.class.name.split('::').last
|
|
76
|
+
"<#{class_name} jwt: #{@jwt.inspect}, url: #{@url.inspect}, bin: #{@bin.inspect}>"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# DeviceDataRequest Model.
|
|
8
|
+
class DeviceDataRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Add the `sessionId` provided in the [postMessage for the device data
|
|
13
|
+
# collection form
|
|
14
|
+
# (web)](/products/payments/enable-features/3ds-authentication/web) or for
|
|
15
|
+
# native (iOS/Android), returned as `consumerSessionId` as part of [SDK
|
|
16
|
+
# initialization](/products/payments/enable-features/3ds-authentication/andr
|
|
17
|
+
# oid-ios). <br><br>__Note:__ If device data collection fails you can
|
|
18
|
+
# attempt the payment without this value, but you will see an increased
|
|
19
|
+
# number of `challenged` and even `authenticationFailed` outcomes, if this
|
|
20
|
+
# happens for a lot of requests.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :collection_reference
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['collection_reference'] = 'collectionReference'
|
|
28
|
+
@_hash
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# An array for optional fields
|
|
32
|
+
def self.optionals
|
|
33
|
+
%w[
|
|
34
|
+
collection_reference
|
|
35
|
+
]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for nullable fields
|
|
39
|
+
def self.nullables
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(collection_reference = SKIP)
|
|
44
|
+
@collection_reference = collection_reference unless collection_reference == SKIP
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
collection_reference =
|
|
53
|
+
hash.key?('collectionReference') ? hash['collectionReference'] : SKIP
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
DeviceDataRequest.new(collection_reference)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} collection_reference: #{@collection_reference}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} collection_reference: #{@collection_reference.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# DeviceDataRequiredActionList Model.
|
|
8
|
+
class DeviceDataRequiredActionList < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Supply the 3DS device data collectionReference (SessionId) to continue the
|
|
13
|
+
# payment. See [details](../3ds-actions/supply3dsdevicedata) including what
|
|
14
|
+
# to add in the request body.
|
|
15
|
+
# @return [PaymentsActionSupply3dsDeviceData]
|
|
16
|
+
attr_accessor :supply3ds_device_data
|
|
17
|
+
|
|
18
|
+
# A mapping from model property names to API property names.
|
|
19
|
+
def self.names
|
|
20
|
+
@_hash = {} if @_hash.nil?
|
|
21
|
+
@_hash['supply3ds_device_data'] = 'supply3dsDeviceData'
|
|
22
|
+
@_hash
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# An array for optional fields
|
|
26
|
+
def self.optionals
|
|
27
|
+
%w[
|
|
28
|
+
supply3ds_device_data
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# An array for nullable fields
|
|
33
|
+
def self.nullables
|
|
34
|
+
[]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def initialize(supply3ds_device_data = SKIP)
|
|
38
|
+
@supply3ds_device_data = supply3ds_device_data unless supply3ds_device_data == SKIP
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
if hash['supply3dsDeviceData']
|
|
47
|
+
supply3ds_device_data = PaymentsActionSupply3dsDeviceData.from_hash(hash['supply3dsDeviceData'])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Create object from extracted values.
|
|
51
|
+
DeviceDataRequiredActionList.new(supply3ds_device_data)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Provides a human-readable string representation of the object.
|
|
55
|
+
def to_s
|
|
56
|
+
class_name = self.class.name.split('::').last
|
|
57
|
+
"<#{class_name} supply3ds_device_data: #{@supply3ds_device_data}>"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
61
|
+
def inspect
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} supply3ds_device_data: #{@supply3ds_device_data.inspect}>"
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require_relative 'payments_response202'
|
|
7
|
+
|
|
8
|
+
module Payments
|
|
9
|
+
# DeviceDataRequiredResponse Model.
|
|
10
|
+
class DeviceDataRequiredResponse < PaymentsResponse202
|
|
11
|
+
# TODO: Write general description for this method
|
|
12
|
+
# @return [DeviceDataCollection]
|
|
13
|
+
attr_accessor :device_data_collection
|
|
14
|
+
|
|
15
|
+
# TODO: Write general description for this method
|
|
16
|
+
# @return [DeviceDataRequiredActionList]
|
|
17
|
+
attr_accessor :actions
|
|
18
|
+
|
|
19
|
+
# A mapping from model property names to API property names.
|
|
20
|
+
def self.names
|
|
21
|
+
@_hash = {} if @_hash.nil?
|
|
22
|
+
@_hash['device_data_collection'] = 'deviceDataCollection'
|
|
23
|
+
@_hash['actions'] = '_actions'
|
|
24
|
+
@_hash = super().merge(@_hash)
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
_arr = %w[
|
|
31
|
+
device_data_collection
|
|
32
|
+
actions
|
|
33
|
+
]
|
|
34
|
+
(_arr << super()).flatten!
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# An array for nullable fields
|
|
38
|
+
def self.nullables
|
|
39
|
+
_arr = []
|
|
40
|
+
(_arr << super()).flatten!
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(device_data_collection = SKIP, actions = SKIP,
|
|
44
|
+
outcome = '3dsDeviceDataRequired',
|
|
45
|
+
transaction_reference = SKIP)
|
|
46
|
+
@device_data_collection = device_data_collection unless device_data_collection == SKIP
|
|
47
|
+
@actions = actions unless actions == SKIP
|
|
48
|
+
|
|
49
|
+
# Call the constructor of the base class
|
|
50
|
+
super(outcome,
|
|
51
|
+
transaction_reference)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Creates an instance of the object from a hash.
|
|
55
|
+
def self.from_hash(hash)
|
|
56
|
+
return nil unless hash
|
|
57
|
+
|
|
58
|
+
# Extract variables from the hash.
|
|
59
|
+
device_data_collection = DeviceDataCollection.from_hash(hash['deviceDataCollection']) if
|
|
60
|
+
hash['deviceDataCollection']
|
|
61
|
+
actions = DeviceDataRequiredActionList.from_hash(hash['_actions']) if hash['_actions']
|
|
62
|
+
outcome = hash['outcome'] ||= '3dsDeviceDataRequired'
|
|
63
|
+
transaction_reference =
|
|
64
|
+
hash.key?('transactionReference') ? hash['transactionReference'] : SKIP
|
|
65
|
+
|
|
66
|
+
# Create object from extracted values.
|
|
67
|
+
DeviceDataRequiredResponse.new(device_data_collection,
|
|
68
|
+
actions,
|
|
69
|
+
outcome,
|
|
70
|
+
transaction_reference)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Provides a human-readable string representation of the object.
|
|
74
|
+
def to_s
|
|
75
|
+
class_name = self.class.name.split('::').last
|
|
76
|
+
super_string = super().sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
77
|
+
"<#{class_name} #{super_string}, device_data_collection: #{@device_data_collection},"\
|
|
78
|
+
" actions: #{@actions}>"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
82
|
+
def inspect
|
|
83
|
+
class_name = self.class.name.split('::').last
|
|
84
|
+
super_string = super().inspect.sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
85
|
+
"<#{class_name} #{super_string}, device_data_collection:"\
|
|
86
|
+
" #{@device_data_collection.inspect}, actions: #{@actions.inspect}>"
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# DeviceDataResponse201 Model.
|
|
8
|
+
class DeviceDataResponse201 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :outcome
|
|
15
|
+
|
|
16
|
+
# A unique reference generated by you that is used to identify a payment
|
|
17
|
+
# throughout its lifecycle.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :transaction_reference
|
|
20
|
+
|
|
21
|
+
# Discriminators mapping.
|
|
22
|
+
def self.discriminators
|
|
23
|
+
if @_discriminators.nil?
|
|
24
|
+
@_discriminators = {}
|
|
25
|
+
@_discriminators['authorized'] = CardAuthorizedPaymentResponse
|
|
26
|
+
@_discriminators['3dsChallenged'] = ChallengedResponse
|
|
27
|
+
@_discriminators['refused'] = PaymentRefusedResponse
|
|
28
|
+
@_discriminators['3dsUnavailable'] = PaymentsResponse
|
|
29
|
+
@_discriminators['3dsAuthenticationFailed'] = UnsuccessfulAuthenticationResponse
|
|
30
|
+
@_discriminators['sentForCancellation'] = SentForCancellationResponse
|
|
31
|
+
@_discriminators['sentForSettlement'] = SentForSettlementResponse
|
|
32
|
+
end
|
|
33
|
+
@_discriminators
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# A mapping from model property names to API property names.
|
|
37
|
+
def self.names
|
|
38
|
+
@_hash = {} if @_hash.nil?
|
|
39
|
+
@_hash['outcome'] = 'outcome'
|
|
40
|
+
@_hash['transaction_reference'] = 'transactionReference'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
outcome
|
|
48
|
+
transaction_reference
|
|
49
|
+
]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for nullable fields
|
|
53
|
+
def self.nullables
|
|
54
|
+
[]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def initialize(outcome = 'DeviceDataResponse201',
|
|
58
|
+
transaction_reference = SKIP)
|
|
59
|
+
@outcome = outcome unless outcome == SKIP
|
|
60
|
+
@transaction_reference = transaction_reference unless transaction_reference == SKIP
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Creates an instance of the object from a hash.
|
|
64
|
+
def self.from_hash(hash)
|
|
65
|
+
return nil unless hash
|
|
66
|
+
|
|
67
|
+
# Delegate unboxing to another function if a discriminator
|
|
68
|
+
# value for a child class is present.
|
|
69
|
+
unboxer = discriminators[hash['outcome']]
|
|
70
|
+
return unboxer.send(:from_hash, hash) if unboxer
|
|
71
|
+
|
|
72
|
+
# Extract variables from the hash.
|
|
73
|
+
outcome = hash['outcome'] ||= 'DeviceDataResponse201'
|
|
74
|
+
transaction_reference =
|
|
75
|
+
hash.key?('transactionReference') ? hash['transactionReference'] : SKIP
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
DeviceDataResponse201.new(outcome,
|
|
79
|
+
transaction_reference)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Provides a human-readable string representation of the object.
|
|
83
|
+
def to_s
|
|
84
|
+
class_name = self.class.name.split('::').last
|
|
85
|
+
"<#{class_name} outcome: #{@outcome}, transaction_reference: #{@transaction_reference}>"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
89
|
+
def inspect
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} outcome: #{@outcome.inspect}, transaction_reference:"\
|
|
92
|
+
" #{@transaction_reference.inspect}>"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# Embedded Model.
|
|
8
|
+
class Embedded < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Array of payments within the date range.
|
|
13
|
+
# @return [Array[Payment]]
|
|
14
|
+
attr_accessor :payments
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['payments'] = 'payments'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
payments
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(payments = SKIP)
|
|
36
|
+
@payments = payments unless payments == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
# Parameter is an array, so we need to iterate through it
|
|
45
|
+
payments = nil
|
|
46
|
+
unless hash['payments'].nil?
|
|
47
|
+
payments = []
|
|
48
|
+
hash['payments'].each do |structure|
|
|
49
|
+
payments << (Payment.from_hash(structure) if structure)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
payments = SKIP unless hash.key?('payments')
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
Embedded.new(payments)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} payments: #{@payments}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} payments: #{@payments.inspect}>"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|