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,151 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require_relative 'payments_instruction'
|
|
7
|
+
|
|
8
|
+
module Payments
|
|
9
|
+
# ApplepayPaymentsInstruction Model.
|
|
10
|
+
class ApplepayPaymentsInstruction < PaymentsInstruction
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# A mapping from model property names to API property names.
|
|
14
|
+
def self.names
|
|
15
|
+
@_hash = {} if @_hash.nil?
|
|
16
|
+
|
|
17
|
+
@_hash = super().merge(@_hash)
|
|
18
|
+
@_hash
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# An array for optional fields
|
|
22
|
+
def self.optionals
|
|
23
|
+
_arr = []
|
|
24
|
+
(_arr << super()).flatten!
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# An array for nullable fields
|
|
28
|
+
def self.nullables
|
|
29
|
+
_arr = []
|
|
30
|
+
(_arr << super()).flatten!
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(payment_instrument = nil, narrative = nil, value = nil,
|
|
34
|
+
method = 'applepay', token_creation = SKIP,
|
|
35
|
+
debt_repayment = SKIP, fraud = SKIP, three_ds = SKIP,
|
|
36
|
+
exemption = SKIP, settlement = SKIP, customer = SKIP,
|
|
37
|
+
shipping = SKIP, customer_agreement = SKIP, recipient = SKIP,
|
|
38
|
+
consumer_bill_payment = SKIP, request_account_updater = SKIP)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Call the constructor of the base class
|
|
42
|
+
super(payment_instrument,
|
|
43
|
+
narrative,
|
|
44
|
+
value,
|
|
45
|
+
method,
|
|
46
|
+
token_creation,
|
|
47
|
+
debt_repayment,
|
|
48
|
+
fraud,
|
|
49
|
+
three_ds,
|
|
50
|
+
exemption,
|
|
51
|
+
settlement,
|
|
52
|
+
customer,
|
|
53
|
+
shipping,
|
|
54
|
+
customer_agreement,
|
|
55
|
+
recipient,
|
|
56
|
+
consumer_bill_payment,
|
|
57
|
+
request_account_updater)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
payment_instrument = hash.key?('paymentInstrument') ? APIHelper.deserialize_union_type(
|
|
66
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument), hash['paymentInstrument']
|
|
67
|
+
) : nil
|
|
68
|
+
narrative = Narrative.from_hash(hash['narrative']) if hash['narrative']
|
|
69
|
+
value = Value.from_hash(hash['value']) if hash['value']
|
|
70
|
+
method = hash['method'] ||= 'applepay'
|
|
71
|
+
token_creation = TokenCreation.from_hash(hash['tokenCreation']) if hash['tokenCreation']
|
|
72
|
+
debt_repayment = hash.key?('debtRepayment') ? hash['debtRepayment'] : SKIP
|
|
73
|
+
fraud = PaymentsFraud.from_hash(hash['fraud']) if hash['fraud']
|
|
74
|
+
three_ds = PaymentsThreeDS.from_hash(hash['threeDS']) if hash['threeDS']
|
|
75
|
+
exemption = Exemption.from_hash(hash['exemption']) if hash['exemption']
|
|
76
|
+
settlement = Settlement.from_hash(hash['settlement']) if hash['settlement']
|
|
77
|
+
customer = Customer.from_hash(hash['customer']) if hash['customer']
|
|
78
|
+
shipping = Shipping.from_hash(hash['shipping']) if hash['shipping']
|
|
79
|
+
customer_agreement = hash.key?('customerAgreement') ? APIHelper.deserialize_union_type(
|
|
80
|
+
UnionTypeLookUp.get(:PaymentsInstructionCustomerAgreement), hash['customerAgreement']
|
|
81
|
+
) : SKIP
|
|
82
|
+
recipient = PaymentsRecipient.from_hash(hash['recipient']) if hash['recipient']
|
|
83
|
+
consumer_bill_payment =
|
|
84
|
+
hash.key?('consumerBillPayment') ? hash['consumerBillPayment'] : SKIP
|
|
85
|
+
request_account_updater =
|
|
86
|
+
hash.key?('requestAccountUpdater') ? hash['requestAccountUpdater'] : SKIP
|
|
87
|
+
|
|
88
|
+
# Create object from extracted values.
|
|
89
|
+
ApplepayPaymentsInstruction.new(payment_instrument,
|
|
90
|
+
narrative,
|
|
91
|
+
value,
|
|
92
|
+
method,
|
|
93
|
+
token_creation,
|
|
94
|
+
debt_repayment,
|
|
95
|
+
fraud,
|
|
96
|
+
three_ds,
|
|
97
|
+
exemption,
|
|
98
|
+
settlement,
|
|
99
|
+
customer,
|
|
100
|
+
shipping,
|
|
101
|
+
customer_agreement,
|
|
102
|
+
recipient,
|
|
103
|
+
consumer_bill_payment,
|
|
104
|
+
request_account_updater)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Validates an instance of the object from a given value.
|
|
108
|
+
# @param [ApplepayPaymentsInstruction | Hash] The value against the validation is performed.
|
|
109
|
+
def self.validate(value)
|
|
110
|
+
if value.instance_of? self
|
|
111
|
+
return (
|
|
112
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument)
|
|
113
|
+
.validate(value.payment_instrument) and
|
|
114
|
+
APIHelper.valid_type?(value.narrative,
|
|
115
|
+
->(val) { Narrative.validate(val) },
|
|
116
|
+
is_model_hash: true) and
|
|
117
|
+
APIHelper.valid_type?(value.value,
|
|
118
|
+
->(val) { Value.validate(val) },
|
|
119
|
+
is_model_hash: true)
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
return false unless value.instance_of? Hash
|
|
124
|
+
|
|
125
|
+
(
|
|
126
|
+
UnionTypeLookUp.get(:PaymentsInstructionPaymentInstrument)
|
|
127
|
+
.validate(value['paymentInstrument']) and
|
|
128
|
+
APIHelper.valid_type?(value['narrative'],
|
|
129
|
+
->(val) { Narrative.validate(val) },
|
|
130
|
+
is_model_hash: true) and
|
|
131
|
+
APIHelper.valid_type?(value['value'],
|
|
132
|
+
->(val) { Value.validate(val) },
|
|
133
|
+
is_model_hash: true)
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Provides a human-readable string representation of the object.
|
|
138
|
+
def to_s
|
|
139
|
+
class_name = self.class.name.split('::').last
|
|
140
|
+
super_string = super().sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
141
|
+
"<#{class_name} #{super_string}>"
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
145
|
+
def inspect
|
|
146
|
+
class_name = self.class.name.split('::').last
|
|
147
|
+
super_string = super().inspect.sub(/^<[^ ]+ /, '').sub(/>$/, '')
|
|
148
|
+
"<#{class_name} #{super_string}>"
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# Object that contains authentication related information.
|
|
8
|
+
class Authentication < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The version of 3DS used to process the transaction.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :version
|
|
15
|
+
|
|
16
|
+
# The version of 3DS used to process the transaction.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
# The version of 3DS used to process the transaction.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :authentication_value
|
|
23
|
+
|
|
24
|
+
# Electronic Commerce Indicator (ECI). Indicates the outcome of the 3DS
|
|
25
|
+
# authentication.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :eci
|
|
28
|
+
|
|
29
|
+
# A transaction identifier.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :transaction_id
|
|
32
|
+
|
|
33
|
+
# A transaction identifier.
|
|
34
|
+
# @return [Integer]
|
|
35
|
+
attr_accessor :cryptogram_algorithm
|
|
36
|
+
|
|
37
|
+
# A transaction identifier.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :challenge_preference
|
|
40
|
+
|
|
41
|
+
# A transaction identifier.
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :authentication_flow
|
|
44
|
+
|
|
45
|
+
# A transaction identifier.
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :network_score
|
|
48
|
+
|
|
49
|
+
# A transaction identifier.
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :brand
|
|
52
|
+
|
|
53
|
+
# A mapping from model property names to API property names.
|
|
54
|
+
def self.names
|
|
55
|
+
@_hash = {} if @_hash.nil?
|
|
56
|
+
@_hash['version'] = 'version'
|
|
57
|
+
@_hash['type'] = 'type'
|
|
58
|
+
@_hash['authentication_value'] = 'authenticationValue'
|
|
59
|
+
@_hash['eci'] = 'eci'
|
|
60
|
+
@_hash['transaction_id'] = 'transactionId'
|
|
61
|
+
@_hash['cryptogram_algorithm'] = 'cryptogramAlgorithm'
|
|
62
|
+
@_hash['challenge_preference'] = 'challengePreference'
|
|
63
|
+
@_hash['authentication_flow'] = 'authenticationFlow'
|
|
64
|
+
@_hash['network_score'] = 'networkScore'
|
|
65
|
+
@_hash['brand'] = 'brand'
|
|
66
|
+
@_hash
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# An array for optional fields
|
|
70
|
+
def self.optionals
|
|
71
|
+
%w[
|
|
72
|
+
version
|
|
73
|
+
type
|
|
74
|
+
authentication_value
|
|
75
|
+
eci
|
|
76
|
+
transaction_id
|
|
77
|
+
cryptogram_algorithm
|
|
78
|
+
challenge_preference
|
|
79
|
+
authentication_flow
|
|
80
|
+
network_score
|
|
81
|
+
brand
|
|
82
|
+
]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# An array for nullable fields
|
|
86
|
+
def self.nullables
|
|
87
|
+
[]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def initialize(version = SKIP, type = SKIP, authentication_value = SKIP,
|
|
91
|
+
eci = SKIP, transaction_id = SKIP,
|
|
92
|
+
cryptogram_algorithm = SKIP, challenge_preference = SKIP,
|
|
93
|
+
authentication_flow = SKIP, network_score = SKIP,
|
|
94
|
+
brand = SKIP)
|
|
95
|
+
@version = version unless version == SKIP
|
|
96
|
+
@type = type unless type == SKIP
|
|
97
|
+
@authentication_value = authentication_value unless authentication_value == SKIP
|
|
98
|
+
@eci = eci unless eci == SKIP
|
|
99
|
+
@transaction_id = transaction_id unless transaction_id == SKIP
|
|
100
|
+
@cryptogram_algorithm = cryptogram_algorithm unless cryptogram_algorithm == SKIP
|
|
101
|
+
@challenge_preference = challenge_preference unless challenge_preference == SKIP
|
|
102
|
+
@authentication_flow = authentication_flow unless authentication_flow == SKIP
|
|
103
|
+
@network_score = network_score unless network_score == SKIP
|
|
104
|
+
@brand = brand unless brand == SKIP
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Creates an instance of the object from a hash.
|
|
108
|
+
def self.from_hash(hash)
|
|
109
|
+
return nil unless hash
|
|
110
|
+
|
|
111
|
+
# Extract variables from the hash.
|
|
112
|
+
version = hash.key?('version') ? hash['version'] : SKIP
|
|
113
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
|
114
|
+
authentication_value =
|
|
115
|
+
hash.key?('authenticationValue') ? hash['authenticationValue'] : SKIP
|
|
116
|
+
eci = hash.key?('eci') ? hash['eci'] : SKIP
|
|
117
|
+
transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP
|
|
118
|
+
cryptogram_algorithm = Number.from_hash(hash['cryptogramAlgorithm']) if
|
|
119
|
+
hash['cryptogramAlgorithm']
|
|
120
|
+
challenge_preference =
|
|
121
|
+
hash.key?('challengePreference') ? hash['challengePreference'] : SKIP
|
|
122
|
+
authentication_flow =
|
|
123
|
+
hash.key?('authenticationFlow') ? hash['authenticationFlow'] : SKIP
|
|
124
|
+
network_score = hash.key?('networkScore') ? hash['networkScore'] : SKIP
|
|
125
|
+
brand = hash.key?('brand') ? hash['brand'] : SKIP
|
|
126
|
+
|
|
127
|
+
# Create object from extracted values.
|
|
128
|
+
Authentication.new(version,
|
|
129
|
+
type,
|
|
130
|
+
authentication_value,
|
|
131
|
+
eci,
|
|
132
|
+
transaction_id,
|
|
133
|
+
cryptogram_algorithm,
|
|
134
|
+
challenge_preference,
|
|
135
|
+
authentication_flow,
|
|
136
|
+
network_score,
|
|
137
|
+
brand)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Provides a human-readable string representation of the object.
|
|
141
|
+
def to_s
|
|
142
|
+
class_name = self.class.name.split('::').last
|
|
143
|
+
"<#{class_name} version: #{@version}, type: #{@type}, authentication_value:"\
|
|
144
|
+
" #{@authentication_value}, eci: #{@eci}, transaction_id: #{@transaction_id},"\
|
|
145
|
+
" cryptogram_algorithm: #{@cryptogram_algorithm}, challenge_preference:"\
|
|
146
|
+
" #{@challenge_preference}, authentication_flow: #{@authentication_flow}, network_score:"\
|
|
147
|
+
" #{@network_score}, brand: #{@brand}>"
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
151
|
+
def inspect
|
|
152
|
+
class_name = self.class.name.split('::').last
|
|
153
|
+
"<#{class_name} version: #{@version.inspect}, type: #{@type.inspect}, authentication_value:"\
|
|
154
|
+
" #{@authentication_value.inspect}, eci: #{@eci.inspect}, transaction_id:"\
|
|
155
|
+
" #{@transaction_id.inspect}, cryptogram_algorithm: #{@cryptogram_algorithm.inspect},"\
|
|
156
|
+
" challenge_preference: #{@challenge_preference.inspect}, authentication_flow:"\
|
|
157
|
+
" #{@authentication_flow.inspect}, network_score: #{@network_score.inspect}, brand:"\
|
|
158
|
+
" #{@brand.inspect}>"
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# AuthorizationActionList Model.
|
|
8
|
+
class AuthorizationActionList < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Cancel the payment. See [details](../payments-lifecycle/cancel)
|
|
13
|
+
# @return [PaymentsActionCancel]
|
|
14
|
+
attr_accessor :cancel_payment
|
|
15
|
+
|
|
16
|
+
# Fully settle the payment. See [details](../payments-lifecycle/settle)
|
|
17
|
+
# @return [PaymentsActionSettle]
|
|
18
|
+
attr_accessor :settle_payment
|
|
19
|
+
|
|
20
|
+
# Partially settle the payment. See
|
|
21
|
+
# [details](../payments-lifecycle/partialsettle) including what to add in
|
|
22
|
+
# the request body.
|
|
23
|
+
# @return [PaymentsActionPartialSettle]
|
|
24
|
+
attr_accessor :partially_settle_payment
|
|
25
|
+
|
|
26
|
+
# A mapping from model property names to API property names.
|
|
27
|
+
def self.names
|
|
28
|
+
@_hash = {} if @_hash.nil?
|
|
29
|
+
@_hash['cancel_payment'] = 'cancelPayment'
|
|
30
|
+
@_hash['settle_payment'] = 'settlePayment'
|
|
31
|
+
@_hash['partially_settle_payment'] = 'partiallySettlePayment'
|
|
32
|
+
@_hash
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for optional fields
|
|
36
|
+
def self.optionals
|
|
37
|
+
%w[
|
|
38
|
+
cancel_payment
|
|
39
|
+
settle_payment
|
|
40
|
+
partially_settle_payment
|
|
41
|
+
]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for nullable fields
|
|
45
|
+
def self.nullables
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def initialize(cancel_payment = SKIP, settle_payment = SKIP,
|
|
50
|
+
partially_settle_payment = SKIP)
|
|
51
|
+
@cancel_payment = cancel_payment unless cancel_payment == SKIP
|
|
52
|
+
@settle_payment = settle_payment unless settle_payment == SKIP
|
|
53
|
+
@partially_settle_payment = partially_settle_payment unless partially_settle_payment == SKIP
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
cancel_payment = PaymentsActionCancel.from_hash(hash['cancelPayment']) if
|
|
62
|
+
hash['cancelPayment']
|
|
63
|
+
settle_payment = PaymentsActionSettle.from_hash(hash['settlePayment']) if
|
|
64
|
+
hash['settlePayment']
|
|
65
|
+
if hash['partiallySettlePayment']
|
|
66
|
+
partially_settle_payment = PaymentsActionPartialSettle.from_hash(hash['partiallySettlePayment'])
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Create object from extracted values.
|
|
70
|
+
AuthorizationActionList.new(cancel_payment,
|
|
71
|
+
settle_payment,
|
|
72
|
+
partially_settle_payment)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Provides a human-readable string representation of the object.
|
|
76
|
+
def to_s
|
|
77
|
+
class_name = self.class.name.split('::').last
|
|
78
|
+
"<#{class_name} cancel_payment: #{@cancel_payment}, settle_payment: #{@settle_payment},"\
|
|
79
|
+
" partially_settle_payment: #{@partially_settle_payment}>"
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
83
|
+
def inspect
|
|
84
|
+
class_name = self.class.name.split('::').last
|
|
85
|
+
"<#{class_name} cancel_payment: #{@cancel_payment.inspect}, settle_payment:"\
|
|
86
|
+
" #{@settle_payment.inspect}, partially_settle_payment:"\
|
|
87
|
+
" #{@partially_settle_payment.inspect}>"
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# AuthorizationFailed Model.
|
|
8
|
+
class AuthorizationFailed < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Your authorization request failed.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :event_name
|
|
15
|
+
|
|
16
|
+
# The ISO 8601 date-time at which the event was created.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :timestamp
|
|
19
|
+
|
|
20
|
+
# All Failed events return error object with name and message.
|
|
21
|
+
# @return [Error]
|
|
22
|
+
attr_accessor :error
|
|
23
|
+
|
|
24
|
+
# Unique identifier generated by us for a single instance of an interaction
|
|
25
|
+
# (command) with the Worldpay API.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :command_id
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['event_name'] = 'eventName'
|
|
33
|
+
@_hash['timestamp'] = 'timestamp'
|
|
34
|
+
@_hash['error'] = 'error'
|
|
35
|
+
@_hash['command_id'] = 'commandId'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
timestamp
|
|
43
|
+
error
|
|
44
|
+
command_id
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(timestamp = SKIP, error = SKIP, command_id = SKIP)
|
|
54
|
+
@event_name = 'authorizationFailed'
|
|
55
|
+
@timestamp = timestamp unless timestamp == SKIP
|
|
56
|
+
@error = error unless error == SKIP
|
|
57
|
+
@command_id = command_id unless command_id == SKIP
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
|
66
|
+
error = Error.from_hash(hash['error']) if hash['error']
|
|
67
|
+
command_id = hash.key?('commandId') ? hash['commandId'] : SKIP
|
|
68
|
+
|
|
69
|
+
# Create object from extracted values.
|
|
70
|
+
AuthorizationFailed.new(timestamp,
|
|
71
|
+
error,
|
|
72
|
+
command_id)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Validates an instance of the object from a given value.
|
|
76
|
+
# @param [AuthorizationFailed | Hash] The value against the validation is performed.
|
|
77
|
+
def self.validate(value)
|
|
78
|
+
if value.instance_of? self
|
|
79
|
+
return APIHelper.valid_type?(value.event_name,
|
|
80
|
+
->(val) { val.instance_of? String })
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
return false unless value.instance_of? Hash
|
|
84
|
+
|
|
85
|
+
APIHelper.valid_type?(value['eventName'],
|
|
86
|
+
->(val) { val.instance_of? String })
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a human-readable string representation of the object.
|
|
90
|
+
def to_s
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} event_name: #{@event_name}, timestamp: #{@timestamp}, error: #{@error},"\
|
|
93
|
+
" command_id: #{@command_id}>"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
97
|
+
def inspect
|
|
98
|
+
class_name = self.class.name.split('::').last
|
|
99
|
+
"<#{class_name} event_name: #{@event_name.inspect}, timestamp: #{@timestamp.inspect},"\
|
|
100
|
+
" error: #{@error.inspect}, command_id: #{@command_id.inspect}>"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# payments
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Payments
|
|
7
|
+
# AuthorizationRefused Model.
|
|
8
|
+
class AuthorizationRefused < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Your authorization request was refused by the card issuer.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :event_name
|
|
15
|
+
|
|
16
|
+
# The ISO 8601 date-time at which the event was created.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :timestamp
|
|
19
|
+
|
|
20
|
+
# Outcome of the event. For every requested event there can be a successful
|
|
21
|
+
# or refused event outcome.
|
|
22
|
+
# @return [Outcome17Enum]
|
|
23
|
+
attr_accessor :outcome
|
|
24
|
+
|
|
25
|
+
# The response code, used to identify the refusal reason.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :code
|
|
28
|
+
|
|
29
|
+
# The description of the refusal reason.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :description
|
|
32
|
+
|
|
33
|
+
# Unique identifier generated by us for a single instance of an interaction
|
|
34
|
+
# (command) with the Worldpay API.
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :command_id
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['event_name'] = 'eventName'
|
|
42
|
+
@_hash['timestamp'] = 'timestamp'
|
|
43
|
+
@_hash['outcome'] = 'outcome'
|
|
44
|
+
@_hash['code'] = 'code'
|
|
45
|
+
@_hash['description'] = 'description'
|
|
46
|
+
@_hash['command_id'] = 'commandId'
|
|
47
|
+
@_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for optional fields
|
|
51
|
+
def self.optionals
|
|
52
|
+
%w[
|
|
53
|
+
timestamp
|
|
54
|
+
outcome
|
|
55
|
+
code
|
|
56
|
+
description
|
|
57
|
+
command_id
|
|
58
|
+
]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# An array for nullable fields
|
|
62
|
+
def self.nullables
|
|
63
|
+
[]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def initialize(timestamp = SKIP, outcome = SKIP, code = SKIP,
|
|
67
|
+
description = SKIP, command_id = SKIP)
|
|
68
|
+
@event_name = 'authorizationRefused'
|
|
69
|
+
@timestamp = timestamp unless timestamp == SKIP
|
|
70
|
+
@outcome = outcome unless outcome == SKIP
|
|
71
|
+
@code = code unless code == SKIP
|
|
72
|
+
@description = description unless description == SKIP
|
|
73
|
+
@command_id = command_id unless command_id == SKIP
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Creates an instance of the object from a hash.
|
|
77
|
+
def self.from_hash(hash)
|
|
78
|
+
return nil unless hash
|
|
79
|
+
|
|
80
|
+
# Extract variables from the hash.
|
|
81
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
|
82
|
+
outcome = hash.key?('outcome') ? hash['outcome'] : SKIP
|
|
83
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
|
84
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
|
85
|
+
command_id = hash.key?('commandId') ? hash['commandId'] : SKIP
|
|
86
|
+
|
|
87
|
+
# Create object from extracted values.
|
|
88
|
+
AuthorizationRefused.new(timestamp,
|
|
89
|
+
outcome,
|
|
90
|
+
code,
|
|
91
|
+
description,
|
|
92
|
+
command_id)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Validates an instance of the object from a given value.
|
|
96
|
+
# @param [AuthorizationRefused | Hash] The value against the validation is performed.
|
|
97
|
+
def self.validate(value)
|
|
98
|
+
if value.instance_of? self
|
|
99
|
+
return APIHelper.valid_type?(value.event_name,
|
|
100
|
+
->(val) { val.instance_of? String })
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
return false unless value.instance_of? Hash
|
|
104
|
+
|
|
105
|
+
APIHelper.valid_type?(value['eventName'],
|
|
106
|
+
->(val) { val.instance_of? String })
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a human-readable string representation of the object.
|
|
110
|
+
def to_s
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} event_name: #{@event_name}, timestamp: #{@timestamp}, outcome: #{@outcome},"\
|
|
113
|
+
" code: #{@code}, description: #{@description}, command_id: #{@command_id}>"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
117
|
+
def inspect
|
|
118
|
+
class_name = self.class.name.split('::').last
|
|
119
|
+
"<#{class_name} event_name: #{@event_name.inspect}, timestamp: #{@timestamp.inspect},"\
|
|
120
|
+
" outcome: #{@outcome.inspect}, code: #{@code.inspect}, description:"\
|
|
121
|
+
" #{@description.inspect}, command_id: #{@command_id.inspect}>"
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|