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,309 @@
|
|
|
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 that contains all information related to the payment and API
|
|
8
|
+
# configurations.
|
|
9
|
+
class PaymentsInstruction < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :method
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [PaymentInstrument7]
|
|
19
|
+
attr_accessor :payment_instrument
|
|
20
|
+
|
|
21
|
+
# The text that appears on your customer's statement. Used to identify the
|
|
22
|
+
# merchant.
|
|
23
|
+
# @return [Narrative]
|
|
24
|
+
attr_accessor :narrative
|
|
25
|
+
|
|
26
|
+
# Use this object if you want to create a token after the payment. Can only
|
|
27
|
+
# be used with paymentInstrument.type: card/plain & checkout.
|
|
28
|
+
# @return [TokenCreation]
|
|
29
|
+
attr_accessor :token_creation
|
|
30
|
+
|
|
31
|
+
# Use this object if you want to create a token after the payment. Can only
|
|
32
|
+
# be used with paymentInstrument.type: card/plain & checkout.
|
|
33
|
+
# @return [Value]
|
|
34
|
+
attr_accessor :value
|
|
35
|
+
|
|
36
|
+
# A flag which identifies a payment as being for the purpose of repaying a
|
|
37
|
+
# debt.
|
|
38
|
+
# @return [TrueClass | FalseClass]
|
|
39
|
+
attr_accessor :debt_repayment
|
|
40
|
+
|
|
41
|
+
# Fraud assessment to detect potential fraud and prevent the transaction
|
|
42
|
+
# from proceeding.
|
|
43
|
+
# Read more on how to set it up under our [__Fraud
|
|
44
|
+
# Assessment__](/products/payments/enable-features/fraud-assessment) guide.
|
|
45
|
+
# @return [PaymentsFraud]
|
|
46
|
+
attr_accessor :fraud
|
|
47
|
+
|
|
48
|
+
# An object containing 3DS authentication preferences.
|
|
49
|
+
# Read more on how to set it up under our [__3DS
|
|
50
|
+
# Authentication__](/products/payments/enable-features/3ds-authentication)
|
|
51
|
+
# guide.
|
|
52
|
+
# @return [PaymentsThreeDS]
|
|
53
|
+
attr_accessor :three_ds
|
|
54
|
+
|
|
55
|
+
# An object used to request or specify an SCA Exemption.
|
|
56
|
+
# Read more on how to set it up under our [__SCA
|
|
57
|
+
# Exemptions__](/products/payments/enable-features/sca-exemptions) guide.
|
|
58
|
+
# @return [Exemption]
|
|
59
|
+
attr_accessor :exemption
|
|
60
|
+
|
|
61
|
+
# Automatically settle a payment following authorization. If any of the
|
|
62
|
+
# AVS/CVC response riskFactors are marked as `notMatched` the payment will
|
|
63
|
+
# be `sentForCancellation` automatically.
|
|
64
|
+
# Read more on how to set it up under our [__Auto
|
|
65
|
+
# Settlement__](/products/payments/enable-features/auto-settlement) guide.
|
|
66
|
+
# @return [Settlement]
|
|
67
|
+
attr_accessor :settlement
|
|
68
|
+
|
|
69
|
+
# Automatically settle a payment following authorization. If any of the
|
|
70
|
+
# AVS/CVC response riskFactors are marked as `notMatched` the payment will
|
|
71
|
+
# be `sentForCancellation` automatically.
|
|
72
|
+
# Read more on how to set it up under our [__Auto
|
|
73
|
+
# Settlement__](/products/payments/enable-features/auto-settlement) guide.
|
|
74
|
+
# @return [Customer]
|
|
75
|
+
attr_accessor :customer
|
|
76
|
+
|
|
77
|
+
# Automatically settle a payment following authorization. If any of the
|
|
78
|
+
# AVS/CVC response riskFactors are marked as `notMatched` the payment will
|
|
79
|
+
# be `sentForCancellation` automatically.
|
|
80
|
+
# Read more on how to set it up under our [__Auto
|
|
81
|
+
# Settlement__](/products/payments/enable-features/auto-settlement) guide.
|
|
82
|
+
# @return [Shipping]
|
|
83
|
+
attr_accessor :shipping
|
|
84
|
+
|
|
85
|
+
# Automatically settle a payment following authorization. If any of the
|
|
86
|
+
# AVS/CVC response riskFactors are marked as `notMatched` the payment will
|
|
87
|
+
# be `sentForCancellation` automatically.
|
|
88
|
+
# Read more on how to set it up under our [__Auto
|
|
89
|
+
# Settlement__](/products/payments/enable-features/auto-settlement) guide.
|
|
90
|
+
# @return [CustomerAgreement]
|
|
91
|
+
attr_accessor :customer_agreement
|
|
92
|
+
|
|
93
|
+
# An object containing information about the recipient of financial
|
|
94
|
+
# services. Required for MCC 6012 transactions in the Visa Europe region.
|
|
95
|
+
# The recipient may or may not be the cardholder.
|
|
96
|
+
# Read more on how to set it up under our [__Financial
|
|
97
|
+
# Services__](/products/payments/enable-features/financial-services-mcc6012-
|
|
98
|
+
# mcc6051) guide.
|
|
99
|
+
# @return [PaymentsRecipient]
|
|
100
|
+
attr_accessor :recipient
|
|
101
|
+
|
|
102
|
+
# An attribute that identifies a bill payment paid by providers on behalf of
|
|
103
|
+
# consumers. If you are registered with Visa as a Consumer of the Bill
|
|
104
|
+
# Payment Service (CBPS), you must set this to `true` for any payments
|
|
105
|
+
# associated with the CBPS.
|
|
106
|
+
# @return [TrueClass | FalseClass]
|
|
107
|
+
attr_accessor :consumer_bill_payment
|
|
108
|
+
|
|
109
|
+
# Allows you to request a real-time account update (Visa cards only) when
|
|
110
|
+
# using a previously stored card. You can only use this on subsequent card
|
|
111
|
+
# requests.
|
|
112
|
+
# @return [TrueClass | FalseClass]
|
|
113
|
+
attr_accessor :request_account_updater
|
|
114
|
+
|
|
115
|
+
# Discriminators mapping.
|
|
116
|
+
def self.discriminators
|
|
117
|
+
if @_discriminators.nil?
|
|
118
|
+
@_discriminators = {}
|
|
119
|
+
@_discriminators['applepay'] = ApplepayPaymentsInstruction
|
|
120
|
+
@_discriminators['card'] = CardPaymentsInstruction
|
|
121
|
+
@_discriminators['googlepay'] = GooglepayPaymentsInstruction
|
|
122
|
+
end
|
|
123
|
+
@_discriminators
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# A mapping from model property names to API property names.
|
|
127
|
+
def self.names
|
|
128
|
+
@_hash = {} if @_hash.nil?
|
|
129
|
+
@_hash['method'] = 'method'
|
|
130
|
+
@_hash['payment_instrument'] = 'paymentInstrument'
|
|
131
|
+
@_hash['narrative'] = 'narrative'
|
|
132
|
+
@_hash['token_creation'] = 'tokenCreation'
|
|
133
|
+
@_hash['value'] = 'value'
|
|
134
|
+
@_hash['debt_repayment'] = 'debtRepayment'
|
|
135
|
+
@_hash['fraud'] = 'fraud'
|
|
136
|
+
@_hash['three_ds'] = 'threeDS'
|
|
137
|
+
@_hash['exemption'] = 'exemption'
|
|
138
|
+
@_hash['settlement'] = 'settlement'
|
|
139
|
+
@_hash['customer'] = 'customer'
|
|
140
|
+
@_hash['shipping'] = 'shipping'
|
|
141
|
+
@_hash['customer_agreement'] = 'customerAgreement'
|
|
142
|
+
@_hash['recipient'] = 'recipient'
|
|
143
|
+
@_hash['consumer_bill_payment'] = 'consumerBillPayment'
|
|
144
|
+
@_hash['request_account_updater'] = 'requestAccountUpdater'
|
|
145
|
+
@_hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# An array for optional fields
|
|
149
|
+
def self.optionals
|
|
150
|
+
%w[
|
|
151
|
+
method
|
|
152
|
+
token_creation
|
|
153
|
+
debt_repayment
|
|
154
|
+
fraud
|
|
155
|
+
three_ds
|
|
156
|
+
exemption
|
|
157
|
+
settlement
|
|
158
|
+
customer
|
|
159
|
+
shipping
|
|
160
|
+
customer_agreement
|
|
161
|
+
recipient
|
|
162
|
+
consumer_bill_payment
|
|
163
|
+
request_account_updater
|
|
164
|
+
]
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# An array for nullable fields
|
|
168
|
+
def self.nullables
|
|
169
|
+
[]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def initialize(payment_instrument = nil, narrative = nil, value = nil,
|
|
173
|
+
method = 'PaymentsInstruction', token_creation = SKIP,
|
|
174
|
+
debt_repayment = SKIP, fraud = SKIP, three_ds = SKIP,
|
|
175
|
+
exemption = SKIP, settlement = SKIP, customer = SKIP,
|
|
176
|
+
shipping = SKIP, customer_agreement = SKIP, recipient = SKIP,
|
|
177
|
+
consumer_bill_payment = SKIP, request_account_updater = SKIP)
|
|
178
|
+
@method = method unless method == SKIP
|
|
179
|
+
@payment_instrument = payment_instrument
|
|
180
|
+
@narrative = narrative
|
|
181
|
+
@token_creation = token_creation unless token_creation == SKIP
|
|
182
|
+
@value = value
|
|
183
|
+
@debt_repayment = debt_repayment unless debt_repayment == SKIP
|
|
184
|
+
@fraud = fraud unless fraud == SKIP
|
|
185
|
+
@three_ds = three_ds unless three_ds == SKIP
|
|
186
|
+
@exemption = exemption unless exemption == SKIP
|
|
187
|
+
@settlement = settlement unless settlement == SKIP
|
|
188
|
+
@customer = customer unless customer == SKIP
|
|
189
|
+
@shipping = shipping unless shipping == SKIP
|
|
190
|
+
@customer_agreement = customer_agreement unless customer_agreement == SKIP
|
|
191
|
+
@recipient = recipient unless recipient == SKIP
|
|
192
|
+
@consumer_bill_payment = consumer_bill_payment unless consumer_bill_payment == SKIP
|
|
193
|
+
@request_account_updater = request_account_updater unless request_account_updater == SKIP
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Creates an instance of the object from a hash.
|
|
197
|
+
def self.from_hash(hash)
|
|
198
|
+
return nil unless hash
|
|
199
|
+
|
|
200
|
+
# Delegate unboxing to another function if a discriminator
|
|
201
|
+
# value for a child class is present.
|
|
202
|
+
unboxer = discriminators[hash['method']]
|
|
203
|
+
return unboxer.send(:from_hash, hash) if unboxer
|
|
204
|
+
|
|
205
|
+
# Extract variables from the hash.
|
|
206
|
+
payment_instrument = hash.key?('paymentInstrument') ? APIHelper.deserialize_union_type(
|
|
207
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument), hash['paymentInstrument']
|
|
208
|
+
) : nil
|
|
209
|
+
narrative = Narrative.from_hash(hash['narrative']) if hash['narrative']
|
|
210
|
+
value = Value.from_hash(hash['value']) if hash['value']
|
|
211
|
+
method = hash['method'] ||= 'PaymentsInstruction'
|
|
212
|
+
token_creation = TokenCreation.from_hash(hash['tokenCreation']) if hash['tokenCreation']
|
|
213
|
+
debt_repayment = hash.key?('debtRepayment') ? hash['debtRepayment'] : SKIP
|
|
214
|
+
fraud = PaymentsFraud.from_hash(hash['fraud']) if hash['fraud']
|
|
215
|
+
three_ds = PaymentsThreeDS.from_hash(hash['threeDS']) if hash['threeDS']
|
|
216
|
+
exemption = Exemption.from_hash(hash['exemption']) if hash['exemption']
|
|
217
|
+
settlement = Settlement.from_hash(hash['settlement']) if hash['settlement']
|
|
218
|
+
customer = Customer.from_hash(hash['customer']) if hash['customer']
|
|
219
|
+
shipping = Shipping.from_hash(hash['shipping']) if hash['shipping']
|
|
220
|
+
customer_agreement = hash.key?('customerAgreement') ? APIHelper.deserialize_union_type(
|
|
221
|
+
UnionTypeLookUp.get(:PaymentsInstructionCustomerAgreement), hash['customerAgreement']
|
|
222
|
+
) : SKIP
|
|
223
|
+
recipient = PaymentsRecipient.from_hash(hash['recipient']) if hash['recipient']
|
|
224
|
+
consumer_bill_payment =
|
|
225
|
+
hash.key?('consumerBillPayment') ? hash['consumerBillPayment'] : SKIP
|
|
226
|
+
request_account_updater =
|
|
227
|
+
hash.key?('requestAccountUpdater') ? hash['requestAccountUpdater'] : SKIP
|
|
228
|
+
|
|
229
|
+
# Create object from extracted values.
|
|
230
|
+
PaymentsInstruction.new(payment_instrument,
|
|
231
|
+
narrative,
|
|
232
|
+
value,
|
|
233
|
+
method,
|
|
234
|
+
token_creation,
|
|
235
|
+
debt_repayment,
|
|
236
|
+
fraud,
|
|
237
|
+
three_ds,
|
|
238
|
+
exemption,
|
|
239
|
+
settlement,
|
|
240
|
+
customer,
|
|
241
|
+
shipping,
|
|
242
|
+
customer_agreement,
|
|
243
|
+
recipient,
|
|
244
|
+
consumer_bill_payment,
|
|
245
|
+
request_account_updater)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Validates an instance of the object from a given value.
|
|
249
|
+
# @param [PaymentsInstruction | Hash] The value against the validation is performed.
|
|
250
|
+
def self.validate(value)
|
|
251
|
+
if value.instance_of? self
|
|
252
|
+
return (
|
|
253
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument)
|
|
254
|
+
.validate(value.payment_instrument) and
|
|
255
|
+
APIHelper.valid_type?(value.narrative,
|
|
256
|
+
->(val) { Narrative.validate(val) },
|
|
257
|
+
is_model_hash: true) and
|
|
258
|
+
APIHelper.valid_type?(value.value,
|
|
259
|
+
->(val) { Value.validate(val) },
|
|
260
|
+
is_model_hash: true)
|
|
261
|
+
)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
return false unless value.instance_of? Hash
|
|
265
|
+
|
|
266
|
+
# Delegate validation to another function if a discriminator
|
|
267
|
+
# value for a child class is present.
|
|
268
|
+
validator = discriminators[value['method']]
|
|
269
|
+
return validator.send(:validate, value) if validator
|
|
270
|
+
|
|
271
|
+
(
|
|
272
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument)
|
|
273
|
+
.validate(value['paymentInstrument']) and
|
|
274
|
+
APIHelper.valid_type?(value['narrative'],
|
|
275
|
+
->(val) { Narrative.validate(val) },
|
|
276
|
+
is_model_hash: true) and
|
|
277
|
+
APIHelper.valid_type?(value['value'],
|
|
278
|
+
->(val) { Value.validate(val) },
|
|
279
|
+
is_model_hash: true)
|
|
280
|
+
)
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Provides a human-readable string representation of the object.
|
|
284
|
+
def to_s
|
|
285
|
+
class_name = self.class.name.split('::').last
|
|
286
|
+
"<#{class_name} method: #{@method}, payment_instrument: #{@payment_instrument}, narrative:"\
|
|
287
|
+
" #{@narrative}, token_creation: #{@token_creation}, value: #{@value}, debt_repayment:"\
|
|
288
|
+
" #{@debt_repayment}, fraud: #{@fraud}, three_ds: #{@three_ds}, exemption: #{@exemption},"\
|
|
289
|
+
" settlement: #{@settlement}, customer: #{@customer}, shipping: #{@shipping},"\
|
|
290
|
+
" customer_agreement: #{@customer_agreement}, recipient: #{@recipient},"\
|
|
291
|
+
" consumer_bill_payment: #{@consumer_bill_payment}, request_account_updater:"\
|
|
292
|
+
" #{@request_account_updater}>"
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
296
|
+
def inspect
|
|
297
|
+
class_name = self.class.name.split('::').last
|
|
298
|
+
"<#{class_name} method: #{@method.inspect}, payment_instrument:"\
|
|
299
|
+
" #{@payment_instrument.inspect}, narrative: #{@narrative.inspect}, token_creation:"\
|
|
300
|
+
" #{@token_creation.inspect}, value: #{@value.inspect}, debt_repayment:"\
|
|
301
|
+
" #{@debt_repayment.inspect}, fraud: #{@fraud.inspect}, three_ds: #{@three_ds.inspect},"\
|
|
302
|
+
" exemption: #{@exemption.inspect}, settlement: #{@settlement.inspect}, customer:"\
|
|
303
|
+
" #{@customer.inspect}, shipping: #{@shipping.inspect}, customer_agreement:"\
|
|
304
|
+
" #{@customer_agreement.inspect}, recipient: #{@recipient.inspect}, consumer_bill_payment:"\
|
|
305
|
+
" #{@consumer_bill_payment.inspect}, request_account_updater:"\
|
|
306
|
+
" #{@request_account_updater.inspect}>"
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# Return details about the status of the payment
|
|
8
|
+
class PaymentsLink < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Self]
|
|
14
|
+
attr_accessor :mself
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['mself'] = 'self'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
mself
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(mself = SKIP)
|
|
36
|
+
@mself = mself unless mself == 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
|
+
mself = Self.from_hash(hash['self']) if hash['self']
|
|
45
|
+
|
|
46
|
+
# Create object from extracted values.
|
|
47
|
+
PaymentsLink.new(mself)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides a human-readable string representation of the object.
|
|
51
|
+
def to_s
|
|
52
|
+
class_name = self.class.name.split('::').last
|
|
53
|
+
"<#{class_name} mself: #{@mself}>"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
57
|
+
def inspect
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} mself: #{@mself.inspect}>"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require_relative 'card_payment_instrument'
|
|
7
|
+
|
|
8
|
+
module Payments
|
|
9
|
+
# PaymentsNetworkTokenPaymentInstrument Model.
|
|
10
|
+
class PaymentsNetworkTokenPaymentInstrument < CardPaymentInstrument
|
|
11
|
+
# The network token number.
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :token_number
|
|
14
|
+
|
|
15
|
+
# The name as shown on the card.
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :card_holder_name
|
|
18
|
+
|
|
19
|
+
# The single-use cryptogram provisioned for this payment. Required for all
|
|
20
|
+
# Customer Initiated Transactions (CITs). <br><br> __Note:__ If the
|
|
21
|
+
# `cryptogram` and `eci` are not provided, the Payments API will
|
|
22
|
+
# __automatically__ attempt to provision them. This will only be successful
|
|
23
|
+
# for Network Tokens created via Worldpay. For Network Tokens created via
|
|
24
|
+
# other gateways you must provide these.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :cryptogram
|
|
27
|
+
|
|
28
|
+
# Electronic Commerce Indicator.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :eci
|
|
31
|
+
|
|
32
|
+
# Contains your customer's card or token expiry date.
|
|
33
|
+
# @return [ExpiryDate]
|
|
34
|
+
attr_accessor :expiry_date
|
|
35
|
+
|
|
36
|
+
# Contains the billing address information.
|
|
37
|
+
# @return [BillingAddress]
|
|
38
|
+
attr_accessor :billing_address
|
|
39
|
+
|
|
40
|
+
# A mapping from model property names to API property names.
|
|
41
|
+
def self.names
|
|
42
|
+
@_hash = {} if @_hash.nil?
|
|
43
|
+
@_hash['token_number'] = 'tokenNumber'
|
|
44
|
+
@_hash['card_holder_name'] = 'cardHolderName'
|
|
45
|
+
@_hash['cryptogram'] = 'cryptogram'
|
|
46
|
+
@_hash['eci'] = 'eci'
|
|
47
|
+
@_hash['expiry_date'] = 'expiryDate'
|
|
48
|
+
@_hash['billing_address'] = 'billingAddress'
|
|
49
|
+
@_hash = super().merge(@_hash)
|
|
50
|
+
@_hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# An array for optional fields
|
|
54
|
+
def self.optionals
|
|
55
|
+
_arr = %w[
|
|
56
|
+
card_holder_name
|
|
57
|
+
cryptogram
|
|
58
|
+
eci
|
|
59
|
+
billing_address
|
|
60
|
+
]
|
|
61
|
+
(_arr << super()).flatten!
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# An array for nullable fields
|
|
65
|
+
def self.nullables
|
|
66
|
+
_arr = []
|
|
67
|
+
(_arr << super()).flatten!
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def initialize(token_number = nil, expiry_date = nil,
|
|
71
|
+
card_holder_name = SKIP, cryptogram = SKIP, eci = SKIP,
|
|
72
|
+
billing_address = SKIP, type = 'networkToken')
|
|
73
|
+
@token_number = token_number
|
|
74
|
+
@card_holder_name = card_holder_name unless card_holder_name == SKIP
|
|
75
|
+
@cryptogram = cryptogram unless cryptogram == SKIP
|
|
76
|
+
@eci = eci unless eci == SKIP
|
|
77
|
+
@expiry_date = expiry_date
|
|
78
|
+
@billing_address = billing_address unless billing_address == SKIP
|
|
79
|
+
|
|
80
|
+
# Call the constructor of the base class
|
|
81
|
+
super(type)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Creates an instance of the object from a hash.
|
|
85
|
+
def self.from_hash(hash)
|
|
86
|
+
return nil unless hash
|
|
87
|
+
|
|
88
|
+
# Extract variables from the hash.
|
|
89
|
+
token_number = hash.key?('tokenNumber') ? hash['tokenNumber'] : nil
|
|
90
|
+
expiry_date = ExpiryDate.from_hash(hash['expiryDate']) if hash['expiryDate']
|
|
91
|
+
card_holder_name =
|
|
92
|
+
hash.key?('cardHolderName') ? hash['cardHolderName'] : SKIP
|
|
93
|
+
cryptogram = hash.key?('cryptogram') ? hash['cryptogram'] : SKIP
|
|
94
|
+
eci = hash.key?('eci') ? hash['eci'] : SKIP
|
|
95
|
+
billing_address = BillingAddress.from_hash(hash['billingAddress']) if hash['billingAddress']
|
|
96
|
+
type = hash['type'] ||= 'networkToken'
|
|
97
|
+
|
|
98
|
+
# Create object from extracted values.
|
|
99
|
+
PaymentsNetworkTokenPaymentInstrument.new(token_number,
|
|
100
|
+
expiry_date,
|
|
101
|
+
card_holder_name,
|
|
102
|
+
cryptogram,
|
|
103
|
+
eci,
|
|
104
|
+
billing_address,
|
|
105
|
+
type)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Provides a human-readable string representation of the object.
|
|
109
|
+
def to_s
|
|
110
|
+
class_name = self.class.name.split('::').last
|
|
111
|
+
super_string = super().sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
112
|
+
"<#{class_name} #{super_string}, token_number: #{@token_number}, card_holder_name:"\
|
|
113
|
+
" #{@card_holder_name}, cryptogram: #{@cryptogram}, eci: #{@eci}, expiry_date:"\
|
|
114
|
+
" #{@expiry_date}, billing_address: #{@billing_address}>"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
118
|
+
def inspect
|
|
119
|
+
class_name = self.class.name.split('::').last
|
|
120
|
+
super_string = super().inspect.sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
121
|
+
"<#{class_name} #{super_string}, token_number: #{@token_number.inspect}, card_holder_name:"\
|
|
122
|
+
" #{@card_holder_name.inspect}, cryptogram: #{@cryptogram.inspect}, eci: #{@eci.inspect},"\
|
|
123
|
+
" expiry_date: #{@expiry_date.inspect}, billing_address: #{@billing_address.inspect}>"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# PaymentsPartialRefundRequest Model.
|
|
8
|
+
class PaymentsPartialRefundRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :reference
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Value]
|
|
18
|
+
attr_accessor :value
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['reference'] = 'reference'
|
|
24
|
+
@_hash['value'] = 'value'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(reference = nil, value = nil)
|
|
39
|
+
@reference = reference
|
|
40
|
+
@value = value
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
reference = hash.key?('reference') ? hash['reference'] : nil
|
|
49
|
+
value = Value.from_hash(hash['value']) if hash['value']
|
|
50
|
+
|
|
51
|
+
# Create object from extracted values.
|
|
52
|
+
PaymentsPartialRefundRequest.new(reference,
|
|
53
|
+
value)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a human-readable string representation of the object.
|
|
57
|
+
def to_s
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} reference: #{@reference}, value: #{@value}>"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
63
|
+
def inspect
|
|
64
|
+
class_name = self.class.name.split('::').last
|
|
65
|
+
"<#{class_name} reference: #{@reference.inspect}, value: #{@value.inspect}>"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# Next action links.
|
|
8
|
+
class PaymentsPartialSettle < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Next action links.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :href
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['href'] = 'href'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
href
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(href = SKIP)
|
|
36
|
+
@href = href unless href == 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
|
+
href = hash.key?('href') ? hash['href'] : SKIP
|
|
45
|
+
|
|
46
|
+
# Create object from extracted values.
|
|
47
|
+
PaymentsPartialSettle.new(href)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Validates an instance of the object from a given value.
|
|
51
|
+
# @param [PaymentsPartialSettle | Hash] The value against the validation is performed.
|
|
52
|
+
def self.validate(value)
|
|
53
|
+
return true if value.instance_of? self
|
|
54
|
+
|
|
55
|
+
return false unless value.instance_of? Hash
|
|
56
|
+
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} href: #{@href}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} href: #{@href.inspect}>"
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|