subfi_pay 0.1.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/Gemfile +11 -0
- data/Gemfile.lock +101 -0
- data/README.md +188 -0
- data/Rakefile +10 -0
- data/bin/console +11 -0
- data/docs/AccessKey.md +32 -0
- data/docs/AccessKeysApi.md +228 -0
- data/docs/AccountAttributes.md +20 -0
- data/docs/AccountAttributesAccount.md +20 -0
- data/docs/AccountCreateRequest.md +18 -0
- data/docs/AccountResponse.md +26 -0
- data/docs/AccountsApi.md +227 -0
- data/docs/BalanceTransactionAttributes.md +30 -0
- data/docs/BalanceTransactionResponse.md +38 -0
- data/docs/BalanceTransactionsApi.md +87 -0
- data/docs/BankAccountProfile.md +28 -0
- data/docs/BillingAddress.md +36 -0
- data/docs/CardProfile.md +42 -0
- data/docs/ChargeAttributes.md +26 -0
- data/docs/ChargeResponse.md +42 -0
- data/docs/ChargesApi.md +167 -0
- data/docs/ConnectedAccountAttributes.md +20 -0
- data/docs/ConnectedAccountResponse.md +26 -0
- data/docs/CreateAccountRequest.md +18 -0
- data/docs/CreateAccountRequestAccount.md +20 -0
- data/docs/CreateCustomerRequest.md +24 -0
- data/docs/CreateWebhookEndpointRequest.md +18 -0
- data/docs/CreateWebhookEndpointRequestWebhookEndpoint.md +28 -0
- data/docs/Customer.md +26 -0
- data/docs/CustomerAttributes.md +24 -0
- data/docs/CustomerAttributesCustomer.md +24 -0
- data/docs/CustomerCreateRequest.md +18 -0
- data/docs/CustomerUpdateAttributes.md +20 -0
- data/docs/CustomerUpdateAttributesCustomer.md +20 -0
- data/docs/CustomerUpdateRequest.md +18 -0
- data/docs/CustomersApi.md +307 -0
- data/docs/Event.md +30 -0
- data/docs/EventsApi.md +159 -0
- data/docs/ListAccessKeysResponse.md +20 -0
- data/docs/ListAccountsResponse.md +20 -0
- data/docs/ListBalanceTransactionsResponse.md +20 -0
- data/docs/ListChargesResponse.md +20 -0
- data/docs/ListCustomersResponse.md +20 -0
- data/docs/ListEventsResponse.md +20 -0
- data/docs/ListPaymentIntentsResponse.md +20 -0
- data/docs/ListPaymentMethodsResponse.md +20 -0
- data/docs/ListRefundsResponse.md +20 -0
- data/docs/ListWebhookEndpointsResponse.md +20 -0
- data/docs/ListWebhookRequestsResponse.md +20 -0
- data/docs/Meta.md +28 -0
- data/docs/PaymentIntentAttributes.md +26 -0
- data/docs/PaymentIntentAttributesPaymentIntent.md +26 -0
- data/docs/PaymentIntentCreateRequest.md +18 -0
- data/docs/PaymentIntentResponse.md +30 -0
- data/docs/PaymentIntentUpdateAttributes.md +18 -0
- data/docs/PaymentIntentUpdateAttributesPaymentIntent.md +18 -0
- data/docs/PaymentIntentsApi.md +533 -0
- data/docs/PaymentMethodAttributes.md +24 -0
- data/docs/PaymentMethodResponse.md +36 -0
- data/docs/PaymentMethodsApi.md +239 -0
- data/docs/RefundAttributes.md +20 -0
- data/docs/RefundResponse.md +30 -0
- data/docs/RefundsApi.md +311 -0
- data/docs/RollAccessKeyAttributes.md +18 -0
- data/docs/RollAccessKeyAttributesAccessKey.md +18 -0
- data/docs/RollAccessKeyRequest.md +18 -0
- data/docs/RollAccessKeyRequestAccessKey.md +18 -0
- data/docs/SubscriptionAttributes.md +30 -0
- data/docs/SubscriptionAttributesSubscription.md +30 -0
- data/docs/SubscriptionCreateRequest.md +18 -0
- data/docs/SubscriptionCreateRequestSubscription.md +30 -0
- data/docs/SubscriptionResponse.md +36 -0
- data/docs/SubscriptionsApi.md +155 -0
- data/docs/WebhookEndpoint.md +34 -0
- data/docs/WebhookEndpointsApi.md +380 -0
- data/docs/WebhookRequest.md +38 -0
- data/docs/WebhookRequestsApi.md +85 -0
- data/git_push.sh +57 -0
- data/lib/subfi_pay/api/access_keys_api.rb +235 -0
- data/lib/subfi_pay/api/accounts_api.rb +231 -0
- data/lib/subfi_pay/api/balance_transactions_api.rb +100 -0
- data/lib/subfi_pay/api/charges_api.rb +181 -0
- data/lib/subfi_pay/api/customers_api.rb +331 -0
- data/lib/subfi_pay/api/events_api.rb +172 -0
- data/lib/subfi_pay/api/payment_intents_api.rb +566 -0
- data/lib/subfi_pay/api/payment_methods_api.rb +262 -0
- data/lib/subfi_pay/api/refunds_api.rb +334 -0
- data/lib/subfi_pay/api/subscriptions_api.rb +177 -0
- data/lib/subfi_pay/api/webhook_endpoints_api.rb +404 -0
- data/lib/subfi_pay/api/webhook_requests_api.rb +97 -0
- data/lib/subfi_pay/api_client.rb +394 -0
- data/lib/subfi_pay/api_error.rb +58 -0
- data/lib/subfi_pay/configuration.rb +305 -0
- data/lib/subfi_pay/models/access_key.rb +275 -0
- data/lib/subfi_pay/models/account_attributes.rb +221 -0
- data/lib/subfi_pay/models/account_attributes_account.rb +221 -0
- data/lib/subfi_pay/models/account_create_request.rb +212 -0
- data/lib/subfi_pay/models/account_response.rb +248 -0
- data/lib/subfi_pay/models/balance_transaction_attributes.rb +266 -0
- data/lib/subfi_pay/models/balance_transaction_response.rb +303 -0
- data/lib/subfi_pay/models/bank_account_profile.rb +257 -0
- data/lib/subfi_pay/models/billing_address.rb +294 -0
- data/lib/subfi_pay/models/card_profile.rb +324 -0
- data/lib/subfi_pay/models/charge_attributes.rb +265 -0
- data/lib/subfi_pay/models/charge_response.rb +326 -0
- data/lib/subfi_pay/models/connected_account_attributes.rb +235 -0
- data/lib/subfi_pay/models/connected_account_response.rb +248 -0
- data/lib/subfi_pay/models/create_account_request.rb +219 -0
- data/lib/subfi_pay/models/create_account_request_account.rb +221 -0
- data/lib/subfi_pay/models/create_customer_request.rb +239 -0
- data/lib/subfi_pay/models/create_webhook_endpoint_request.rb +212 -0
- data/lib/subfi_pay/models/create_webhook_endpoint_request_webhook_endpoint.rb +257 -0
- data/lib/subfi_pay/models/customer.rb +248 -0
- data/lib/subfi_pay/models/customer_attributes.rb +239 -0
- data/lib/subfi_pay/models/customer_attributes_customer.rb +239 -0
- data/lib/subfi_pay/models/customer_create_request.rb +212 -0
- data/lib/subfi_pay/models/customer_update_attributes.rb +221 -0
- data/lib/subfi_pay/models/customer_update_attributes_customer.rb +221 -0
- data/lib/subfi_pay/models/customer_update_request.rb +212 -0
- data/lib/subfi_pay/models/event.rb +266 -0
- data/lib/subfi_pay/models/list_access_keys_response.rb +223 -0
- data/lib/subfi_pay/models/list_accounts_response.rb +223 -0
- data/lib/subfi_pay/models/list_balance_transactions_response.rb +223 -0
- data/lib/subfi_pay/models/list_charges_response.rb +223 -0
- data/lib/subfi_pay/models/list_customers_response.rb +223 -0
- data/lib/subfi_pay/models/list_events_response.rb +223 -0
- data/lib/subfi_pay/models/list_payment_intents_response.rb +223 -0
- data/lib/subfi_pay/models/list_payment_methods_response.rb +223 -0
- data/lib/subfi_pay/models/list_refunds_response.rb +223 -0
- data/lib/subfi_pay/models/list_webhook_endpoints_response.rb +223 -0
- data/lib/subfi_pay/models/list_webhook_requests_response.rb +223 -0
- data/lib/subfi_pay/models/meta.rb +259 -0
- data/lib/subfi_pay/models/payment_intent_attributes.rb +257 -0
- data/lib/subfi_pay/models/payment_intent_attributes_payment_intent.rb +257 -0
- data/lib/subfi_pay/models/payment_intent_create_request.rb +212 -0
- data/lib/subfi_pay/models/payment_intent_response.rb +268 -0
- data/lib/subfi_pay/models/payment_intent_update_attributes.rb +212 -0
- data/lib/subfi_pay/models/payment_intent_update_attributes_payment_intent.rb +214 -0
- data/lib/subfi_pay/models/payment_method_attributes.rb +246 -0
- data/lib/subfi_pay/models/payment_method_response.rb +296 -0
- data/lib/subfi_pay/models/refund_attributes.rb +228 -0
- data/lib/subfi_pay/models/refund_response.rb +268 -0
- data/lib/subfi_pay/models/roll_access_key_attributes.rb +212 -0
- data/lib/subfi_pay/models/roll_access_key_attributes_access_key.rb +219 -0
- data/lib/subfi_pay/models/roll_access_key_request.rb +212 -0
- data/lib/subfi_pay/models/roll_access_key_request_access_key.rb +219 -0
- data/lib/subfi_pay/models/subscription_attributes.rb +266 -0
- data/lib/subfi_pay/models/subscription_attributes_subscription.rb +266 -0
- data/lib/subfi_pay/models/subscription_create_request.rb +212 -0
- data/lib/subfi_pay/models/subscription_create_request_subscription.rb +266 -0
- data/lib/subfi_pay/models/subscription_response.rb +293 -0
- data/lib/subfi_pay/models/webhook_endpoint.rb +284 -0
- data/lib/subfi_pay/models/webhook_request.rb +302 -0
- data/lib/subfi_pay/version.rb +15 -0
- data/lib/subfi_pay.rb +99 -0
- data/run_fix_gemfile.sh +11 -0
- data/spec/api/access_keys_api_spec.rb +138 -0
- data/spec/api/accounts_api_spec.rb +145 -0
- data/spec/api/balance_transactions_api_spec.rb +86 -0
- data/spec/api/charges_api_spec.rb +121 -0
- data/spec/api/customers_api_spec.rb +134 -0
- data/spec/api/events_api_spec.rb +105 -0
- data/spec/api/payment_intents_api_spec.rb +250 -0
- data/spec/api/payment_methods_api_spec.rb +226 -0
- data/spec/api/refunds_api_spec.rb +158 -0
- data/spec/api/subscriptions_api_spec.rb +113 -0
- data/spec/api/webhook_endpoints_api_spec.rb +198 -0
- data/spec/api/webhook_requests_api_spec.rb +79 -0
- data/spec/configuration_spec.rb +23 -0
- data/spec/fixtures/access_keys/list_200.json +1 -0
- data/spec/fixtures/access_keys/roll_200.json +1 -0
- data/spec/fixtures/accounts/create_201.json +1 -0
- data/spec/fixtures/accounts/list_200.json +1 -0
- data/spec/fixtures/accounts/show_200.json +1 -0
- data/spec/fixtures/balance_transactions/list_200.json +69 -0
- data/spec/fixtures/charges/create_201.json +39 -0
- data/spec/fixtures/charges/list_200.json +1 -0
- data/spec/fixtures/charges/retrieve_200.json +1 -0
- data/spec/fixtures/customers/create_201.json +1 -0
- data/spec/fixtures/customers/list_200.json +1 -0
- data/spec/fixtures/customers/show_200.json +1 -0
- data/spec/fixtures/events/list_200.json +1 -0
- data/spec/fixtures/events/show_200.json +1 -0
- data/spec/fixtures/payment_intents/cancel_200.json +1 -0
- data/spec/fixtures/payment_intents/capture_200.json +1 -0
- data/spec/fixtures/payment_intents/confirm_200.json +1 -0
- data/spec/fixtures/payment_intents/create_201.json +1 -0
- data/spec/fixtures/payment_intents/fetch_200.json +1 -0
- data/spec/fixtures/payment_intents/list_200.json +1 -0
- data/spec/fixtures/payment_intents/update_200.json +1 -0
- data/spec/fixtures/payment_methods/create_bank_account_201.json +1 -0
- data/spec/fixtures/payment_methods/create_card_201.json +1 -0
- data/spec/fixtures/payment_methods/get_bank_account_200.json +29 -0
- data/spec/fixtures/payment_methods/get_card_200.json +1 -0
- data/spec/fixtures/payment_methods/list_200.json +1 -0
- data/spec/fixtures/refunds/create_201.json +1 -0
- data/spec/fixtures/refunds/list_200.json +1 -0
- data/spec/fixtures/refunds/show_200.json +1 -0
- data/spec/fixtures/subscriptions/create_201.json +1 -0
- data/spec/fixtures/subscriptions/show_200.json +1 -0
- data/spec/fixtures/webhook_endpoints/create_201.json +11 -0
- data/spec/fixtures/webhook_endpoints/list_200.json +1 -0
- data/spec/fixtures/webhook_endpoints/show_200.json +1 -0
- data/spec/fixtures/webhook_endpoints/update_200.json +13 -0
- data/spec/fixtures/webhook_requests/list_200.json +1 -0
- data/spec/models/access_key_spec.rb +39 -0
- data/spec/models/account_attributes_spec.rb +40 -0
- data/spec/models/account_create_request_spec.rb +38 -0
- data/spec/models/account_response_spec.rb +39 -0
- data/spec/models/balance_transaction_response_spec.rb +38 -0
- data/spec/models/bank_account_profile_spec.rb +38 -0
- data/spec/models/billing_address_spec.rb +38 -0
- data/spec/models/card_profile_spec.rb +38 -0
- data/spec/models/charge_attributes_spec.rb +45 -0
- data/spec/models/charge_response_spec.rb +45 -0
- data/spec/models/connected_account_attributes_spec.rb +38 -0
- data/spec/models/connected_account_response_spec.rb +39 -0
- data/spec/models/create_account_request_account_spec.rb +39 -0
- data/spec/models/create_account_request_spec.rb +39 -0
- data/spec/models/create_webhook_endpoint_request_spec.rb +38 -0
- data/spec/models/create_webhook_endpoint_request_webhook_endpoint_spec.rb +38 -0
- data/spec/models/customer_attributes_spec.rb +40 -0
- data/spec/models/customer_create_request_spec.rb +38 -0
- data/spec/models/customer_spec.rb +39 -0
- data/spec/models/customer_update_attributes_spec.rb +39 -0
- data/spec/models/customer_update_request_spec.rb +39 -0
- data/spec/models/event_spec.rb +39 -0
- data/spec/models/list_access_keys_response_spec.rb +38 -0
- data/spec/models/list_accounts_response_spec.rb +38 -0
- data/spec/models/list_balance_transactions_response_spec.rb +38 -0
- data/spec/models/list_charges_response_spec.rb +38 -0
- data/spec/models/list_customers_response_spec.rb +39 -0
- data/spec/models/list_events_response_spec.rb +38 -0
- data/spec/models/list_payment_intents_response_spec.rb +45 -0
- data/spec/models/list_payment_methods_response_spec.rb +39 -0
- data/spec/models/list_refunds_response_spec.rb +38 -0
- data/spec/models/list_webhook_endpoints_response_spec.rb +38 -0
- data/spec/models/list_webhook_requests_response_spec.rb +39 -0
- data/spec/models/meta_spec.rb +38 -0
- data/spec/models/payment_intent_attributes_spec.rb +44 -0
- data/spec/models/payment_intent_create_request_spec.rb +38 -0
- data/spec/models/payment_intent_response_spec.rb +45 -0
- data/spec/models/payment_intent_update_attributes_payment_intent_spec.rb +38 -0
- data/spec/models/payment_intent_update_attributes_spec.rb +37 -0
- data/spec/models/payment_method_attributes_spec.rb +38 -0
- data/spec/models/payment_method_response_spec.rb +38 -0
- data/spec/models/refund_attributes_spec.rb +39 -0
- data/spec/models/refund_response_spec.rb +38 -0
- data/spec/models/roll_access_key_attributes_access_key_spec.rb +39 -0
- data/spec/models/roll_access_key_attributes_spec.rb +40 -0
- data/spec/models/roll_access_key_request_access_key_spec.rb +38 -0
- data/spec/models/roll_access_key_request_spec.rb +37 -0
- data/spec/models/subscription_attributes_spec.rb +38 -0
- data/spec/models/subscription_create_request_spec.rb +40 -0
- data/spec/models/subscription_response_spec.rb +38 -0
- data/spec/models/webhook_endpoint_spec.rb +40 -0
- data/spec/models/webhook_request_spec.rb +40 -0
- data/spec/spec_helper.rb +123 -0
- data/subfi_pay.gemspec +39 -0
- metadata +444 -0
@@ -0,0 +1,302 @@
|
|
1
|
+
=begin
|
2
|
+
#SubFi Pay API
|
3
|
+
|
4
|
+
#API for SubFi Pay services
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module SubFiPay
|
17
|
+
class WebhookRequest
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :event_id
|
21
|
+
|
22
|
+
attr_accessor :webhook_endpoint_id
|
23
|
+
|
24
|
+
attr_accessor :status_code
|
25
|
+
|
26
|
+
attr_accessor :error_message
|
27
|
+
|
28
|
+
attr_accessor :request_body
|
29
|
+
|
30
|
+
attr_accessor :response_body
|
31
|
+
|
32
|
+
attr_accessor :success
|
33
|
+
|
34
|
+
attr_accessor :retry_count
|
35
|
+
|
36
|
+
attr_accessor :created_at
|
37
|
+
|
38
|
+
attr_accessor :updated_at
|
39
|
+
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'id' => :'id',
|
44
|
+
:'event_id' => :'event_id',
|
45
|
+
:'webhook_endpoint_id' => :'webhook_endpoint_id',
|
46
|
+
:'status_code' => :'status_code',
|
47
|
+
:'error_message' => :'error_message',
|
48
|
+
:'request_body' => :'request_body',
|
49
|
+
:'response_body' => :'response_body',
|
50
|
+
:'success' => :'success',
|
51
|
+
:'retry_count' => :'retry_count',
|
52
|
+
:'created_at' => :'created_at',
|
53
|
+
:'updated_at' => :'updated_at'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns all the JSON keys this model knows about
|
58
|
+
def self.acceptable_attributes
|
59
|
+
attribute_map.values
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.openapi_types
|
64
|
+
{
|
65
|
+
:'id' => :'String',
|
66
|
+
:'event_id' => :'String',
|
67
|
+
:'webhook_endpoint_id' => :'String',
|
68
|
+
:'status_code' => :'Integer',
|
69
|
+
:'error_message' => :'String',
|
70
|
+
:'request_body' => :'Object',
|
71
|
+
:'response_body' => :'Object',
|
72
|
+
:'success' => :'Boolean',
|
73
|
+
:'retry_count' => :'Integer',
|
74
|
+
:'created_at' => :'Time',
|
75
|
+
:'updated_at' => :'Time'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# List of attributes with nullable: true
|
80
|
+
def self.openapi_nullable
|
81
|
+
Set.new([
|
82
|
+
])
|
83
|
+
end
|
84
|
+
|
85
|
+
# Initializes the object
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
def initialize(attributes = {})
|
88
|
+
if (!attributes.is_a?(Hash))
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SubFiPay::WebhookRequest` initialize method"
|
90
|
+
end
|
91
|
+
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SubFiPay::WebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
96
|
+
end
|
97
|
+
h[k.to_sym] = v
|
98
|
+
}
|
99
|
+
|
100
|
+
if attributes.key?(:'id')
|
101
|
+
self.id = attributes[:'id']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'event_id')
|
105
|
+
self.event_id = attributes[:'event_id']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'webhook_endpoint_id')
|
109
|
+
self.webhook_endpoint_id = attributes[:'webhook_endpoint_id']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'status_code')
|
113
|
+
self.status_code = attributes[:'status_code']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'error_message')
|
117
|
+
self.error_message = attributes[:'error_message']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'request_body')
|
121
|
+
self.request_body = attributes[:'request_body']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'response_body')
|
125
|
+
self.response_body = attributes[:'response_body']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'success')
|
129
|
+
self.success = attributes[:'success']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'retry_count')
|
133
|
+
self.retry_count = attributes[:'retry_count']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'created_at')
|
137
|
+
self.created_at = attributes[:'created_at']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'updated_at')
|
141
|
+
self.updated_at = attributes[:'updated_at']
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
146
|
+
# @return Array for valid properties with the reasons
|
147
|
+
def list_invalid_properties
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
149
|
+
invalid_properties = Array.new
|
150
|
+
invalid_properties
|
151
|
+
end
|
152
|
+
|
153
|
+
# Check to see if the all the properties in the model are valid
|
154
|
+
# @return true if the model is valid
|
155
|
+
def valid?
|
156
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
157
|
+
true
|
158
|
+
end
|
159
|
+
|
160
|
+
# Checks equality by comparing each attribute.
|
161
|
+
# @param [Object] Object to be compared
|
162
|
+
def ==(o)
|
163
|
+
return true if self.equal?(o)
|
164
|
+
self.class == o.class &&
|
165
|
+
id == o.id &&
|
166
|
+
event_id == o.event_id &&
|
167
|
+
webhook_endpoint_id == o.webhook_endpoint_id &&
|
168
|
+
status_code == o.status_code &&
|
169
|
+
error_message == o.error_message &&
|
170
|
+
request_body == o.request_body &&
|
171
|
+
response_body == o.response_body &&
|
172
|
+
success == o.success &&
|
173
|
+
retry_count == o.retry_count &&
|
174
|
+
created_at == o.created_at &&
|
175
|
+
updated_at == o.updated_at
|
176
|
+
end
|
177
|
+
|
178
|
+
# @see the `==` method
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def eql?(o)
|
181
|
+
self == o
|
182
|
+
end
|
183
|
+
|
184
|
+
# Calculates hash code according to all attributes.
|
185
|
+
# @return [Integer] Hash code
|
186
|
+
def hash
|
187
|
+
[id, event_id, webhook_endpoint_id, status_code, error_message, request_body, response_body, success, retry_count, created_at, updated_at].hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Builds the object from hash
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
+
# @return [Object] Returns the model itself
|
193
|
+
def self.build_from_hash(attributes)
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
195
|
+
attributes = attributes.transform_keys(&:to_sym)
|
196
|
+
transformed_hash = {}
|
197
|
+
openapi_types.each_pair do |key, type|
|
198
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
199
|
+
transformed_hash["#{key}"] = nil
|
200
|
+
elsif type =~ /\AArray<(.*)>/i
|
201
|
+
# check to ensure the input is an array given that the attribute
|
202
|
+
# is documented as an array but the input is not
|
203
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
204
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
205
|
+
end
|
206
|
+
elsif !attributes[attribute_map[key]].nil?
|
207
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
208
|
+
end
|
209
|
+
end
|
210
|
+
new(transformed_hash)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Deserializes the data based on type
|
214
|
+
# @param string type Data type
|
215
|
+
# @param string value Value to be deserialized
|
216
|
+
# @return [Object] Deserialized data
|
217
|
+
def self._deserialize(type, value)
|
218
|
+
case type.to_sym
|
219
|
+
when :Time
|
220
|
+
Time.parse(value)
|
221
|
+
when :Date
|
222
|
+
Date.parse(value)
|
223
|
+
when :String
|
224
|
+
value.to_s
|
225
|
+
when :Integer
|
226
|
+
value.to_i
|
227
|
+
when :Float
|
228
|
+
value.to_f
|
229
|
+
when :Boolean
|
230
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
231
|
+
true
|
232
|
+
else
|
233
|
+
false
|
234
|
+
end
|
235
|
+
when :Object
|
236
|
+
# generic object (usually a Hash), return directly
|
237
|
+
value
|
238
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
239
|
+
inner_type = Regexp.last_match[:inner_type]
|
240
|
+
value.map { |v| _deserialize(inner_type, v) }
|
241
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
242
|
+
k_type = Regexp.last_match[:k_type]
|
243
|
+
v_type = Regexp.last_match[:v_type]
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each do |k, v|
|
246
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
else # model
|
250
|
+
# models (e.g. Pet) or oneOf
|
251
|
+
klass = SubFiPay.const_get(type)
|
252
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the string representation of the object
|
257
|
+
# @return [String] String presentation of the object
|
258
|
+
def to_s
|
259
|
+
to_hash.to_s
|
260
|
+
end
|
261
|
+
|
262
|
+
# to_body is an alias to to_hash (backward compatibility)
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
264
|
+
def to_body
|
265
|
+
to_hash
|
266
|
+
end
|
267
|
+
|
268
|
+
# Returns the object in the form of hash
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
270
|
+
def to_hash
|
271
|
+
hash = {}
|
272
|
+
self.class.attribute_map.each_pair do |attr, param|
|
273
|
+
value = self.send(attr)
|
274
|
+
if value.nil?
|
275
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
276
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
277
|
+
end
|
278
|
+
|
279
|
+
hash[param] = _to_hash(value)
|
280
|
+
end
|
281
|
+
hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Outputs non-array value in the form of hash
|
285
|
+
# For object, use to_hash. Otherwise, just return the value
|
286
|
+
# @param [Object] value Any valid value
|
287
|
+
# @return [Hash] Returns the value in the form of hash
|
288
|
+
def _to_hash(value)
|
289
|
+
if value.is_a?(Array)
|
290
|
+
value.compact.map { |v| _to_hash(v) }
|
291
|
+
elsif value.is_a?(Hash)
|
292
|
+
{}.tap do |hash|
|
293
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
294
|
+
end
|
295
|
+
elsif value.respond_to? :to_hash
|
296
|
+
value.to_hash
|
297
|
+
else
|
298
|
+
value
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
data/lib/subfi_pay.rb
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
=begin
|
2
|
+
#SubFi Pay API
|
3
|
+
|
4
|
+
#API for SubFi Pay services
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'subfi_pay/api_client'
|
15
|
+
require 'subfi_pay/api_error'
|
16
|
+
require 'subfi_pay/version'
|
17
|
+
require 'subfi_pay/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'subfi_pay/models/access_key'
|
21
|
+
require 'subfi_pay/models/account_attributes'
|
22
|
+
require 'subfi_pay/models/account_create_request'
|
23
|
+
require 'subfi_pay/models/account_response'
|
24
|
+
require 'subfi_pay/models/balance_transaction_response'
|
25
|
+
require 'subfi_pay/models/bank_account_profile'
|
26
|
+
require 'subfi_pay/models/billing_address'
|
27
|
+
require 'subfi_pay/models/card_profile'
|
28
|
+
require 'subfi_pay/models/charge_attributes'
|
29
|
+
require 'subfi_pay/models/charge_response'
|
30
|
+
require 'subfi_pay/models/connected_account_attributes'
|
31
|
+
require 'subfi_pay/models/connected_account_response'
|
32
|
+
require 'subfi_pay/models/create_webhook_endpoint_request'
|
33
|
+
require 'subfi_pay/models/create_webhook_endpoint_request_webhook_endpoint'
|
34
|
+
require 'subfi_pay/models/customer'
|
35
|
+
require 'subfi_pay/models/customer_attributes'
|
36
|
+
require 'subfi_pay/models/customer_create_request'
|
37
|
+
require 'subfi_pay/models/customer_update_attributes'
|
38
|
+
require 'subfi_pay/models/customer_update_request'
|
39
|
+
require 'subfi_pay/models/event'
|
40
|
+
require 'subfi_pay/models/list_access_keys_response'
|
41
|
+
require 'subfi_pay/models/list_accounts_response'
|
42
|
+
require 'subfi_pay/models/list_balance_transactions_response'
|
43
|
+
require 'subfi_pay/models/list_charges_response'
|
44
|
+
require 'subfi_pay/models/list_customers_response'
|
45
|
+
require 'subfi_pay/models/list_events_response'
|
46
|
+
require 'subfi_pay/models/list_payment_intents_response'
|
47
|
+
require 'subfi_pay/models/list_payment_methods_response'
|
48
|
+
require 'subfi_pay/models/list_refunds_response'
|
49
|
+
require 'subfi_pay/models/list_webhook_endpoints_response'
|
50
|
+
require 'subfi_pay/models/list_webhook_requests_response'
|
51
|
+
require 'subfi_pay/models/meta'
|
52
|
+
require 'subfi_pay/models/payment_intent_attributes'
|
53
|
+
require 'subfi_pay/models/payment_intent_create_request'
|
54
|
+
require 'subfi_pay/models/payment_intent_response'
|
55
|
+
require 'subfi_pay/models/payment_intent_update_attributes'
|
56
|
+
require 'subfi_pay/models/payment_intent_update_attributes_payment_intent'
|
57
|
+
require 'subfi_pay/models/payment_method_attributes'
|
58
|
+
require 'subfi_pay/models/payment_method_response'
|
59
|
+
require 'subfi_pay/models/refund_attributes'
|
60
|
+
require 'subfi_pay/models/refund_response'
|
61
|
+
require 'subfi_pay/models/roll_access_key_attributes'
|
62
|
+
require 'subfi_pay/models/roll_access_key_attributes_access_key'
|
63
|
+
require 'subfi_pay/models/subscription_attributes'
|
64
|
+
require 'subfi_pay/models/subscription_create_request'
|
65
|
+
require 'subfi_pay/models/subscription_response'
|
66
|
+
require 'subfi_pay/models/webhook_endpoint'
|
67
|
+
require 'subfi_pay/models/webhook_request'
|
68
|
+
|
69
|
+
# APIs
|
70
|
+
require 'subfi_pay/api/access_keys_api'
|
71
|
+
require 'subfi_pay/api/accounts_api'
|
72
|
+
require 'subfi_pay/api/balance_transactions_api'
|
73
|
+
require 'subfi_pay/api/charges_api'
|
74
|
+
require 'subfi_pay/api/customers_api'
|
75
|
+
require 'subfi_pay/api/events_api'
|
76
|
+
require 'subfi_pay/api/payment_intents_api'
|
77
|
+
require 'subfi_pay/api/payment_methods_api'
|
78
|
+
require 'subfi_pay/api/refunds_api'
|
79
|
+
require 'subfi_pay/api/subscriptions_api'
|
80
|
+
require 'subfi_pay/api/webhook_endpoints_api'
|
81
|
+
require 'subfi_pay/api/webhook_requests_api'
|
82
|
+
|
83
|
+
module SubFiPay
|
84
|
+
class << self
|
85
|
+
# Customize default settings for the SDK using block.
|
86
|
+
# SubFiPay.configure do |config|
|
87
|
+
# config.username = "xxx"
|
88
|
+
# config.password = "xxx"
|
89
|
+
# end
|
90
|
+
# If no block given, return the default Configuration object.
|
91
|
+
def configure
|
92
|
+
if block_given?
|
93
|
+
yield(Configuration.default)
|
94
|
+
else
|
95
|
+
Configuration.default
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
data/run_fix_gemfile.sh
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
=begin
|
2
|
+
#SubFi Pay API
|
3
|
+
|
4
|
+
#API for SubFi Pay services
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for SubFiPay::AccessKeysApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'SubFiPay::AccessKeysApi' do
|
20
|
+
let(:api_instance) { SubFiPay::AccessKeysApi.new }
|
21
|
+
let(:api_key) { Faker::Alphanumeric.alphanumeric(number: 32) }
|
22
|
+
let(:api_version) { "0.1.0" }
|
23
|
+
let(:account_id) { Faker::Alphanumeric.alphanumeric(number: 32) }
|
24
|
+
let(:config) do
|
25
|
+
api_instance.api_client.config.tap do |c|
|
26
|
+
c.api_key['ApiKeyAuth'] = api_key
|
27
|
+
c.host = "localhost:3000"
|
28
|
+
c.scheme = "http"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
let(:path) { "/access_keys" }
|
32
|
+
let(:request_headers) do
|
33
|
+
{
|
34
|
+
"Content-Type" => "application/json",
|
35
|
+
'X-Api-Version' => api_version,
|
36
|
+
'X-Api-Key' => api_key,
|
37
|
+
'Expect' => ''
|
38
|
+
}
|
39
|
+
end
|
40
|
+
let(:response_headers) do
|
41
|
+
{
|
42
|
+
'Accept' => 'application/json',
|
43
|
+
"Content-Type" => "application/json"
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'test an instance of AccessKeysApi' do
|
48
|
+
it 'should create an instance of AccessKeysApi' do
|
49
|
+
expect(api_instance).to be_instance_of(SubFiPay::AccessKeysApi)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# unit tests for delete_access_key
|
54
|
+
# Delete an access key by ID
|
55
|
+
# @param x_api_version
|
56
|
+
# @param id
|
57
|
+
# @param [Hash] opts the optional parameters
|
58
|
+
# @return [nil]
|
59
|
+
describe 'delete_access_key test' do
|
60
|
+
let(:access_key_id) { Faker::Alphanumeric.alphanumeric(number: 32) }
|
61
|
+
|
62
|
+
before do
|
63
|
+
stub_request(:delete, [config.host, "#{path}/#{access_key_id}"].join)
|
64
|
+
.with(headers: request_headers)
|
65
|
+
.to_return(
|
66
|
+
status: 204,
|
67
|
+
body: nil,
|
68
|
+
headers: response_headers
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should work' do
|
73
|
+
res = api_instance.delete_access_key(api_version, access_key_id)
|
74
|
+
|
75
|
+
expect(res).to be_nil
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# unit tests for list_access_keys
|
80
|
+
# List all access keys
|
81
|
+
# @param x_api_version
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @option opts [Integer] :page The page of results to retrieve.
|
84
|
+
# @option opts [Integer] :per_page Number of results per page.
|
85
|
+
# @return [ListAccessKeysResponse]
|
86
|
+
describe 'list_access_keys test' do
|
87
|
+
before do
|
88
|
+
stub_request(:get, [config.host, path].join)
|
89
|
+
.with(headers: request_headers)
|
90
|
+
.to_return(
|
91
|
+
status: 200,
|
92
|
+
body: fixture("access_keys/list_200.json"),
|
93
|
+
headers: response_headers
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'should work' do
|
98
|
+
res = api_instance.list_access_keys(api_version)
|
99
|
+
|
100
|
+
expect(res).to be_instance_of(SubFiPay::ListAccessKeysResponse)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# unit tests for roll_access_key
|
105
|
+
# Roll an access key by ID
|
106
|
+
# @param x_api_version
|
107
|
+
# @param id
|
108
|
+
# @param roll_access_key_request
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @return [ListAccessKeysResponse]
|
111
|
+
describe 'roll_access_key test' do
|
112
|
+
let(:access_key_id) { Faker::Alphanumeric.alphanumeric(number: 32) }
|
113
|
+
let(:body) do
|
114
|
+
{
|
115
|
+
roll_access_key_request: {
|
116
|
+
new_key: Faker::Alphanumeric.alphanumeric(number: 32)
|
117
|
+
}
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
before do
|
122
|
+
stub_request(:post, [config.host, "#{path}/#{access_key_id}/roll"].join)
|
123
|
+
.with(headers: request_headers, body: body.to_json)
|
124
|
+
.to_return(
|
125
|
+
status: 200,
|
126
|
+
body: fixture("access_keys/roll_200.json"),
|
127
|
+
headers: response_headers
|
128
|
+
)
|
129
|
+
end
|
130
|
+
|
131
|
+
it 'should work' do
|
132
|
+
res = api_instance.roll_access_key(api_version, access_key_id, body)
|
133
|
+
|
134
|
+
expect(res).to be_instance_of(SubFiPay::AccessKey)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|