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,127 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Yapstone::RefundsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'RefundsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Yapstone::RefundsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of RefundsApi' do
|
30
|
+
it 'should create an instance of RefundsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Yapstone::RefundsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for cancel_refund
|
36
|
+
# Cancel Payment by payment Id
|
37
|
+
# @param authorization Authorization
|
38
|
+
# @param x_yapstone_ip_address Ip Address of the client
|
39
|
+
# @param refund_id refundId
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @option opts [String] :x_yapstone_trace_id X-Yapstone-Trace-Id
|
42
|
+
# @option opts [String] :x_yapstone_fpsid Device Finger Print Id
|
43
|
+
# @return [RefundCancelResponse]
|
44
|
+
describe 'cancel_refund test' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# unit tests for create_payment_refund
|
51
|
+
# Create a refund
|
52
|
+
# Create a refund for a payment that was processed
|
53
|
+
# @param authorization Authorization
|
54
|
+
# @param x_yapstone_ip_address IP Address of the client
|
55
|
+
# @param refund_request
|
56
|
+
# @param [Hash] opts the optional parameters
|
57
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
58
|
+
# @option opts [String] :x_yapstone_fpsid Device Finger Print Id
|
59
|
+
# @return [RefundResponse]
|
60
|
+
describe 'create_payment_refund test' do
|
61
|
+
it 'should work' do
|
62
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# unit tests for create_transaction_refund
|
67
|
+
# Create a refund
|
68
|
+
# Use this end point to kick off a refund for transaction. If you've already captured the transaction, this will result in a refund of the amount captured and the details of that refund will be returned in the response body.
|
69
|
+
# @param authorization Authorization
|
70
|
+
# @param x_yapstone_ip_address IP Address of the client
|
71
|
+
# @param transaction
|
72
|
+
# @param [Hash] opts the optional parameters
|
73
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
74
|
+
# @option opts [String] :x_yapstone_fpsid Device Finger Print Id
|
75
|
+
# @return [RefundResponse]
|
76
|
+
describe 'create_transaction_refund test' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# unit tests for get_by_originaltransaction_id
|
83
|
+
# Get master Transaction details including all refund details by transaction Id
|
84
|
+
# Transactions are nested inside payments. Master transactions are nested inside the master payment.
|
85
|
+
# @param authorization Authorization
|
86
|
+
# @param x_yapstone_ip_address IP Address of the client
|
87
|
+
# @param transaction_id transactionId
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
90
|
+
# @return [TransactionResponse]
|
91
|
+
describe 'get_by_originaltransaction_id test' do
|
92
|
+
it 'should work' do
|
93
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# unit tests for get_refund
|
98
|
+
# Get master payment details including all refund detail by refund ID.
|
99
|
+
# A master payment is the initial payment that all other payment details and transactions tied to that payment connect to. You can use a refund ID to retrieve master payment information.
|
100
|
+
# @param authorization Authorization
|
101
|
+
# @param x_yapstone_ip_address IP Address of the client
|
102
|
+
# @param refund_id refundId
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
105
|
+
# @return [RefundResponse]
|
106
|
+
describe 'get_refund test' do
|
107
|
+
it 'should work' do
|
108
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# unit tests for get_refund_by_payment_id
|
113
|
+
# Get master payment details including all refund details by Payment Id.
|
114
|
+
# A master payment is the initial payment that all other payment details and transactions tied to that payment connect to.
|
115
|
+
# @param authorization Authorization
|
116
|
+
# @param x_yapstone_ip_address IP Address of the client
|
117
|
+
# @param payment_id paymentId
|
118
|
+
# @param [Hash] opts the optional parameters
|
119
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
120
|
+
# @return [RefundResponse]
|
121
|
+
describe 'get_refund_by_payment_id test' do
|
122
|
+
it 'should work' do
|
123
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
@@ -0,0 +1,66 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Yapstone::SearchApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'SearchApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Yapstone::SearchApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of SearchApi' do
|
30
|
+
it 'should create an instance of SearchApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Yapstone::SearchApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for search_by_payment_id
|
36
|
+
# Search with Payment Id
|
37
|
+
# Use this endpoint to search for a payment by payment ID.
|
38
|
+
# @param authorization Authorization
|
39
|
+
# @param x_yapstone_ip_address IP Address of the client
|
40
|
+
# @param payment_id
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
43
|
+
# @return [SearchPaymentResponse]
|
44
|
+
describe 'search_by_payment_id test' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# unit tests for search_by_transaction_id
|
51
|
+
# Search with transaction id
|
52
|
+
# Use this endpoint to search for particular transactions using their transaction ID.
|
53
|
+
# @param authorization Authorization
|
54
|
+
# @param x_yapstone_fpsid Device Finger Print Id
|
55
|
+
# @param x_yapstone_ip_address IP Address of the client
|
56
|
+
# @param transaction_id
|
57
|
+
# @param [Hash] opts the optional parameters
|
58
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
59
|
+
# @return [SearchPaymentResponse]
|
60
|
+
describe 'search_by_transaction_id test' do
|
61
|
+
it 'should work' do
|
62
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -0,0 +1,67 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Yapstone::TokenApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'TokenApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Yapstone::TokenApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of TokenApi' do
|
30
|
+
it 'should create an instance of TokenApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Yapstone::TokenApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for create_token
|
36
|
+
# Create a Token
|
37
|
+
# Create a token to make a payment. In your request you specify the type of instrument and you are returned a token for that instrument in the response.
|
38
|
+
# @param authorization Authorization
|
39
|
+
# @param x_yapstone_ip_address IP Address of the client
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
42
|
+
# @option opts [String] :x_yapstone_fpsid Device Finger Print Id
|
43
|
+
# @option opts [TokenRequest] :token_request
|
44
|
+
# @return [Token]
|
45
|
+
describe 'create_token test' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# unit tests for lookup_token
|
52
|
+
# Lookup a Token
|
53
|
+
# Lookup a token to make a payment. Submit the token ID to retrieve details about the token.
|
54
|
+
# @param authorization Authorization
|
55
|
+
# @param x_yapstone_ip_address IP Address of the client
|
56
|
+
# @param [Hash] opts the optional parameters
|
57
|
+
# @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
|
58
|
+
# @option opts [String] :x_yapstone_fpsid Device Finger Print Id
|
59
|
+
# @option opts [Token] :token
|
60
|
+
# @return [TokenResponse]
|
61
|
+
describe 'lookup_token test' do
|
62
|
+
it 'should work' do
|
63
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,226 @@
|
|
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 'spec_helper'
|
14
|
+
|
15
|
+
describe Yapstone::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
Yapstone.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(Yapstone::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
Yapstone.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(Yapstone::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
Yapstone.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(Yapstone::Configuration.default.host).to eq('hobo.com')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'base_path' do
|
36
|
+
it "prepends a slash to base_path" do
|
37
|
+
Yapstone.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(Yapstone::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
42
|
+
Yapstone.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(Yapstone::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
Yapstone.configure { |c| c.base_path = nil }
|
48
|
+
expect(Yapstone::Configuration.default.base_path).to eq('')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'params_encoding in #build_request' do
|
55
|
+
let(:config) { Yapstone::Configuration.new }
|
56
|
+
let(:api_client) { Yapstone::ApiClient.new(config) }
|
57
|
+
|
58
|
+
it 'defaults to nil' do
|
59
|
+
expect(Yapstone::Configuration.default.params_encoding).to eq(nil)
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
61
|
+
|
62
|
+
request = api_client.build_request(:get, '/test')
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'can be customized' do
|
67
|
+
config.params_encoding = :multi
|
68
|
+
request = api_client.build_request(:get, '/test')
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe 'timeout in #build_request' do
|
74
|
+
let(:config) { Yapstone::Configuration.new }
|
75
|
+
let(:api_client) { Yapstone::ApiClient.new(config) }
|
76
|
+
|
77
|
+
it 'defaults to 0' do
|
78
|
+
expect(Yapstone::Configuration.default.timeout).to eq(0)
|
79
|
+
expect(config.timeout).to eq(0)
|
80
|
+
|
81
|
+
request = api_client.build_request(:get, '/test')
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'can be customized' do
|
86
|
+
config.timeout = 100
|
87
|
+
request = api_client.build_request(:get, '/test')
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '#deserialize' do
|
93
|
+
it "handles Array<Integer>" do
|
94
|
+
api_client = Yapstone::ApiClient.new
|
95
|
+
headers = { 'Content-Type' => 'application/json' }
|
96
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
+
expect(data).to be_instance_of(Array)
|
99
|
+
expect(data).to eq([12, 34])
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'handles Array<Array<Integer>>' do
|
103
|
+
api_client = Yapstone::ApiClient.new
|
104
|
+
headers = { 'Content-Type' => 'application/json' }
|
105
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
+
expect(data).to be_instance_of(Array)
|
108
|
+
expect(data).to eq([[12, 34], [56]])
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'handles Hash<String, String>' do
|
112
|
+
api_client = Yapstone::ApiClient.new
|
113
|
+
headers = { 'Content-Type' => 'application/json' }
|
114
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
+
expect(data).to be_instance_of(Hash)
|
117
|
+
expect(data).to eq(:message => 'Hello')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#object_to_hash" do
|
122
|
+
it 'ignores nils and includes empty arrays' do
|
123
|
+
# uncomment below to test object_to_hash for model
|
124
|
+
# api_client = Yapstone::ApiClient.new
|
125
|
+
# _model = Yapstone::ModelName.new
|
126
|
+
# update the model attribute below
|
127
|
+
# _model.id = 1
|
128
|
+
# update the expected value (hash) below
|
129
|
+
# expected = {id: 1, name: '', tags: []}
|
130
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#build_collection_param' do
|
135
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
+
let(:api_client) { Yapstone::ApiClient.new }
|
137
|
+
|
138
|
+
it 'works for csv' do
|
139
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'works for ssv' do
|
143
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'works for tsv' do
|
147
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'works for pipes' do
|
151
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'works for multi' do
|
155
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
+
end
|
157
|
+
|
158
|
+
it 'fails for invalid collection format' do
|
159
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe '#json_mime?' do
|
164
|
+
let(:api_client) { Yapstone::ApiClient.new }
|
165
|
+
|
166
|
+
it 'works' do
|
167
|
+
expect(api_client.json_mime?(nil)).to eq false
|
168
|
+
expect(api_client.json_mime?('')).to eq false
|
169
|
+
|
170
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
+
|
174
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
describe '#select_header_accept' do
|
181
|
+
let(:api_client) { Yapstone::ApiClient.new }
|
182
|
+
|
183
|
+
it 'works' do
|
184
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
+
expect(api_client.select_header_accept([])).to be_nil
|
186
|
+
|
187
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
+
|
191
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe '#select_header_content_type' do
|
197
|
+
let(:api_client) { Yapstone::ApiClient.new }
|
198
|
+
|
199
|
+
it 'works' do
|
200
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
|
+
|
203
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe '#sanitize_filename' do
|
212
|
+
let(:api_client) { Yapstone::ApiClient.new }
|
213
|
+
|
214
|
+
it 'works' do
|
215
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|