yapstone-payments 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +79 -0
- data/README.md +203 -0
- data/Rakefile +10 -0
- data/docs/APM.md +29 -0
- data/docs/APMSpecInParameters.md +19 -0
- data/docs/Action.md +16 -0
- data/docs/Address.md +29 -0
- data/docs/Amount.md +21 -0
- data/docs/AuthResponse.md +19 -0
- data/docs/AuthTokenRequest.md +19 -0
- data/docs/AuthTokenResponse.md +17 -0
- data/docs/AuthenticationApi.md +58 -0
- data/docs/BankAccount.md +37 -0
- data/docs/BillingAddress.md +29 -0
- data/docs/BookingInfo.md +31 -0
- data/docs/CapturePaymentRequest.md +21 -0
- data/docs/Card.md +27 -0
- data/docs/CardResponse.md +21 -0
- data/docs/Consent.md +21 -0
- data/docs/CreditCardAuthResponse.md +25 -0
- data/docs/Customer.md +29 -0
- data/docs/CustomerData.md +19 -0
- data/docs/CustomerDetails.md +23 -0
- data/docs/Deposit.md +23 -0
- data/docs/DepositDetails.md +17 -0
- data/docs/DisburseLineItemsReq.md +19 -0
- data/docs/DisburseTransaction.md +19 -0
- data/docs/DisburseTransactionReq.md +17 -0
- data/docs/Disbursement.md +17 -0
- data/docs/DisbursementAllOf.md +17 -0
- data/docs/DisbursementDetails.md +17 -0
- data/docs/DisbursementRequest.md +16 -0
- data/docs/DisbursementRequests.md +17 -0
- data/docs/DisbursementResponse.md +17 -0
- data/docs/DisbursementsApi.md +138 -0
- data/docs/Error.md +25 -0
- data/docs/ErrorResponse.md +19 -0
- data/docs/Fields.md +17 -0
- data/docs/GovIdentification.md +29 -0
- data/docs/Guest.md +29 -0
- data/docs/GuestInfoResponse.md +19 -0
- data/docs/Href.md +17 -0
- data/docs/InlineResponse200.md +25 -0
- data/docs/InstallmentPlan.md +19 -0
- data/docs/Instrument.md +21 -0
- data/docs/InstrumentVerificationResponse.md +31 -0
- data/docs/KYC.md +21 -0
- data/docs/LeaseInfo.md +21 -0
- data/docs/LineItemDetails.md +25 -0
- data/docs/MarketplaceData.md +23 -0
- data/docs/Merketplace.md +17 -0
- data/docs/Money.md +19 -0
- data/docs/Name.md +27 -0
- data/docs/OfferingDetails.md +21 -0
- data/docs/OrderTransactions.md +25 -0
- data/docs/Payment.md +21 -0
- data/docs/PaymentCancelResponse.md +23 -0
- data/docs/PaymentCancelTransactionResponse.md +21 -0
- data/docs/PaymentDetails.md +29 -0
- data/docs/PaymentInstrument.md +27 -0
- data/docs/PaymentInstrumentCard.md +19 -0
- data/docs/PaymentInstrumentResponse.md +19 -0
- data/docs/PaymentPayment.md +27 -0
- data/docs/PaymentPaymentAllOf.md +27 -0
- data/docs/PaymentResponse.md +33 -0
- data/docs/PaymentsApi.md +447 -0
- data/docs/Phone.md +21 -0
- data/docs/ProcessPayment.md +29 -0
- data/docs/PropertyInfo.md +21 -0
- data/docs/PropertyInfoResponse.md +19 -0
- data/docs/RefundAction.md +16 -0
- data/docs/RefundCancelResponse.md +21 -0
- data/docs/RefundCancelTransactionResponse.md +19 -0
- data/docs/RefundRequest.md +25 -0
- data/docs/RefundResponse.md +29 -0
- data/docs/RefundStatus.md +16 -0
- data/docs/RefundTransactions.md +27 -0
- data/docs/RefundsApi.md +378 -0
- data/docs/RentalInfo.md +21 -0
- data/docs/Renter.md +29 -0
- data/docs/Resolution.md +17 -0
- data/docs/Result.md +21 -0
- data/docs/RiskStatus.md +17 -0
- data/docs/SanctionedEntities.md +19 -0
- data/docs/SearchApi.md +132 -0
- data/docs/SearchPaymentResponse.md +17 -0
- data/docs/StackTraceElement.md +25 -0
- data/docs/Status.md +16 -0
- data/docs/Throwable.md +21 -0
- data/docs/ToEntityRef.md +19 -0
- data/docs/Token.md +19 -0
- data/docs/TokenApi.md +134 -0
- data/docs/TokenReq.md +19 -0
- data/docs/TokenRequest.md +17 -0
- data/docs/TokenResponse.md +17 -0
- data/docs/Transaction.md +21 -0
- data/docs/TransactionResponse.md +27 -0
- data/docs/Triggers.md +21 -0
- data/docs/VacationRentalInfo.md +19 -0
- data/docs/VacationRentalInfoRequest.md +21 -0
- data/docs/VerifyInstrumentRequest.md +21 -0
- data/git_push.sh +55 -0
- data/lib/yapstone-payments.rb +137 -0
- data/lib/yapstone-payments/api/authentication_api.rb +92 -0
- data/lib/yapstone-payments/api/disbursements_api.rb +202 -0
- data/lib/yapstone-payments/api/payments_api.rb +598 -0
- data/lib/yapstone-payments/api/refunds_api.rb +507 -0
- data/lib/yapstone-payments/api/search_api.rb +187 -0
- data/lib/yapstone-payments/api/token_api.rb +182 -0
- data/lib/yapstone-payments/api_client.rb +386 -0
- data/lib/yapstone-payments/api_error.rb +57 -0
- data/lib/yapstone-payments/configuration.rb +249 -0
- data/lib/yapstone-payments/models/action.rb +39 -0
- data/lib/yapstone-payments/models/address.rb +258 -0
- data/lib/yapstone-payments/models/amount.rb +218 -0
- data/lib/yapstone-payments/models/apm.rb +292 -0
- data/lib/yapstone-payments/models/apm_spec_in_parameters.rb +208 -0
- data/lib/yapstone-payments/models/auth_response.rb +217 -0
- data/lib/yapstone-payments/models/auth_token_request.rb +205 -0
- data/lib/yapstone-payments/models/auth_token_response.rb +196 -0
- data/lib/yapstone-payments/models/bank_account.rb +347 -0
- data/lib/yapstone-payments/models/billing_address.rb +258 -0
- data/lib/yapstone-payments/models/booking_info.rb +266 -0
- data/lib/yapstone-payments/models/capture_payment_request.rb +252 -0
- data/lib/yapstone-payments/models/card.rb +247 -0
- data/lib/yapstone-payments/models/card_response.rb +217 -0
- data/lib/yapstone-payments/models/consent.rb +248 -0
- data/lib/yapstone-payments/models/credit_card_auth_response.rb +267 -0
- data/lib/yapstone-payments/models/customer.rb +256 -0
- data/lib/yapstone-payments/models/customer_data.rb +208 -0
- data/lib/yapstone-payments/models/customer_details.rb +226 -0
- data/lib/yapstone-payments/models/deposit.rb +228 -0
- data/lib/yapstone-payments/models/deposit_details.rb +199 -0
- data/lib/yapstone-payments/models/disburse_line_items_req.rb +208 -0
- data/lib/yapstone-payments/models/disburse_transaction.rb +208 -0
- data/lib/yapstone-payments/models/disburse_transaction_req.rb +199 -0
- data/lib/yapstone-payments/models/disbursement.rb +203 -0
- data/lib/yapstone-payments/models/disbursement_all_of.rb +197 -0
- data/lib/yapstone-payments/models/disbursement_details.rb +200 -0
- data/lib/yapstone-payments/models/disbursement_request.rb +187 -0
- data/lib/yapstone-payments/models/disbursement_requests.rb +198 -0
- data/lib/yapstone-payments/models/disbursement_response.rb +198 -0
- data/lib/yapstone-payments/models/error.rb +241 -0
- data/lib/yapstone-payments/models/error_response.rb +218 -0
- data/lib/yapstone-payments/models/fields.rb +196 -0
- data/lib/yapstone-payments/models/gov_identification.rb +292 -0
- data/lib/yapstone-payments/models/guest.rb +257 -0
- data/lib/yapstone-payments/models/guest_info_response.rb +208 -0
- data/lib/yapstone-payments/models/href.rb +196 -0
- data/lib/yapstone-payments/models/inline_response200.rb +232 -0
- data/lib/yapstone-payments/models/installment_plan.rb +208 -0
- data/lib/yapstone-payments/models/instrument.rb +250 -0
- data/lib/yapstone-payments/models/instrument_verification_response.rb +260 -0
- data/lib/yapstone-payments/models/kyc.rb +215 -0
- data/lib/yapstone-payments/models/lease_info.rb +218 -0
- data/lib/yapstone-payments/models/line_item_details.rb +236 -0
- data/lib/yapstone-payments/models/marketplace_data.rb +260 -0
- data/lib/yapstone-payments/models/merketplace.rb +197 -0
- data/lib/yapstone-payments/models/money.rb +207 -0
- data/lib/yapstone-payments/models/name.rb +248 -0
- data/lib/yapstone-payments/models/offering_details.rb +216 -0
- data/lib/yapstone-payments/models/order_transactions.rb +235 -0
- data/lib/yapstone-payments/models/payment.rb +216 -0
- data/lib/yapstone-payments/models/payment_cancel_response.rb +227 -0
- data/lib/yapstone-payments/models/payment_cancel_transaction_response.rb +218 -0
- data/lib/yapstone-payments/models/payment_details.rb +319 -0
- data/lib/yapstone-payments/models/payment_instrument.rb +277 -0
- data/lib/yapstone-payments/models/payment_instrument_card.rb +241 -0
- data/lib/yapstone-payments/models/payment_instrument_response.rb +205 -0
- data/lib/yapstone-payments/models/payment_payment.rb +257 -0
- data/lib/yapstone-payments/models/payment_payment_all_of.rb +250 -0
- data/lib/yapstone-payments/models/payment_response.rb +275 -0
- data/lib/yapstone-payments/models/phone.rb +218 -0
- data/lib/yapstone-payments/models/process_payment.rb +304 -0
- data/lib/yapstone-payments/models/property_info.rb +216 -0
- data/lib/yapstone-payments/models/property_info_response.rb +207 -0
- data/lib/yapstone-payments/models/refund_action.rb +35 -0
- data/lib/yapstone-payments/models/refund_cancel_response.rb +217 -0
- data/lib/yapstone-payments/models/refund_cancel_transaction_response.rb +207 -0
- data/lib/yapstone-payments/models/refund_request.rb +285 -0
- data/lib/yapstone-payments/models/refund_response.rb +253 -0
- data/lib/yapstone-payments/models/refund_status.rb +90 -0
- data/lib/yapstone-payments/models/refund_transactions.rb +245 -0
- data/lib/yapstone-payments/models/rental_info.rb +215 -0
- data/lib/yapstone-payments/models/renter.rb +254 -0
- data/lib/yapstone-payments/models/resolution.rb +196 -0
- data/lib/yapstone-payments/models/result.rb +218 -0
- data/lib/yapstone-payments/models/risk_status.rb +196 -0
- data/lib/yapstone-payments/models/sanctioned_entities.rb +207 -0
- data/lib/yapstone-payments/models/search_payment_response.rb +196 -0
- data/lib/yapstone-payments/models/stack_trace_element.rb +238 -0
- data/lib/yapstone-payments/models/status.rb +91 -0
- data/lib/yapstone-payments/models/throwable.rb +220 -0
- data/lib/yapstone-payments/models/to_entity_ref.rb +207 -0
- data/lib/yapstone-payments/models/token.rb +207 -0
- data/lib/yapstone-payments/models/token_req.rb +206 -0
- data/lib/yapstone-payments/models/token_request.rb +196 -0
- data/lib/yapstone-payments/models/token_response.rb +196 -0
- data/lib/yapstone-payments/models/transaction.rb +218 -0
- data/lib/yapstone-payments/models/transaction_response.rb +248 -0
- data/lib/yapstone-payments/models/triggers.rb +216 -0
- data/lib/yapstone-payments/models/vacation_rental_info.rb +205 -0
- data/lib/yapstone-payments/models/vacation_rental_info_request.rb +215 -0
- data/lib/yapstone-payments/models/verify_instrument_request.rb +215 -0
- data/lib/yapstone-payments/version.rb +15 -0
- data/spec/api/authentication_api_spec.rb +48 -0
- data/spec/api/disbursements_api_spec.rb +69 -0
- data/spec/api/payments_api_spec.rb +146 -0
- data/spec/api/refunds_api_spec.rb +127 -0
- data/spec/api/search_api_spec.rb +66 -0
- data/spec/api/token_api_spec.rb +67 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +35 -0
- data/spec/models/address_spec.rb +77 -0
- data/spec/models/amount_spec.rb +53 -0
- data/spec/models/apm_spec.rb +81 -0
- data/spec/models/apm_spec_in_parameters_spec.rb +47 -0
- data/spec/models/auth_response_spec.rb +47 -0
- data/spec/models/auth_token_request_spec.rb +47 -0
- data/spec/models/auth_token_response_spec.rb +41 -0
- data/spec/models/bank_account_spec.rb +105 -0
- data/spec/models/billing_address_spec.rb +77 -0
- data/spec/models/booking_info_spec.rb +83 -0
- data/spec/models/capture_payment_request_spec.rb +57 -0
- data/spec/models/card_response_spec.rb +53 -0
- data/spec/models/card_spec.rb +71 -0
- data/spec/models/consent_spec.rb +57 -0
- data/spec/models/credit_card_auth_response_spec.rb +69 -0
- data/spec/models/customer_data_spec.rb +47 -0
- data/spec/models/customer_details_spec.rb +59 -0
- data/spec/models/customer_spec.rb +77 -0
- data/spec/models/deposit_details_spec.rb +41 -0
- data/spec/models/deposit_spec.rb +59 -0
- data/spec/models/disburse_line_items_req_spec.rb +47 -0
- data/spec/models/disburse_transaction_req_spec.rb +41 -0
- data/spec/models/disburse_transaction_spec.rb +47 -0
- data/spec/models/disbursement_all_of_spec.rb +41 -0
- data/spec/models/disbursement_details_spec.rb +41 -0
- data/spec/models/disbursement_request_spec.rb +35 -0
- data/spec/models/disbursement_requests_spec.rb +41 -0
- data/spec/models/disbursement_response_spec.rb +41 -0
- data/spec/models/disbursement_spec.rb +41 -0
- data/spec/models/error_response_spec.rb +47 -0
- data/spec/models/error_spec.rb +65 -0
- data/spec/models/fields_spec.rb +41 -0
- data/spec/models/gov_identification_spec.rb +81 -0
- data/spec/models/guest_info_response_spec.rb +47 -0
- data/spec/models/guest_spec.rb +77 -0
- data/spec/models/href_spec.rb +41 -0
- data/spec/models/inline_response200_spec.rb +65 -0
- data/spec/models/installment_plan_spec.rb +47 -0
- data/spec/models/instrument_spec.rb +57 -0
- data/spec/models/instrument_verification_response_spec.rb +83 -0
- data/spec/models/kyc_spec.rb +53 -0
- data/spec/models/lease_info_spec.rb +53 -0
- data/spec/models/line_item_details_spec.rb +65 -0
- data/spec/models/marketplace_data_spec.rb +63 -0
- data/spec/models/merketplace_spec.rb +41 -0
- data/spec/models/money_spec.rb +47 -0
- data/spec/models/name_spec.rb +71 -0
- data/spec/models/offering_details_spec.rb +53 -0
- data/spec/models/order_transactions_spec.rb +65 -0
- data/spec/models/payment_cancel_response_spec.rb +59 -0
- data/spec/models/payment_cancel_transaction_response_spec.rb +53 -0
- data/spec/models/payment_details_spec.rb +81 -0
- data/spec/models/payment_instrument_card_spec.rb +51 -0
- data/spec/models/payment_instrument_response_spec.rb +47 -0
- data/spec/models/payment_instrument_spec.rb +75 -0
- data/spec/models/payment_payment_all_of_spec.rb +71 -0
- data/spec/models/payment_payment_spec.rb +71 -0
- data/spec/models/payment_response_spec.rb +89 -0
- data/spec/models/payment_spec.rb +53 -0
- data/spec/models/phone_spec.rb +53 -0
- data/spec/models/process_payment_spec.rb +77 -0
- data/spec/models/property_info_response_spec.rb +47 -0
- data/spec/models/property_info_spec.rb +53 -0
- data/spec/models/refund_action_spec.rb +35 -0
- data/spec/models/refund_cancel_response_spec.rb +53 -0
- data/spec/models/refund_cancel_transaction_response_spec.rb +47 -0
- data/spec/models/refund_request_spec.rb +65 -0
- data/spec/models/refund_response_spec.rb +77 -0
- data/spec/models/refund_status_spec.rb +35 -0
- data/spec/models/refund_transactions_spec.rb +71 -0
- data/spec/models/rental_info_spec.rb +53 -0
- data/spec/models/renter_spec.rb +77 -0
- data/spec/models/resolution_spec.rb +41 -0
- data/spec/models/result_spec.rb +53 -0
- data/spec/models/risk_status_spec.rb +41 -0
- data/spec/models/sanctioned_entities_spec.rb +47 -0
- data/spec/models/search_payment_response_spec.rb +41 -0
- data/spec/models/stack_trace_element_spec.rb +65 -0
- data/spec/models/status_spec.rb +35 -0
- data/spec/models/throwable_spec.rb +53 -0
- data/spec/models/to_entity_ref_spec.rb +47 -0
- data/spec/models/token_req_spec.rb +47 -0
- data/spec/models/token_request_spec.rb +41 -0
- data/spec/models/token_response_spec.rb +41 -0
- data/spec/models/token_spec.rb +47 -0
- data/spec/models/transaction_response_spec.rb +71 -0
- data/spec/models/transaction_spec.rb +53 -0
- data/spec/models/triggers_spec.rb +53 -0
- data/spec/models/vacation_rental_info_request_spec.rb +53 -0
- data/spec/models/vacation_rental_info_spec.rb +47 -0
- data/spec/models/verify_instrument_request_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- data/yapstone-payments.gemspec +45 -0
- metadata +633 -0
@@ -0,0 +1,250 @@
|
|
1
|
+
=begin
|
2
|
+
#Payments Orchestrator
|
3
|
+
|
4
|
+
#\"REST API for Payments Orchestrator\"
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.6.4-SNAPSHOT
|
7
|
+
Contact: test@yapstone.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Yapstone
|
16
|
+
# A payment instrument is whatever the customer wants to pay with, for example a credit card, or a bank account number where money can be withdrawn from.
|
17
|
+
class Instrument
|
18
|
+
# The type of payment instrument being used for the payment.
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
attr_accessor :bank
|
22
|
+
|
23
|
+
attr_accessor :card
|
24
|
+
|
25
|
+
class EnumAttributeValidator
|
26
|
+
attr_reader :datatype
|
27
|
+
attr_reader :allowable_values
|
28
|
+
|
29
|
+
def initialize(datatype, allowable_values)
|
30
|
+
@allowable_values = allowable_values.map do |value|
|
31
|
+
case datatype.to_s
|
32
|
+
when /Integer/i
|
33
|
+
value.to_i
|
34
|
+
when /Float/i
|
35
|
+
value.to_f
|
36
|
+
else
|
37
|
+
value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def valid?(value)
|
43
|
+
!value || allowable_values.include?(value)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'type' => :'type',
|
51
|
+
:'bank' => :'bank',
|
52
|
+
:'card' => :'card'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'type' => :'String',
|
60
|
+
:'bank' => :'BankAccount',
|
61
|
+
:'card' => :'Card'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Initializes the object
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
+
def initialize(attributes = {})
|
68
|
+
if (!attributes.is_a?(Hash))
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::Instrument` initialize method"
|
70
|
+
end
|
71
|
+
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
74
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::Instrument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
76
|
+
end
|
77
|
+
h[k.to_sym] = v
|
78
|
+
}
|
79
|
+
|
80
|
+
if attributes.key?(:'type')
|
81
|
+
self.type = attributes[:'type']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'bank')
|
85
|
+
self.bank = attributes[:'bank']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'card')
|
89
|
+
self.card = attributes[:'card']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
invalid_properties = Array.new
|
97
|
+
invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
type_validator = EnumAttributeValidator.new('String', ["CARD", "BANK"])
|
104
|
+
return false unless type_validator.valid?(@type)
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Custom attribute writer method checking allowed values (enum).
|
109
|
+
# @param [Object] type Object to be assigned
|
110
|
+
def type=(type)
|
111
|
+
validator = EnumAttributeValidator.new('String', ["CARD", "BANK"])
|
112
|
+
unless validator.valid?(type)
|
113
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
114
|
+
end
|
115
|
+
@type = type
|
116
|
+
end
|
117
|
+
|
118
|
+
# Checks equality by comparing each attribute.
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def ==(o)
|
121
|
+
return true if self.equal?(o)
|
122
|
+
self.class == o.class &&
|
123
|
+
type == o.type &&
|
124
|
+
bank == o.bank &&
|
125
|
+
card == o.card
|
126
|
+
end
|
127
|
+
|
128
|
+
# @see the `==` method
|
129
|
+
# @param [Object] Object to be compared
|
130
|
+
def eql?(o)
|
131
|
+
self == o
|
132
|
+
end
|
133
|
+
|
134
|
+
# Calculates hash code according to all attributes.
|
135
|
+
# @return [Integer] Hash code
|
136
|
+
def hash
|
137
|
+
[type, bank, card].hash
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def self.build_from_hash(attributes)
|
144
|
+
new.build_from_hash(attributes)
|
145
|
+
end
|
146
|
+
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
150
|
+
def build_from_hash(attributes)
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
153
|
+
if type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
158
|
+
end
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
161
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
171
|
+
def _deserialize(type, value)
|
172
|
+
case type.to_sym
|
173
|
+
when :DateTime
|
174
|
+
DateTime.parse(value)
|
175
|
+
when :Date
|
176
|
+
Date.parse(value)
|
177
|
+
when :String
|
178
|
+
value.to_s
|
179
|
+
when :Integer
|
180
|
+
value.to_i
|
181
|
+
when :Float
|
182
|
+
value.to_f
|
183
|
+
when :Boolean
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
+
true
|
186
|
+
else
|
187
|
+
false
|
188
|
+
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each do |k, v|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
else # model
|
204
|
+
Yapstone.const_get(type).build_from_hash(value)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the string representation of the object
|
209
|
+
# @return [String] String presentation of the object
|
210
|
+
def to_s
|
211
|
+
to_hash.to_s
|
212
|
+
end
|
213
|
+
|
214
|
+
# to_body is an alias to to_hash (backward compatibility)
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_body
|
217
|
+
to_hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the object in the form of hash
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_hash
|
223
|
+
hash = {}
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
225
|
+
value = self.send(attr)
|
226
|
+
next if value.nil?
|
227
|
+
hash[param] = _to_hash(value)
|
228
|
+
end
|
229
|
+
hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Outputs non-array value in the form of hash
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
234
|
+
# @param [Object] value Any valid value
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
236
|
+
def _to_hash(value)
|
237
|
+
if value.is_a?(Array)
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
239
|
+
elsif value.is_a?(Hash)
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
242
|
+
end
|
243
|
+
elsif value.respond_to? :to_hash
|
244
|
+
value.to_hash
|
245
|
+
else
|
246
|
+
value
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
@@ -0,0 +1,260 @@
|
|
1
|
+
=begin
|
2
|
+
#Payments Orchestrator
|
3
|
+
|
4
|
+
#\"REST API for Payments Orchestrator\"
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.6.4-SNAPSHOT
|
7
|
+
Contact: test@yapstone.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Yapstone
|
16
|
+
# An instrument is what a customer is paying with. For example a payment instrument can be a credit card. Instrument verification is about determining whether the cardholder (instrument owner) legitimately is the owner of the card (instrument).
|
17
|
+
class InstrumentVerificationResponse
|
18
|
+
attr_accessor :client_correlation_id
|
19
|
+
|
20
|
+
attr_accessor :client_unique_transaction_id
|
21
|
+
|
22
|
+
attr_accessor :verification_id
|
23
|
+
|
24
|
+
attr_accessor :instrument_id
|
25
|
+
|
26
|
+
attr_accessor :status
|
27
|
+
|
28
|
+
attr_accessor :result
|
29
|
+
|
30
|
+
attr_accessor :token
|
31
|
+
|
32
|
+
attr_accessor :auth_response
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'client_correlation_id' => :'clientCorrelationId',
|
38
|
+
:'client_unique_transaction_id' => :'clientUniqueTransactionId',
|
39
|
+
:'verification_id' => :'verificationId',
|
40
|
+
:'instrument_id' => :'instrumentId',
|
41
|
+
:'status' => :'status',
|
42
|
+
:'result' => :'result',
|
43
|
+
:'token' => :'token',
|
44
|
+
:'auth_response' => :'authResponse'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.openapi_types
|
50
|
+
{
|
51
|
+
:'client_correlation_id' => :'String',
|
52
|
+
:'client_unique_transaction_id' => :'String',
|
53
|
+
:'verification_id' => :'String',
|
54
|
+
:'instrument_id' => :'String',
|
55
|
+
:'status' => :'String',
|
56
|
+
:'result' => :'String',
|
57
|
+
:'token' => :'Token',
|
58
|
+
:'auth_response' => :'CreditCardAuthResponse'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::InstrumentVerificationResponse` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::InstrumentVerificationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'client_correlation_id')
|
78
|
+
self.client_correlation_id = attributes[:'client_correlation_id']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'client_unique_transaction_id')
|
82
|
+
self.client_unique_transaction_id = attributes[:'client_unique_transaction_id']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'verification_id')
|
86
|
+
self.verification_id = attributes[:'verification_id']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'instrument_id')
|
90
|
+
self.instrument_id = attributes[:'instrument_id']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'status')
|
94
|
+
self.status = attributes[:'status']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'result')
|
98
|
+
self.result = attributes[:'result']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'token')
|
102
|
+
self.token = attributes[:'token']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'auth_response')
|
106
|
+
self.auth_response = attributes[:'auth_response']
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
111
|
+
# @return Array for valid properties with the reasons
|
112
|
+
def list_invalid_properties
|
113
|
+
invalid_properties = Array.new
|
114
|
+
invalid_properties
|
115
|
+
end
|
116
|
+
|
117
|
+
# Check to see if the all the properties in the model are valid
|
118
|
+
# @return true if the model is valid
|
119
|
+
def valid?
|
120
|
+
true
|
121
|
+
end
|
122
|
+
|
123
|
+
# Checks equality by comparing each attribute.
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def ==(o)
|
126
|
+
return true if self.equal?(o)
|
127
|
+
self.class == o.class &&
|
128
|
+
client_correlation_id == o.client_correlation_id &&
|
129
|
+
client_unique_transaction_id == o.client_unique_transaction_id &&
|
130
|
+
verification_id == o.verification_id &&
|
131
|
+
instrument_id == o.instrument_id &&
|
132
|
+
status == o.status &&
|
133
|
+
result == o.result &&
|
134
|
+
token == o.token &&
|
135
|
+
auth_response == o.auth_response
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Integer] Hash code
|
146
|
+
def hash
|
147
|
+
[client_correlation_id, client_unique_transaction_id, verification_id, instrument_id, status, result, token, auth_response].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def self.build_from_hash(attributes)
|
154
|
+
new.build_from_hash(attributes)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
self.class.openapi_types.each_pair do |key, type|
|
163
|
+
if type =~ /\AArray<(.*)>/i
|
164
|
+
# check to ensure the input is an array given that the attribute
|
165
|
+
# is documented as an array but the input is not
|
166
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
167
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
168
|
+
end
|
169
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
172
|
+
end
|
173
|
+
|
174
|
+
self
|
175
|
+
end
|
176
|
+
|
177
|
+
# Deserializes the data based on type
|
178
|
+
# @param string type Data type
|
179
|
+
# @param string value Value to be deserialized
|
180
|
+
# @return [Object] Deserialized data
|
181
|
+
def _deserialize(type, value)
|
182
|
+
case type.to_sym
|
183
|
+
when :DateTime
|
184
|
+
DateTime.parse(value)
|
185
|
+
when :Date
|
186
|
+
Date.parse(value)
|
187
|
+
when :String
|
188
|
+
value.to_s
|
189
|
+
when :Integer
|
190
|
+
value.to_i
|
191
|
+
when :Float
|
192
|
+
value.to_f
|
193
|
+
when :Boolean
|
194
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
195
|
+
true
|
196
|
+
else
|
197
|
+
false
|
198
|
+
end
|
199
|
+
when :Object
|
200
|
+
# generic object (usually a Hash), return directly
|
201
|
+
value
|
202
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
203
|
+
inner_type = Regexp.last_match[:inner_type]
|
204
|
+
value.map { |v| _deserialize(inner_type, v) }
|
205
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
206
|
+
k_type = Regexp.last_match[:k_type]
|
207
|
+
v_type = Regexp.last_match[:v_type]
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each do |k, v|
|
210
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
else # model
|
214
|
+
Yapstone.const_get(type).build_from_hash(value)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
# Returns the string representation of the object
|
219
|
+
# @return [String] String presentation of the object
|
220
|
+
def to_s
|
221
|
+
to_hash.to_s
|
222
|
+
end
|
223
|
+
|
224
|
+
# to_body is an alias to to_hash (backward compatibility)
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_body
|
227
|
+
to_hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Returns the object in the form of hash
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_hash
|
233
|
+
hash = {}
|
234
|
+
self.class.attribute_map.each_pair do |attr, param|
|
235
|
+
value = self.send(attr)
|
236
|
+
next if value.nil?
|
237
|
+
hash[param] = _to_hash(value)
|
238
|
+
end
|
239
|
+
hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Outputs non-array value in the form of hash
|
243
|
+
# For object, use to_hash. Otherwise, just return the value
|
244
|
+
# @param [Object] value Any valid value
|
245
|
+
# @return [Hash] Returns the value in the form of hash
|
246
|
+
def _to_hash(value)
|
247
|
+
if value.is_a?(Array)
|
248
|
+
value.compact.map { |v| _to_hash(v) }
|
249
|
+
elsif value.is_a?(Hash)
|
250
|
+
{}.tap do |hash|
|
251
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
252
|
+
end
|
253
|
+
elsif value.respond_to? :to_hash
|
254
|
+
value.to_hash
|
255
|
+
else
|
256
|
+
value
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|