velopayments 2.11.73
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 +9 -0
- data/Gemfile.lock +79 -0
- data/LICENSE +201 -0
- data/Makefile +39 -0
- data/README.md +279 -0
- data/Rakefile +10 -0
- data/docs/Address.md +31 -0
- data/docs/Challenge.md +19 -0
- data/docs/Company.md +19 -0
- data/docs/CountriesApi.md +106 -0
- data/docs/CreatePayee.md +59 -0
- data/docs/CreatePayeesCSVRequest.md +71 -0
- data/docs/CreatePayeesCSVResponse.md +19 -0
- data/docs/CreatePayeesRequest.md +19 -0
- data/docs/CreatePaymentChannel.md +29 -0
- data/docs/CreatePayoutRequest.md +21 -0
- data/docs/CurrenciesApi.md +57 -0
- data/docs/FailedSubmission.md +19 -0
- data/docs/FundingAudit.md +31 -0
- data/docs/FundingEvent.md +21 -0
- data/docs/FundingEventType.md +16 -0
- data/docs/FundingManagerApi.md +347 -0
- data/docs/FundingRequest.md +17 -0
- data/docs/FundingRequest2.md +17 -0
- data/docs/FxSummary.md +35 -0
- data/docs/GetFundingsResponse.md +21 -0
- data/docs/GetPaymentsForPayoutResponse.md +23 -0
- data/docs/GetPaymentsForPayoutResponseLinks.md +19 -0
- data/docs/GetPaymentsForPayoutResponsePage.md +25 -0
- data/docs/GetPaymentsForPayoutResponseSummary.md +25 -0
- data/docs/GetPayoutApi.md +61 -0
- data/docs/GetPayoutStatistics.md +19 -0
- data/docs/GetPayoutsResponse.md +23 -0
- data/docs/Individual.md +21 -0
- data/docs/IndividualName.md +23 -0
- data/docs/InstructPayoutApi.md +60 -0
- data/docs/InvitationStatusResponse.md +17 -0
- data/docs/InvitePayeeRequest.md +17 -0
- data/docs/Language.md +16 -0
- data/docs/ListPaymentsResponse.md +23 -0
- data/docs/ListSourceAccountResponse.md +21 -0
- data/docs/MarketingOptIn.md +19 -0
- data/docs/OfacStatus.md +16 -0
- data/docs/OnboardedStatus.md +16 -0
- data/docs/PagedResponse.md +19 -0
- data/docs/PagedResponsePage.md +25 -0
- data/docs/Payee.md +57 -0
- data/docs/PayeeInvitationApi.md +222 -0
- data/docs/PayeeInvitationStatus.md +21 -0
- data/docs/PayeeResponse.md +23 -0
- data/docs/PayeeType.md +16 -0
- data/docs/PayeesApi.md +192 -0
- data/docs/PaymentAuditCurrency.md +16 -0
- data/docs/PaymentAuditServiceApi.md +424 -0
- data/docs/PaymentChannel.md +29 -0
- data/docs/PaymentChannelCountry.md +19 -0
- data/docs/PaymentChannelRule.md +29 -0
- data/docs/PaymentChannelRulesResponse.md +17 -0
- data/docs/PaymentEventResponse.md +39 -0
- data/docs/PaymentInstruction.md +27 -0
- data/docs/PaymentResponse.md +81 -0
- data/docs/Payor.md +55 -0
- data/docs/PayorApplicationsApi.md +119 -0
- data/docs/PayorBrandingResponse.md +25 -0
- data/docs/PayorCreateApiKeyRequest.md +21 -0
- data/docs/PayorCreateApiKeyResponse.md +19 -0
- data/docs/PayorCreateApplicationRequest.md +19 -0
- data/docs/PayorEmailOptOutRequest.md +17 -0
- data/docs/PayorFundingBankDetailsUpdate.md +21 -0
- data/docs/PayorLogoRequest.md +17 -0
- data/docs/PayorRef.md +21 -0
- data/docs/PayorsApi.md +224 -0
- data/docs/PayoutHistoryApi.md +142 -0
- data/docs/PayoutStatus.md +16 -0
- data/docs/PayoutSummaryAudit.md +39 -0
- data/docs/PayoutSummaryResponse.md +31 -0
- data/docs/QueryBatchResponse.md +23 -0
- data/docs/QuoteFxSummary.md +37 -0
- data/docs/QuotePayoutApi.md +61 -0
- data/docs/QuoteResponse.md +17 -0
- data/docs/RejectedPayment.md +31 -0
- data/docs/Social.md +21 -0
- data/docs/SourceAccount.md +23 -0
- data/docs/SourceAccountResponse.md +39 -0
- data/docs/SourceAccountSummary.md +21 -0
- data/docs/SubmitPayoutApi.md +60 -0
- data/docs/SupportedCountriesResponse.md +17 -0
- data/docs/SupportedCountry.md +19 -0
- data/docs/SupportedCurrency.md +19 -0
- data/docs/SupportedCurrencyResponse.md +17 -0
- data/docs/WithdrawPayoutApi.md +60 -0
- data/lib/velopayments.rb +124 -0
- data/lib/velopayments/api/countries_api.rb +116 -0
- data/lib/velopayments/api/currencies_api.rb +69 -0
- data/lib/velopayments/api/funding_manager_api.rb +374 -0
- data/lib/velopayments/api/get_payout_api.rb +75 -0
- data/lib/velopayments/api/instruct_payout_api.rb +72 -0
- data/lib/velopayments/api/payee_invitation_api.rb +244 -0
- data/lib/velopayments/api/payees_api.rb +217 -0
- data/lib/velopayments/api/payment_audit_service_api.rb +473 -0
- data/lib/velopayments/api/payor_applications_api.rb +147 -0
- data/lib/velopayments/api/payors_api.rb +241 -0
- data/lib/velopayments/api/payout_history_api.rb +165 -0
- data/lib/velopayments/api/quote_payout_api.rb +75 -0
- data/lib/velopayments/api/submit_payout_api.rb +74 -0
- data/lib/velopayments/api/withdraw_payout_api.rb +72 -0
- data/lib/velopayments/api_client.rb +387 -0
- data/lib/velopayments/api_error.rb +57 -0
- data/lib/velopayments/configuration.rb +251 -0
- data/lib/velopayments/models/address.rb +478 -0
- data/lib/velopayments/models/challenge.rb +271 -0
- data/lib/velopayments/models/company.rb +256 -0
- data/lib/velopayments/models/create_payee.rb +466 -0
- data/lib/velopayments/models/create_payees_csv_request.rb +1052 -0
- data/lib/velopayments/models/create_payees_csv_response.rb +207 -0
- data/lib/velopayments/models/create_payees_request.rb +217 -0
- data/lib/velopayments/models/create_payment_channel.rb +414 -0
- data/lib/velopayments/models/create_payout_request.rb +226 -0
- data/lib/velopayments/models/failed_submission.rb +205 -0
- data/lib/velopayments/models/funding_audit.rb +295 -0
- data/lib/velopayments/models/funding_event.rb +214 -0
- data/lib/velopayments/models/funding_event_type.rb +41 -0
- data/lib/velopayments/models/funding_request.rb +230 -0
- data/lib/velopayments/models/funding_request2.rb +230 -0
- data/lib/velopayments/models/fx_summary.rb +363 -0
- data/lib/velopayments/models/get_fundings_response.rb +223 -0
- data/lib/velopayments/models/get_payments_for_payout_response.rb +228 -0
- data/lib/velopayments/models/get_payments_for_payout_response_links.rb +205 -0
- data/lib/velopayments/models/get_payments_for_payout_response_page.rb +232 -0
- data/lib/velopayments/models/get_payments_for_payout_response_summary.rb +232 -0
- data/lib/velopayments/models/get_payout_statistics.rb +215 -0
- data/lib/velopayments/models/get_payouts_response.rb +228 -0
- data/lib/velopayments/models/individual.rb +224 -0
- data/lib/velopayments/models/individual_name.rb +337 -0
- data/lib/velopayments/models/invitation_status_response.rb +203 -0
- data/lib/velopayments/models/invite_payee_request.rb +201 -0
- data/lib/velopayments/models/language.rb +45 -0
- data/lib/velopayments/models/list_payments_response.rb +228 -0
- data/lib/velopayments/models/list_source_account_response.rb +219 -0
- data/lib/velopayments/models/marketing_opt_in.rb +205 -0
- data/lib/velopayments/models/ofac_status.rb +37 -0
- data/lib/velopayments/models/onboarded_status.rb +38 -0
- data/lib/velopayments/models/paged_response.rb +207 -0
- data/lib/velopayments/models/paged_response_page.rb +232 -0
- data/lib/velopayments/models/payee.rb +381 -0
- data/lib/velopayments/models/payee_invitation_status.rb +258 -0
- data/lib/velopayments/models/payee_response.rb +228 -0
- data/lib/velopayments/models/payee_type.rb +36 -0
- data/lib/velopayments/models/payment_audit_currency.rb +37 -0
- data/lib/velopayments/models/payment_channel.rb +430 -0
- data/lib/velopayments/models/payment_channel_country.rb +207 -0
- data/lib/velopayments/models/payment_channel_rule.rb +250 -0
- data/lib/velopayments/models/payment_channel_rules_response.rb +198 -0
- data/lib/velopayments/models/payment_event_response.rb +351 -0
- data/lib/velopayments/models/payment_instruction.rb +430 -0
- data/lib/velopayments/models/payment_response.rb +587 -0
- data/lib/velopayments/models/payor.rb +435 -0
- data/lib/velopayments/models/payor_branding_response.rb +247 -0
- data/lib/velopayments/models/payor_create_api_key_request.rb +303 -0
- data/lib/velopayments/models/payor_create_api_key_response.rb +207 -0
- data/lib/velopayments/models/payor_create_application_request.rb +264 -0
- data/lib/velopayments/models/payor_email_opt_out_request.rb +196 -0
- data/lib/velopayments/models/payor_funding_bank_details_update.rb +316 -0
- data/lib/velopayments/models/payor_logo_request.rb +196 -0
- data/lib/velopayments/models/payor_ref.rb +214 -0
- data/lib/velopayments/models/payout_status.rb +43 -0
- data/lib/velopayments/models/payout_summary_audit.rb +314 -0
- data/lib/velopayments/models/payout_summary_response.rb +280 -0
- data/lib/velopayments/models/query_batch_response.rb +260 -0
- data/lib/velopayments/models/quote_fx_summary.rb +377 -0
- data/lib/velopayments/models/quote_response.rb +198 -0
- data/lib/velopayments/models/rejected_payment.rb +323 -0
- data/lib/velopayments/models/social.rb +214 -0
- data/lib/velopayments/models/source_account.rb +243 -0
- data/lib/velopayments/models/source_account_response.rb +341 -0
- data/lib/velopayments/models/source_account_summary.rb +224 -0
- data/lib/velopayments/models/supported_countries_response.rb +198 -0
- data/lib/velopayments/models/supported_country.rb +207 -0
- data/lib/velopayments/models/supported_currency.rb +206 -0
- data/lib/velopayments/models/supported_currency_response.rb +198 -0
- data/lib/velopayments/version.rb +15 -0
- data/oa3-config.json +8 -0
- data/spec/api/countries_api_spec.rb +57 -0
- data/spec/api/currencies_api_spec.rb +46 -0
- data/spec/api/funding_manager_api_spec.rb +117 -0
- data/spec/api/get_payout_api_spec.rb +47 -0
- data/spec/api/instruct_payout_api_spec.rb +47 -0
- data/spec/api/payee_invitation_api_spec.rb +84 -0
- data/spec/api/payees_api_spec.rb +82 -0
- data/spec/api/payment_audit_service_api_spec.rb +150 -0
- data/spec/api/payor_applications_api_spec.rb +62 -0
- data/spec/api/payors_api_spec.rb +85 -0
- data/spec/api/payout_history_api_spec.rb +71 -0
- data/spec/api/quote_payout_api_spec.rb +47 -0
- data/spec/api/submit_payout_api_spec.rb +47 -0
- data/spec/api/withdraw_payout_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_spec.rb +83 -0
- data/spec/models/challenge_spec.rb +47 -0
- data/spec/models/company_spec.rb +47 -0
- data/spec/models/create_payee_spec.rb +167 -0
- data/spec/models/create_payees_csv_request_spec.rb +211 -0
- data/spec/models/create_payees_csv_response_spec.rb +47 -0
- data/spec/models/create_payees_request_spec.rb +47 -0
- data/spec/models/create_payment_channel_spec.rb +81 -0
- data/spec/models/create_payout_request_spec.rb +53 -0
- data/spec/models/failed_submission_spec.rb +47 -0
- data/spec/models/funding_audit_spec.rb +87 -0
- data/spec/models/funding_event_spec.rb +53 -0
- data/spec/models/funding_event_type_spec.rb +35 -0
- data/spec/models/funding_request2_spec.rb +41 -0
- data/spec/models/funding_request_spec.rb +41 -0
- data/spec/models/fx_summary_spec.rb +103 -0
- data/spec/models/get_fundings_response_spec.rb +53 -0
- data/spec/models/get_payments_for_payout_response_links_spec.rb +47 -0
- data/spec/models/get_payments_for_payout_response_page_spec.rb +65 -0
- data/spec/models/get_payments_for_payout_response_spec.rb +59 -0
- data/spec/models/get_payments_for_payout_response_summary_spec.rb +65 -0
- data/spec/models/get_payout_statistics_spec.rb +47 -0
- data/spec/models/get_payouts_response_spec.rb +59 -0
- data/spec/models/individual_name_spec.rb +59 -0
- data/spec/models/individual_spec.rb +53 -0
- data/spec/models/invitation_status_response_spec.rb +41 -0
- data/spec/models/invite_payee_request_spec.rb +41 -0
- data/spec/models/language_spec.rb +35 -0
- data/spec/models/list_payments_response_spec.rb +59 -0
- data/spec/models/list_source_account_response_spec.rb +53 -0
- data/spec/models/marketing_opt_in_spec.rb +47 -0
- data/spec/models/ofac_status_spec.rb +35 -0
- data/spec/models/onboarded_status_spec.rb +35 -0
- data/spec/models/paged_response_page_spec.rb +65 -0
- data/spec/models/paged_response_spec.rb +47 -0
- data/spec/models/payee_invitation_status_spec.rb +57 -0
- data/spec/models/payee_response_spec.rb +59 -0
- data/spec/models/payee_spec.rb +161 -0
- data/spec/models/payee_type_spec.rb +35 -0
- data/spec/models/payment_audit_currency_spec.rb +35 -0
- data/spec/models/payment_channel_country_spec.rb +47 -0
- data/spec/models/payment_channel_rule_spec.rb +77 -0
- data/spec/models/payment_channel_rules_response_spec.rb +41 -0
- data/spec/models/payment_channel_spec.rb +81 -0
- data/spec/models/payment_event_response_spec.rb +111 -0
- data/spec/models/payment_instruction_spec.rb +75 -0
- data/spec/models/payment_response_spec.rb +241 -0
- data/spec/models/payor_branding_response_spec.rb +65 -0
- data/spec/models/payor_create_api_key_request_spec.rb +57 -0
- data/spec/models/payor_create_api_key_response_spec.rb +47 -0
- data/spec/models/payor_create_application_request_spec.rb +47 -0
- data/spec/models/payor_email_opt_out_request_spec.rb +41 -0
- data/spec/models/payor_funding_bank_details_update_spec.rb +53 -0
- data/spec/models/payor_logo_request_spec.rb +41 -0
- data/spec/models/payor_ref_spec.rb +53 -0
- data/spec/models/payor_spec.rb +163 -0
- data/spec/models/payout_status_spec.rb +35 -0
- data/spec/models/payout_summary_audit_spec.rb +107 -0
- data/spec/models/payout_summary_response_spec.rb +83 -0
- data/spec/models/query_batch_response_spec.rb +63 -0
- data/spec/models/quote_fx_summary_spec.rb +101 -0
- data/spec/models/quote_response_spec.rb +41 -0
- data/spec/models/rejected_payment_spec.rb +87 -0
- data/spec/models/social_spec.rb +53 -0
- data/spec/models/source_account_response_spec.rb +111 -0
- data/spec/models/source_account_spec.rb +59 -0
- data/spec/models/source_account_summary_spec.rb +53 -0
- data/spec/models/supported_countries_response_spec.rb +41 -0
- data/spec/models/supported_country_spec.rb +47 -0
- data/spec/models/supported_currency_response_spec.rb +41 -0
- data/spec/models/supported_currency_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- data/velopayments.gemspec +45 -0
- metadata +586 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
=begin
|
2
|
+
#Velo Payments APIs
|
3
|
+
|
4
|
+
### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.11.73
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module VeloPayments
|
16
|
+
class GetPayoutApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get Payout Summary
|
23
|
+
# Get payout summary - returns the current state of the payout.
|
24
|
+
# @param payout_id [String] Id of the payout
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [PayoutSummaryResponse]
|
27
|
+
def v3_payouts_payout_id_get(payout_id, opts = {})
|
28
|
+
data, _status_code, _headers = v3_payouts_payout_id_get_with_http_info(payout_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get Payout Summary
|
33
|
+
# Get payout summary - returns the current state of the payout.
|
34
|
+
# @param payout_id [String] Id of the payout
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(PayoutSummaryResponse, Integer, Hash)>] PayoutSummaryResponse data, response status code and response headers
|
37
|
+
def v3_payouts_payout_id_get_with_http_info(payout_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: GetPayoutApi.v3_payouts_payout_id_get ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'payout_id' is set
|
42
|
+
if @api_client.config.client_side_validation && payout_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'payout_id' when calling GetPayoutApi.v3_payouts_payout_id_get"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v3/payouts/{payoutId}'.sub('{' + 'payoutId' + '}', payout_id.to_s)
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = nil
|
61
|
+
auth_names = ['OAuth2']
|
62
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => 'PayoutSummaryResponse')
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: GetPayoutApi#v3_payouts_payout_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
=begin
|
2
|
+
#Velo Payments APIs
|
3
|
+
|
4
|
+
### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.11.73
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module VeloPayments
|
16
|
+
class InstructPayoutApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Instruct Payout
|
23
|
+
# Instruct a payout to be made for the specified payoutId.
|
24
|
+
# @param payout_id [String] Id of the payout
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def v3_payouts_payout_id_post(payout_id, opts = {})
|
28
|
+
v3_payouts_payout_id_post_with_http_info(payout_id, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Instruct Payout
|
33
|
+
# Instruct a payout to be made for the specified payoutId.
|
34
|
+
# @param payout_id [String] Id of the payout
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def v3_payouts_payout_id_post_with_http_info(payout_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: InstructPayoutApi.v3_payouts_payout_id_post ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'payout_id' is set
|
42
|
+
if @api_client.config.client_side_validation && payout_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'payout_id' when calling InstructPayoutApi.v3_payouts_payout_id_post"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v3/payouts/{payoutId}'.sub('{' + 'payoutId' + '}', payout_id.to_s)
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = nil
|
59
|
+
auth_names = ['OAuth2']
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names)
|
66
|
+
if @api_client.config.debugging
|
67
|
+
@api_client.config.logger.debug "API called: InstructPayoutApi#v3_payouts_payout_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
68
|
+
end
|
69
|
+
return data, status_code, headers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,244 @@
|
|
1
|
+
=begin
|
2
|
+
#Velo Payments APIs
|
3
|
+
|
4
|
+
### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.11.73
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module VeloPayments
|
16
|
+
class PayeeInvitationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get Payee Invitation Status
|
23
|
+
# Returns a list of payees associated with a payor, along with invitation status and grace period end date.
|
24
|
+
# @param payor_id [String] The account owner Payor ID
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [InvitationStatusResponse]
|
27
|
+
def get_payor(payor_id, opts = {})
|
28
|
+
data, _status_code, _headers = get_payor_with_http_info(payor_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get Payee Invitation Status
|
33
|
+
# Returns a list of payees associated with a payor, along with invitation status and grace period end date.
|
34
|
+
# @param payor_id [String] The account owner Payor ID
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(InvitationStatusResponse, Integer, Hash)>] InvitationStatusResponse data, response status code and response headers
|
37
|
+
def get_payor_with_http_info(payor_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: PayeeInvitationApi.get_payor ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'payor_id' is set
|
42
|
+
if @api_client.config.client_side_validation && payor_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'payor_id' when calling PayeeInvitationApi.get_payor"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v1/payees/payors/{payorId}/invitationStatus'.sub('{' + 'payorId' + '}', payor_id.to_s)
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = nil
|
61
|
+
auth_names = ['OAuth2']
|
62
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => 'InvitationStatusResponse')
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: PayeeInvitationApi#get_payor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
|
75
|
+
# Resend Payee Invite
|
76
|
+
# Resend an invite to the Payee The payee must have already been invited by the payor and not yet accepted or declined Any previous invites to the payee by this Payor will be invalidated
|
77
|
+
# @param payee_id [String] The UUID of the payee.
|
78
|
+
# @param invite_payee_request [InvitePayeeRequest]
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @return [InvitationStatusResponse]
|
81
|
+
def resend_payee_invite(payee_id, invite_payee_request, opts = {})
|
82
|
+
data, _status_code, _headers = resend_payee_invite_with_http_info(payee_id, invite_payee_request, opts)
|
83
|
+
data
|
84
|
+
end
|
85
|
+
|
86
|
+
# Resend Payee Invite
|
87
|
+
# Resend an invite to the Payee The payee must have already been invited by the payor and not yet accepted or declined Any previous invites to the payee by this Payor will be invalidated
|
88
|
+
# @param payee_id [String] The UUID of the payee.
|
89
|
+
# @param invite_payee_request [InvitePayeeRequest]
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [Array<(InvitationStatusResponse, Integer, Hash)>] InvitationStatusResponse data, response status code and response headers
|
92
|
+
def resend_payee_invite_with_http_info(payee_id, invite_payee_request, opts = {})
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug 'Calling API: PayeeInvitationApi.resend_payee_invite ...'
|
95
|
+
end
|
96
|
+
# verify the required parameter 'payee_id' is set
|
97
|
+
if @api_client.config.client_side_validation && payee_id.nil?
|
98
|
+
fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeeInvitationApi.resend_payee_invite"
|
99
|
+
end
|
100
|
+
# verify the required parameter 'invite_payee_request' is set
|
101
|
+
if @api_client.config.client_side_validation && invite_payee_request.nil?
|
102
|
+
fail ArgumentError, "Missing the required parameter 'invite_payee_request' when calling PayeeInvitationApi.resend_payee_invite"
|
103
|
+
end
|
104
|
+
# resource path
|
105
|
+
local_var_path = '/v1/payees/{payeeId}/invite'.sub('{' + 'payeeId' + '}', payee_id.to_s)
|
106
|
+
|
107
|
+
# query parameters
|
108
|
+
query_params = {}
|
109
|
+
|
110
|
+
# header parameters
|
111
|
+
header_params = {}
|
112
|
+
# HTTP header 'Accept' (if needed)
|
113
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
114
|
+
# HTTP header 'Content-Type'
|
115
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
116
|
+
|
117
|
+
# form parameters
|
118
|
+
form_params = {}
|
119
|
+
|
120
|
+
# http body (model)
|
121
|
+
post_body = @api_client.object_to_http_body(invite_payee_request)
|
122
|
+
auth_names = ['OAuth2']
|
123
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
124
|
+
:header_params => header_params,
|
125
|
+
:query_params => query_params,
|
126
|
+
:form_params => form_params,
|
127
|
+
:body => post_body,
|
128
|
+
:auth_names => auth_names,
|
129
|
+
:return_type => 'InvitationStatusResponse')
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug "API called: PayeeInvitationApi#resend_payee_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
+
end
|
133
|
+
return data, status_code, headers
|
134
|
+
end
|
135
|
+
|
136
|
+
# Intiate Payee Creation
|
137
|
+
# Initiate the process of creating 1 to 2000 payees in a batch Use the response location header to query for status (201 - Created, 400 - invalid request body, 409 - if there is a duplicate remote id within the batch / if there is a duplicate email within the batch).
|
138
|
+
# @param create_payees_request [CreatePayeesRequest] Post payees to create.
|
139
|
+
# @param [Hash] opts the optional parameters
|
140
|
+
# @return [CreatePayeesCSVResponse]
|
141
|
+
def v2_create_payee(create_payees_request, opts = {})
|
142
|
+
data, _status_code, _headers = v2_create_payee_with_http_info(create_payees_request, opts)
|
143
|
+
data
|
144
|
+
end
|
145
|
+
|
146
|
+
# Intiate Payee Creation
|
147
|
+
# Initiate the process of creating 1 to 2000 payees in a batch Use the response location header to query for status (201 - Created, 400 - invalid request body, 409 - if there is a duplicate remote id within the batch / if there is a duplicate email within the batch).
|
148
|
+
# @param create_payees_request [CreatePayeesRequest] Post payees to create.
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @return [Array<(CreatePayeesCSVResponse, Integer, Hash)>] CreatePayeesCSVResponse data, response status code and response headers
|
151
|
+
def v2_create_payee_with_http_info(create_payees_request, opts = {})
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug 'Calling API: PayeeInvitationApi.v2_create_payee ...'
|
154
|
+
end
|
155
|
+
# verify the required parameter 'create_payees_request' is set
|
156
|
+
if @api_client.config.client_side_validation && create_payees_request.nil?
|
157
|
+
fail ArgumentError, "Missing the required parameter 'create_payees_request' when calling PayeeInvitationApi.v2_create_payee"
|
158
|
+
end
|
159
|
+
# resource path
|
160
|
+
local_var_path = '/v2/payees'
|
161
|
+
|
162
|
+
# query parameters
|
163
|
+
query_params = {}
|
164
|
+
|
165
|
+
# header parameters
|
166
|
+
header_params = {}
|
167
|
+
# HTTP header 'Accept' (if needed)
|
168
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
169
|
+
# HTTP header 'Content-Type'
|
170
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
|
171
|
+
|
172
|
+
# form parameters
|
173
|
+
form_params = {}
|
174
|
+
|
175
|
+
# http body (model)
|
176
|
+
post_body = @api_client.object_to_http_body(create_payees_request)
|
177
|
+
auth_names = ['OAuth2']
|
178
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
179
|
+
:header_params => header_params,
|
180
|
+
:query_params => query_params,
|
181
|
+
:form_params => form_params,
|
182
|
+
:body => post_body,
|
183
|
+
:auth_names => auth_names,
|
184
|
+
:return_type => 'CreatePayeesCSVResponse')
|
185
|
+
if @api_client.config.debugging
|
186
|
+
@api_client.config.logger.debug "API called: PayeeInvitationApi#v2_create_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
187
|
+
end
|
188
|
+
return data, status_code, headers
|
189
|
+
end
|
190
|
+
|
191
|
+
# Query Batch Status
|
192
|
+
# Fetch the status of a specific batch of payees. The batch is fully processed when status is ACCEPTED and pendingCount is 0 ( 200 - OK, 404 - batch not found ).
|
193
|
+
# @param batch_id [String] Batch Id
|
194
|
+
# @param [Hash] opts the optional parameters
|
195
|
+
# @return [QueryBatchResponse]
|
196
|
+
def v2_query_batch_status(batch_id, opts = {})
|
197
|
+
data, _status_code, _headers = v2_query_batch_status_with_http_info(batch_id, opts)
|
198
|
+
data
|
199
|
+
end
|
200
|
+
|
201
|
+
# Query Batch Status
|
202
|
+
# Fetch the status of a specific batch of payees. The batch is fully processed when status is ACCEPTED and pendingCount is 0 ( 200 - OK, 404 - batch not found ).
|
203
|
+
# @param batch_id [String] Batch Id
|
204
|
+
# @param [Hash] opts the optional parameters
|
205
|
+
# @return [Array<(QueryBatchResponse, Integer, Hash)>] QueryBatchResponse data, response status code and response headers
|
206
|
+
def v2_query_batch_status_with_http_info(batch_id, opts = {})
|
207
|
+
if @api_client.config.debugging
|
208
|
+
@api_client.config.logger.debug 'Calling API: PayeeInvitationApi.v2_query_batch_status ...'
|
209
|
+
end
|
210
|
+
# verify the required parameter 'batch_id' is set
|
211
|
+
if @api_client.config.client_side_validation && batch_id.nil?
|
212
|
+
fail ArgumentError, "Missing the required parameter 'batch_id' when calling PayeeInvitationApi.v2_query_batch_status"
|
213
|
+
end
|
214
|
+
# resource path
|
215
|
+
local_var_path = '/v2/payees/batch/{batchId}'.sub('{' + 'batchId' + '}', batch_id.to_s)
|
216
|
+
|
217
|
+
# query parameters
|
218
|
+
query_params = {}
|
219
|
+
|
220
|
+
# header parameters
|
221
|
+
header_params = {}
|
222
|
+
# HTTP header 'Accept' (if needed)
|
223
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
224
|
+
|
225
|
+
# form parameters
|
226
|
+
form_params = {}
|
227
|
+
|
228
|
+
# http body (model)
|
229
|
+
post_body = nil
|
230
|
+
auth_names = ['OAuth2']
|
231
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
232
|
+
:header_params => header_params,
|
233
|
+
:query_params => query_params,
|
234
|
+
:form_params => form_params,
|
235
|
+
:body => post_body,
|
236
|
+
:auth_names => auth_names,
|
237
|
+
:return_type => 'QueryBatchResponse')
|
238
|
+
if @api_client.config.debugging
|
239
|
+
@api_client.config.logger.debug "API called: PayeeInvitationApi#v2_query_batch_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
240
|
+
end
|
241
|
+
return data, status_code, headers
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,217 @@
|
|
1
|
+
=begin
|
2
|
+
#Velo Payments APIs
|
3
|
+
|
4
|
+
### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.11.73
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module VeloPayments
|
16
|
+
class PayeesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete Payee by Id
|
23
|
+
# This API will delete Payee by Id (UUID). Deletion by ID is not allowed if: * Payee ID is not found * If Payee has not been on-boarded * If Payee is in grace period * If Payee has existing payments
|
24
|
+
# @param payee_id [String] The UUID of the payee.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def delete_payee_by_id(payee_id, opts = {})
|
28
|
+
delete_payee_by_id_with_http_info(payee_id, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Delete Payee by Id
|
33
|
+
# This API will delete Payee by Id (UUID). Deletion by ID is not allowed if: * Payee ID is not found * If Payee has not been on-boarded * If Payee is in grace period * If Payee has existing payments
|
34
|
+
# @param payee_id [String] The UUID of the payee.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def delete_payee_by_id_with_http_info(payee_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: PayeesApi.delete_payee_by_id ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'payee_id' is set
|
42
|
+
if @api_client.config.client_side_validation && payee_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeesApi.delete_payee_by_id"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v1/payees/{payeeId}'.sub('{' + 'payeeId' + '}', payee_id.to_s)
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = nil
|
59
|
+
auth_names = ['OAuth2']
|
60
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names)
|
66
|
+
if @api_client.config.debugging
|
67
|
+
@api_client.config.logger.debug "API called: PayeesApi#delete_payee_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
68
|
+
end
|
69
|
+
return data, status_code, headers
|
70
|
+
end
|
71
|
+
|
72
|
+
# Get Payee by Id
|
73
|
+
# Get Payee by Id
|
74
|
+
# @param payee_id [String] The UUID of the payee.
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @option opts [Boolean] :sensitive Optional. If omitted or set to false, any Personal Identifiable Information (PII) values are returned masked. If set to true, and you have permission, the PII values will be returned as their original unmasked values.
|
77
|
+
# @return [Payee]
|
78
|
+
def get_payee_by_id(payee_id, opts = {})
|
79
|
+
data, _status_code, _headers = get_payee_by_id_with_http_info(payee_id, opts)
|
80
|
+
data
|
81
|
+
end
|
82
|
+
|
83
|
+
# Get Payee by Id
|
84
|
+
# Get Payee by Id
|
85
|
+
# @param payee_id [String] The UUID of the payee.
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @option opts [Boolean] :sensitive Optional. If omitted or set to false, any Personal Identifiable Information (PII) values are returned masked. If set to true, and you have permission, the PII values will be returned as their original unmasked values.
|
88
|
+
# @return [Array<(Payee, Integer, Hash)>] Payee data, response status code and response headers
|
89
|
+
def get_payee_by_id_with_http_info(payee_id, opts = {})
|
90
|
+
if @api_client.config.debugging
|
91
|
+
@api_client.config.logger.debug 'Calling API: PayeesApi.get_payee_by_id ...'
|
92
|
+
end
|
93
|
+
# verify the required parameter 'payee_id' is set
|
94
|
+
if @api_client.config.client_side_validation && payee_id.nil?
|
95
|
+
fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeesApi.get_payee_by_id"
|
96
|
+
end
|
97
|
+
# resource path
|
98
|
+
local_var_path = '/v1/payees/{payeeId}'.sub('{' + 'payeeId' + '}', payee_id.to_s)
|
99
|
+
|
100
|
+
# query parameters
|
101
|
+
query_params = {}
|
102
|
+
query_params[:'sensitive'] = opts[:'sensitive'] if !opts[:'sensitive'].nil?
|
103
|
+
|
104
|
+
# header parameters
|
105
|
+
header_params = {}
|
106
|
+
# HTTP header 'Accept' (if needed)
|
107
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
108
|
+
|
109
|
+
# form parameters
|
110
|
+
form_params = {}
|
111
|
+
|
112
|
+
# http body (model)
|
113
|
+
post_body = nil
|
114
|
+
auth_names = ['OAuth2']
|
115
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
116
|
+
:header_params => header_params,
|
117
|
+
:query_params => query_params,
|
118
|
+
:form_params => form_params,
|
119
|
+
:body => post_body,
|
120
|
+
:auth_names => auth_names,
|
121
|
+
:return_type => 'Payee')
|
122
|
+
if @api_client.config.debugging
|
123
|
+
@api_client.config.logger.debug "API called: PayeesApi#get_payee_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
124
|
+
end
|
125
|
+
return data, status_code, headers
|
126
|
+
end
|
127
|
+
|
128
|
+
# List Payees
|
129
|
+
# Get a paginated response listing the payees for a payor.
|
130
|
+
# @param payor_id [String] The account owner Payor ID
|
131
|
+
# @param [Hash] opts the optional parameters
|
132
|
+
# @option opts [OfacStatus] :ofac_status The ofacStatus of the payees.
|
133
|
+
# @option opts [OnboardedStatus] :onboarded_status The onboarded status of the payees.
|
134
|
+
# @option opts [String] :email Email address
|
135
|
+
# @option opts [String] :display_name The display name of the payees.
|
136
|
+
# @option opts [String] :remote_id The remote id of the payees.
|
137
|
+
# @option opts [PayeeType] :payee_type The onboarded status of the payees.
|
138
|
+
# @option opts [String] :payee_country The country of the payees.
|
139
|
+
# @option opts [Integer] :page Page number. Default is 1. (default to 1)
|
140
|
+
# @option opts [Integer] :page_size Page size. Default is 25. Max allowable is 100. (default to 25)
|
141
|
+
# @option opts [String] :sort List of sort fields (e.g. ?sort=onboardedStatus:asc,name:asc) Default is name:asc 'name' is treated as company name for companies - last name + ',' + firstName for individuals The supported sort fields are - payeeId, displayName, payoutStatus, onboardedStatus. (default to 'displayName:asc')
|
142
|
+
# @return [PayeeResponse]
|
143
|
+
def list_payees(payor_id, opts = {})
|
144
|
+
data, _status_code, _headers = list_payees_with_http_info(payor_id, opts)
|
145
|
+
data
|
146
|
+
end
|
147
|
+
|
148
|
+
# List Payees
|
149
|
+
# Get a paginated response listing the payees for a payor.
|
150
|
+
# @param payor_id [String] The account owner Payor ID
|
151
|
+
# @param [Hash] opts the optional parameters
|
152
|
+
# @option opts [OfacStatus] :ofac_status The ofacStatus of the payees.
|
153
|
+
# @option opts [OnboardedStatus] :onboarded_status The onboarded status of the payees.
|
154
|
+
# @option opts [String] :email Email address
|
155
|
+
# @option opts [String] :display_name The display name of the payees.
|
156
|
+
# @option opts [String] :remote_id The remote id of the payees.
|
157
|
+
# @option opts [PayeeType] :payee_type The onboarded status of the payees.
|
158
|
+
# @option opts [String] :payee_country The country of the payees.
|
159
|
+
# @option opts [Integer] :page Page number. Default is 1.
|
160
|
+
# @option opts [Integer] :page_size Page size. Default is 25. Max allowable is 100.
|
161
|
+
# @option opts [String] :sort List of sort fields (e.g. ?sort=onboardedStatus:asc,name:asc) Default is name:asc 'name' is treated as company name for companies - last name + ',' + firstName for individuals The supported sort fields are - payeeId, displayName, payoutStatus, onboardedStatus.
|
162
|
+
# @return [Array<(PayeeResponse, Integer, Hash)>] PayeeResponse data, response status code and response headers
|
163
|
+
def list_payees_with_http_info(payor_id, opts = {})
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug 'Calling API: PayeesApi.list_payees ...'
|
166
|
+
end
|
167
|
+
# verify the required parameter 'payor_id' is set
|
168
|
+
if @api_client.config.client_side_validation && payor_id.nil?
|
169
|
+
fail ArgumentError, "Missing the required parameter 'payor_id' when calling PayeesApi.list_payees"
|
170
|
+
end
|
171
|
+
pattern = Regexp.new(/[a-zA-Z]+[:desc|:asc]/)
|
172
|
+
if @api_client.config.client_side_validation && !opts[:'sort'].nil? && opts[:'sort'] !~ pattern
|
173
|
+
fail ArgumentError, "invalid value for 'opts[:\"sort\"]' when calling PayeesApi.list_payees, must conform to the pattern #{pattern}."
|
174
|
+
end
|
175
|
+
|
176
|
+
# resource path
|
177
|
+
local_var_path = '/v1/payees'
|
178
|
+
|
179
|
+
# query parameters
|
180
|
+
query_params = {}
|
181
|
+
query_params[:'payorId'] = payor_id
|
182
|
+
query_params[:'ofacStatus'] = opts[:'ofac_status'] if !opts[:'ofac_status'].nil?
|
183
|
+
query_params[:'onboardedStatus'] = opts[:'onboarded_status'] if !opts[:'onboarded_status'].nil?
|
184
|
+
query_params[:'Email'] = opts[:'email'] if !opts[:'email'].nil?
|
185
|
+
query_params[:'displayName'] = opts[:'display_name'] if !opts[:'display_name'].nil?
|
186
|
+
query_params[:'remoteId'] = opts[:'remote_id'] if !opts[:'remote_id'].nil?
|
187
|
+
query_params[:'payeeType'] = opts[:'payee_type'] if !opts[:'payee_type'].nil?
|
188
|
+
query_params[:'payeeCountry'] = opts[:'payee_country'] if !opts[:'payee_country'].nil?
|
189
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
190
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
191
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
192
|
+
|
193
|
+
# header parameters
|
194
|
+
header_params = {}
|
195
|
+
# HTTP header 'Accept' (if needed)
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
197
|
+
|
198
|
+
# form parameters
|
199
|
+
form_params = {}
|
200
|
+
|
201
|
+
# http body (model)
|
202
|
+
post_body = nil
|
203
|
+
auth_names = ['OAuth2']
|
204
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
205
|
+
:header_params => header_params,
|
206
|
+
:query_params => query_params,
|
207
|
+
:form_params => form_params,
|
208
|
+
:body => post_body,
|
209
|
+
:auth_names => auth_names,
|
210
|
+
:return_type => 'PayeeResponse')
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug "API called: PayeesApi#list_payees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
213
|
+
end
|
214
|
+
return data, status_code, headers
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|