adyen-ruby-api-library 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codeql.yml +4 -4
- data/.github/workflows/label_new_issues.yml +1 -1
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/ruby.yml +11 -3
- data/.github/workflows/rubygems_release.yml +2 -2
- data/.github/workflows/stale.yml +1 -1
- data/AGENTS.md +73 -0
- data/README.md +3 -0
- data/VERSION +1 -1
- data/lib/adyen/client.rb +14 -3
- data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +46 -0
- data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +46 -0
- data/lib/adyen/services/balancePlatform.rb +10 -0
- data/lib/adyen/services/capital/grant_accounts_api.rb +26 -0
- data/lib/adyen/services/capital/grant_offers_api.rb +36 -0
- data/lib/adyen/services/capital/grants_api.rb +76 -0
- data/lib/adyen/services/capital.rb +34 -0
- data/lib/adyen/services/checkout/recurring_api.rb +10 -0
- data/lib/adyen/services/recurring/recurring_api.rb +1 -1
- data/lib/adyen/services/recurring.rb +1 -1
- data/lib/adyen/version.rb +1 -1
- data/lib/adyen-ruby-api-library.rb +1 -0
- data/spec/capital_spec.rb +186 -0
- data/spec/client_spec.rb +184 -68
- data/spec/mocks/responses/Capital/get-grant-account-success.json +20 -0
- data/spec/mocks/responses/Capital/get-grant-disbursement-success.json +26 -0
- data/spec/mocks/responses/Capital/get-grant-disbursements-success.json +30 -0
- data/spec/mocks/responses/Capital/get-grant-offer-success.json +31 -0
- data/spec/mocks/responses/Capital/get-grant-success.json +22 -0
- data/spec/mocks/responses/Capital/grant-offers-success.json +19 -0
- data/spec/mocks/responses/Capital/grants-success.json +26 -0
- data/spec/mocks/responses/Capital/request-grant.json +31 -0
- data/spec/mocks/responses/Capital/update-grant-disbursement-success.json +26 -0
- metadata +18 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dbeb4e469ee9b14dfa153a16e0873e8a539db369c9c06eea43918fb03e5b7b99
|
|
4
|
+
data.tar.gz: 9ca4161c2c61c51f684d91ab31516660c418fb96df34c396c9565bec4595de19
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2dbe3e238e9a7f2778dbd3e2fd6d7a49644d3c78da3514b947a2f4e10edd16afeab10ce85f48c6a4c326e5e41e8af0da08a7ba744e43dc62864ea18f04fe1bb
|
|
7
|
+
data.tar.gz: 05f49063c1d4250c3af8d3dc04ab381c5fa01eace21133d9429fdf4f0756789d05d814276eeac493d351bced3476014f68a7bef61013f6ef760c47b5dc290135
|
|
@@ -20,18 +20,18 @@ jobs:
|
|
|
20
20
|
|
|
21
21
|
steps:
|
|
22
22
|
- name: Checkout
|
|
23
|
-
uses: actions/checkout@
|
|
23
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
24
24
|
|
|
25
25
|
- name: Initialize CodeQL
|
|
26
|
-
uses: github/codeql-action/init@
|
|
26
|
+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4
|
|
27
27
|
with:
|
|
28
28
|
languages: ${{ matrix.language }}
|
|
29
29
|
queries: +security-and-quality
|
|
30
30
|
|
|
31
31
|
- name: Autobuild
|
|
32
|
-
uses: github/codeql-action/autobuild@
|
|
32
|
+
uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4
|
|
33
33
|
|
|
34
34
|
- name: Perform CodeQL Analysis
|
|
35
|
-
uses: github/codeql-action/analyze@
|
|
35
|
+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4
|
|
36
36
|
with:
|
|
37
37
|
category: "/language:${{ matrix.language }}"
|
|
@@ -8,7 +8,7 @@ jobs:
|
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
steps:
|
|
10
10
|
- name: Add 'needs response' label to new issues
|
|
11
|
-
uses: actions-ecosystem/action-add-labels@v1
|
|
11
|
+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
|
|
12
12
|
with:
|
|
13
13
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
14
14
|
labels: 'needs response'
|
|
@@ -28,9 +28,9 @@ jobs:
|
|
|
28
28
|
pull-requests: write
|
|
29
29
|
runs-on: ubuntu-latest
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
32
32
|
- name: Prepare the next main release
|
|
33
|
-
uses: Adyen/release-automation-action@v1.4.0
|
|
33
|
+
uses: Adyen/release-automation-action@3e5694d5b365f344a62436e84049511ef318ecf5 # v1.4.0
|
|
34
34
|
with:
|
|
35
35
|
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
|
|
36
36
|
develop-branch: main
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
name: ruby
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
merge_group:
|
|
11
|
+
workflow_dispatch: {}
|
|
4
12
|
|
|
5
13
|
jobs:
|
|
6
14
|
test:
|
|
@@ -12,8 +20,8 @@ jobs:
|
|
|
12
20
|
ruby: [2.7, '3.0', 3.1, 3.2, head]
|
|
13
21
|
runs-on: ${{ matrix.os }}
|
|
14
22
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
16
|
-
- uses: ruby/setup-ruby@v1
|
|
23
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
24
|
+
- uses: ruby/setup-ruby@8a836efbcebe5de0fe86b48a775b7a31b5c70c93 # v1
|
|
17
25
|
with:
|
|
18
26
|
ruby-version: ${{ matrix.ruby }}
|
|
19
27
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
@@ -9,10 +9,10 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
13
13
|
- name: Release Gem on RubyGems
|
|
14
14
|
if: contains(github.ref, 'refs/tags/v')
|
|
15
|
-
uses: cadwallion/publish-rubygems-action@v1.1.0
|
|
15
|
+
uses: cadwallion/publish-rubygems-action@94a6f4cd5350581749c569b5001eecc864e3ad0b # v1.1.0
|
|
16
16
|
env:
|
|
17
17
|
GITHUB_TOKEN: ${{secrets.TOKEN_RUBYGEMS_RELEASES_WITH_EXPIRATION}}
|
|
18
18
|
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
data/.github/workflows/stale.yml
CHANGED
|
@@ -7,7 +7,7 @@ jobs:
|
|
|
7
7
|
stale:
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
steps:
|
|
10
|
-
- uses: actions/stale@
|
|
10
|
+
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10
|
|
11
11
|
with:
|
|
12
12
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
13
13
|
stale-issue-message: 'This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs.'
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
This is the Adyen Ruby API Library, providing Ruby developers with an easy way to interact with the Adyen API. The library is a wrapper around the Adyen API, with services generated from OpenAPI specifications.
|
|
4
|
+
|
|
5
|
+
## Code Generation
|
|
6
|
+
|
|
7
|
+
A significant portion of this library, particularly the API services, is automatically generated.
|
|
8
|
+
|
|
9
|
+
- **Engine**: We use [OpenAPI Generator](https://openapi-generator.tech/) with custom [Mustache](https://mustache.github.io/) templates to convert Adyen's OpenAPI specifications into Ruby code.
|
|
10
|
+
- **Templates**: The custom templates are located in the `/templates` directory. These templates are tailored to fit our custom HTTP client and service structure.
|
|
11
|
+
- **Automation**:
|
|
12
|
+
- **Centralized**: The primary generation process is managed in a separate repository, [`adyen-sdk-automation`](https://github.com/Adyen/adyen-sdk-automation). Changes to the OpenAPI specs trigger a GitHub workflow in that repository, which generates the code and opens Pull Requests in this library.
|
|
13
|
+
- **Local**: For development and testing, you must use the [`adyen-sdk-automation`](https://github.com/Adyen/adyen-sdk-automation) repository.
|
|
14
|
+
|
|
15
|
+
### Local Code Generation
|
|
16
|
+
|
|
17
|
+
To test new features or changes to the templates, you must run the generation process from a local clone of the `adyen-sdk-automation` repository.
|
|
18
|
+
|
|
19
|
+
1. **Clone the automation repository**:
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/Adyen/adyen-sdk-automation.git
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. **Link this library**: The automation project needs to target your local clone of `adyen-ruby-api-library`. From inside the `adyen-sdk-automation` directory, run the following commands. This will replace the `ruby/repo` directory with a symlink to your local project.
|
|
25
|
+
```bash
|
|
26
|
+
rm -rf ruby/repo
|
|
27
|
+
ln -s /path/to/your/adyen-ruby-api-library ruby/repo
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **Run the generator**: You can now run the Gradle commands to generate code.
|
|
31
|
+
- **To generate all services for the Ruby library**:
|
|
32
|
+
```bash
|
|
33
|
+
./gradlew :ruby:services
|
|
34
|
+
```
|
|
35
|
+
- **To generate a single service (e.g., Checkout)**:
|
|
36
|
+
```bash
|
|
37
|
+
./gradlew :ruby:checkout
|
|
38
|
+
```
|
|
39
|
+
- **To clean the repository before generating**:
|
|
40
|
+
```bash
|
|
41
|
+
./gradlew :ruby:cleanRepo :ruby:checkout
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Core Components
|
|
45
|
+
|
|
46
|
+
- **`Adyen::Client`**: The main class in `lib/adyen/client.rb` that provides easy access to all API services and handles configuration (API key, environment, etc.).
|
|
47
|
+
- **`Adyen::Service`**: The base class located in `lib/adyen/services/service.rb` from which all generated services inherit. It contains the logic for making API calls.
|
|
48
|
+
- **`lib/adyen/services/`**: This directory contains the generated service classes (e.g., `Checkout`, `Management`) that expose methods for specific API endpoints. This library does not use generated models for requests and responses; standard Ruby Hashes are used instead.
|
|
49
|
+
|
|
50
|
+
## Development Workflow
|
|
51
|
+
|
|
52
|
+
### Setup
|
|
53
|
+
|
|
54
|
+
To install the library and its development dependencies, run:
|
|
55
|
+
```bash
|
|
56
|
+
bundle config set with development
|
|
57
|
+
bundle install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Running Tests
|
|
61
|
+
|
|
62
|
+
To run the RSpec test suite, use the following command:
|
|
63
|
+
```bash
|
|
64
|
+
bundle exec rspec
|
|
65
|
+
```
|
|
66
|
+
This is the command used in our GitHub Actions workflow to ensure code quality and correctness.
|
|
67
|
+
|
|
68
|
+
## Release Process
|
|
69
|
+
|
|
70
|
+
The release process is automated via GitHub Actions and involves two main workflows:
|
|
71
|
+
|
|
72
|
+
1. **Release PR Creation**: After a pull request is merged to `main`, the `release.yml` workflow automatically creates a new pull request that bumps the version number in `lib/adyen/version.rb`.
|
|
73
|
+
2. **Publishing to RubyGems**: Once the version bump PR is merged, a maintainer can create a GitHub Release. This can be done by manually running the `Release` workflow with the `github-release` option. The creation of a published release on GitHub triggers the `rubygems_release.yml` workflow, which publishes the new version of the gem to RubyGems.
|
data/README.md
CHANGED
|
@@ -13,6 +13,7 @@ This library supports the following:
|
|
|
13
13
|
|-------------------------------------------------------------------------------------------------------------------------------|:-----------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
|
|
14
14
|
| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | v54 | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [BinLookup](lib/adyen/services/binLookup.rb) |
|
|
15
15
|
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | v71 | Our latest integration for accepting online payments. | [CheckoutAPI](lib/adyen/services/checkout.rb) |
|
|
16
|
+
| [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) | v1 | Provides endpoints for embedding Adyen Capital into your marketplace or platform. | [Capital](lib/adyen/services/capital.rb) |
|
|
16
17
|
| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](lib/adyen/services/balancePlatform.rb) |
|
|
17
18
|
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](lib/adyen/services/dataProtection.rb) |
|
|
18
19
|
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v4 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
|
|
@@ -70,6 +71,8 @@ require 'adyen-ruby-api-library'
|
|
|
70
71
|
adyen = Adyen::Client.new
|
|
71
72
|
|
|
72
73
|
adyen.api_key = 'AF5XXXXXXXXXXXXXXXXXXXX'
|
|
74
|
+
# If applicable, set application name (for tracking purposes)
|
|
75
|
+
# adyen.application_name = 'MyTestApp'
|
|
73
76
|
|
|
74
77
|
~~~~
|
|
75
78
|
|
data/VERSION
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.2.0
|
|
2
2
|
|
data/lib/adyen/client.rb
CHANGED
|
@@ -12,16 +12,18 @@ require_relative './result'
|
|
|
12
12
|
|
|
13
13
|
module Adyen
|
|
14
14
|
class Client
|
|
15
|
-
attr_accessor :ws_user, :ws_password, :api_key, :oauth_token, :client, :adapter
|
|
15
|
+
attr_accessor :ws_user, :ws_password, :api_key, :oauth_token, :client, :adapter, :application_name
|
|
16
16
|
attr_reader :env, :connection_options, :adapter_options, :terminal_region
|
|
17
17
|
|
|
18
18
|
def initialize(ws_user: nil, ws_password: nil, api_key: nil, oauth_token: nil, env: :live, adapter: nil, mock_port: 3001,
|
|
19
|
-
live_url_prefix: nil, mock_service_url_base: nil, connection_options: nil, adapter_options: nil, terminal_region: nil
|
|
19
|
+
live_url_prefix: nil, mock_service_url_base: nil, connection_options: nil, adapter_options: nil, terminal_region: nil,
|
|
20
|
+
application_name: nil)
|
|
20
21
|
@ws_user = ws_user
|
|
21
22
|
@ws_password = ws_password
|
|
22
23
|
@api_key = api_key
|
|
23
24
|
@oauth_token = oauth_token
|
|
24
25
|
@env = env
|
|
26
|
+
@application_name = application_name
|
|
25
27
|
@adapter = adapter || Faraday.default_adapter
|
|
26
28
|
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.1')
|
|
27
29
|
# for faraday 2.1 and higher
|
|
@@ -95,6 +97,9 @@ module Adyen
|
|
|
95
97
|
when 'Transfers'
|
|
96
98
|
url = "https://balanceplatform-api-#{@env}.adyen.com/btl"
|
|
97
99
|
supports_live_url_prefix = false
|
|
100
|
+
when 'Capital'
|
|
101
|
+
url = "https://balanceplatform-api-#{@env}.adyen.com/capital"
|
|
102
|
+
supports_live_url_prefix = false
|
|
98
103
|
when 'Management'
|
|
99
104
|
url = "https://management-#{@env}.adyen.com"
|
|
100
105
|
supports_live_url_prefix = false
|
|
@@ -152,7 +157,9 @@ module Adyen
|
|
|
152
157
|
conn = Faraday.new(url, @connection_options) do |faraday|
|
|
153
158
|
faraday.adapter @adapter, **@adapter_options
|
|
154
159
|
faraday.headers['Content-Type'] = 'application/json'
|
|
155
|
-
|
|
160
|
+
user_agent = "#{Adyen::NAME}/#{Adyen::VERSION}"
|
|
161
|
+
user_agent = "#{@application_name} #{user_agent}" if @application_name && !@application_name.strip.empty?
|
|
162
|
+
faraday.headers['User-Agent'] = user_agent
|
|
156
163
|
|
|
157
164
|
# set header based on auth_type and service
|
|
158
165
|
auth_header(auth_type, faraday)
|
|
@@ -327,6 +334,10 @@ module Adyen
|
|
|
327
334
|
@balance_control ||= Adyen::BalanceControl.new(self)
|
|
328
335
|
end
|
|
329
336
|
|
|
337
|
+
def capital
|
|
338
|
+
@capital ||= Adyen::Capital.new(self)
|
|
339
|
+
end
|
|
340
|
+
|
|
330
341
|
|
|
331
342
|
private
|
|
332
343
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
5
|
+
# Ref: https://openapi-generator.tech
|
|
6
|
+
#
|
|
7
|
+
# Do not edit the class manually.
|
|
8
|
+
class SCAAssociationManagementApi < Service
|
|
9
|
+
attr_accessor :service, :version
|
|
10
|
+
|
|
11
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
12
|
+
super(client, version, 'BalancePlatform')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Approve a pending approval association
|
|
16
|
+
def approve_association(request, headers: {})
|
|
17
|
+
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
|
|
18
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
+
endpoint = format(endpoint)
|
|
20
|
+
|
|
21
|
+
action = { method: 'patch', url: endpoint }
|
|
22
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Get a list of devices associated with an entity
|
|
26
|
+
def list_associations(headers: {}, query_params: {})
|
|
27
|
+
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
|
|
28
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
+
endpoint = format(endpoint)
|
|
30
|
+
endpoint += create_query_string(query_params)
|
|
31
|
+
action = { method: 'get', url: endpoint }
|
|
32
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Delete association to devices
|
|
36
|
+
def remove_association(request, headers: {})
|
|
37
|
+
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
|
|
38
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
+
endpoint = format(endpoint)
|
|
40
|
+
|
|
41
|
+
action = { method: 'delete', url: endpoint }
|
|
42
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
5
|
+
# Ref: https://openapi-generator.tech
|
|
6
|
+
#
|
|
7
|
+
# Do not edit the class manually.
|
|
8
|
+
class SCADeviceManagementApi < Service
|
|
9
|
+
attr_accessor :service, :version
|
|
10
|
+
|
|
11
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
12
|
+
super(client, version, 'BalancePlatform')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Begin SCA device registration
|
|
16
|
+
def begin_sca_device_registration(request, headers: {})
|
|
17
|
+
endpoint = '/scaDevices'.gsub(/{.+?}/, '%s')
|
|
18
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
+
endpoint = format(endpoint)
|
|
20
|
+
|
|
21
|
+
action = { method: 'post', url: endpoint }
|
|
22
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Finish registration process for a SCA device
|
|
26
|
+
def finish_sca_device_registration(request, device_id, headers: {})
|
|
27
|
+
endpoint = '/scaDevices/{deviceId}'.gsub(/{.+?}/, '%s')
|
|
28
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
+
endpoint = format(endpoint, device_id)
|
|
30
|
+
|
|
31
|
+
action = { method: 'patch', url: endpoint }
|
|
32
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Create a new SCA association for a device
|
|
36
|
+
def submit_sca_association(request, device_id, headers: {})
|
|
37
|
+
endpoint = '/scaDevices/{deviceId}/scaAssociations'.gsub(/{.+?}/, '%s')
|
|
38
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
+
endpoint = format(endpoint, device_id)
|
|
40
|
+
|
|
41
|
+
action = { method: 'post', url: endpoint }
|
|
42
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -12,6 +12,8 @@ require_relative 'balancePlatform/network_tokens_api'
|
|
|
12
12
|
require_relative 'balancePlatform/payment_instrument_groups_api'
|
|
13
13
|
require_relative 'balancePlatform/payment_instruments_api'
|
|
14
14
|
require_relative 'balancePlatform/platform_api'
|
|
15
|
+
require_relative 'balancePlatform/sca_association_management_api'
|
|
16
|
+
require_relative 'balancePlatform/sca_device_management_api'
|
|
15
17
|
require_relative 'balancePlatform/transaction_rules_api'
|
|
16
18
|
require_relative 'balancePlatform/transfer_limits_balance_account_level_api'
|
|
17
19
|
require_relative 'balancePlatform/transfer_limits_balance_platform_level_api'
|
|
@@ -89,6 +91,14 @@ module Adyen
|
|
|
89
91
|
@platform_api ||= Adyen::PlatformApi.new(@client, @version)
|
|
90
92
|
end
|
|
91
93
|
|
|
94
|
+
def sca_association_management_api
|
|
95
|
+
@sca_association_management_api ||= Adyen::SCAAssociationManagementApi.new(@client, @version)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def sca_device_management_api
|
|
99
|
+
@sca_device_management_api ||= Adyen::SCADeviceManagementApi.new(@client, @version)
|
|
100
|
+
end
|
|
101
|
+
|
|
92
102
|
def transaction_rules_api
|
|
93
103
|
@transaction_rules_api ||= Adyen::TransactionRulesApi.new(@client, @version)
|
|
94
104
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
5
|
+
# Ref: https://openapi-generator.tech
|
|
6
|
+
#
|
|
7
|
+
# Do not edit the class manually.
|
|
8
|
+
class GrantAccountsApi < Service
|
|
9
|
+
attr_accessor :service, :version
|
|
10
|
+
|
|
11
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
12
|
+
super(client, version, 'Capital')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Get the information of your grant account
|
|
16
|
+
def get_grant_account_information(id, headers: {})
|
|
17
|
+
endpoint = '/grantAccounts/{id}'.gsub(/{.+?}/, '%s')
|
|
18
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
+
endpoint = format(endpoint, id)
|
|
20
|
+
|
|
21
|
+
action = { method: 'get', url: endpoint }
|
|
22
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
5
|
+
# Ref: https://openapi-generator.tech
|
|
6
|
+
#
|
|
7
|
+
# Do not edit the class manually.
|
|
8
|
+
class GrantOffersApi < Service
|
|
9
|
+
attr_accessor :service, :version
|
|
10
|
+
|
|
11
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
12
|
+
super(client, version, 'Capital')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Get all available grant offers
|
|
16
|
+
def get_all_grant_offers(headers: {}, query_params: {})
|
|
17
|
+
endpoint = '/grantOffers'.gsub(/{.+?}/, '%s')
|
|
18
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
+
endpoint = format(endpoint)
|
|
20
|
+
endpoint += create_query_string(query_params)
|
|
21
|
+
action = { method: 'get', url: endpoint }
|
|
22
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Get the details of a grant offer
|
|
26
|
+
def get_grant_offer(id, headers: {})
|
|
27
|
+
endpoint = '/grantOffers/{id}'.gsub(/{.+?}/, '%s')
|
|
28
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
+
endpoint = format(endpoint, id)
|
|
30
|
+
|
|
31
|
+
action = { method: 'get', url: endpoint }
|
|
32
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
5
|
+
# Ref: https://openapi-generator.tech
|
|
6
|
+
#
|
|
7
|
+
# Do not edit the class manually.
|
|
8
|
+
class GrantsApi < Service
|
|
9
|
+
attr_accessor :service, :version
|
|
10
|
+
|
|
11
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
12
|
+
super(client, version, 'Capital')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Get all the disbursements of a grant
|
|
16
|
+
def get_all_grant_disbursements(grant_id, headers: {})
|
|
17
|
+
endpoint = '/grants/{grantId}/disbursements'.gsub(/{.+?}/, '%s')
|
|
18
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
+
endpoint = format(endpoint, grant_id)
|
|
20
|
+
|
|
21
|
+
action = { method: 'get', url: endpoint }
|
|
22
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Get all the grants of an account holder
|
|
26
|
+
def get_all_grants(headers: {}, query_params: {})
|
|
27
|
+
endpoint = '/grants'.gsub(/{.+?}/, '%s')
|
|
28
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
+
endpoint = format(endpoint)
|
|
30
|
+
endpoint += create_query_string(query_params)
|
|
31
|
+
action = { method: 'get', url: endpoint }
|
|
32
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Get the details of a grant
|
|
36
|
+
def get_grant(grant_id, headers: {})
|
|
37
|
+
endpoint = '/grants/{grantId}'.gsub(/{.+?}/, '%s')
|
|
38
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
+
endpoint = format(endpoint, grant_id)
|
|
40
|
+
|
|
41
|
+
action = { method: 'get', url: endpoint }
|
|
42
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Get disbursement details
|
|
46
|
+
def get_grant_disbursement(grant_id, disbursement_id, headers: {})
|
|
47
|
+
endpoint = '/grants/{grantId}/disbursements/{disbursementId}'.gsub(/{.+?}/, '%s')
|
|
48
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
+
endpoint = format(endpoint, grant_id, disbursement_id)
|
|
50
|
+
|
|
51
|
+
action = { method: 'get', url: endpoint }
|
|
52
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Make a request for a grant
|
|
56
|
+
def request_grant(request, headers: {})
|
|
57
|
+
endpoint = '/grants'.gsub(/{.+?}/, '%s')
|
|
58
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
+
endpoint = format(endpoint)
|
|
60
|
+
|
|
61
|
+
action = { method: 'post', url: endpoint }
|
|
62
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Update the repayment configuration of a disbursement
|
|
66
|
+
def update_grant_disbursement(request, grant_id, disbursement_id, headers: {})
|
|
67
|
+
endpoint = '/grants/{grantId}/disbursements/{disbursementId}'.gsub(/{.+?}/, '%s')
|
|
68
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
69
|
+
endpoint = format(endpoint, grant_id, disbursement_id)
|
|
70
|
+
|
|
71
|
+
action = { method: 'patch', url: endpoint }
|
|
72
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require_relative 'capital/grant_accounts_api'
|
|
2
|
+
require_relative 'capital/grant_offers_api'
|
|
3
|
+
require_relative 'capital/grants_api'
|
|
4
|
+
|
|
5
|
+
module Adyen
|
|
6
|
+
|
|
7
|
+
# NOTE: This class is auto generated by OpenAPI Generator
|
|
8
|
+
# Ref: https://openapi-generator.tech
|
|
9
|
+
#
|
|
10
|
+
# Do not edit the class manually.
|
|
11
|
+
class Capital
|
|
12
|
+
attr_accessor :service, :version
|
|
13
|
+
|
|
14
|
+
DEFAULT_VERSION = 1
|
|
15
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
16
|
+
@service = 'Capital'
|
|
17
|
+
@client = client
|
|
18
|
+
@version = version
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def grant_accounts_api
|
|
22
|
+
@grant_accounts_api ||= Adyen::GrantAccountsApi.new(@client, @version)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def grant_offers_api
|
|
26
|
+
@grant_offers_api ||= Adyen::GrantOffersApi.new(@client, @version)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def grants_api
|
|
30
|
+
@grants_api ||= Adyen::GrantsApi.new(@client, @version)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -22,6 +22,16 @@ module Adyen
|
|
|
22
22
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
# Forward stored payment details
|
|
26
|
+
def forward(request, headers: {})
|
|
27
|
+
endpoint = '/forward'.gsub(/{.+?}/, '%s')
|
|
28
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
+
endpoint = format(endpoint)
|
|
30
|
+
|
|
31
|
+
action = { method: 'post', url: endpoint }
|
|
32
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
33
|
+
end
|
|
34
|
+
|
|
25
35
|
# Get tokens for stored payment details
|
|
26
36
|
def get_tokens_for_stored_payment_details(headers: {}, query_params: {})
|
|
27
37
|
endpoint = '/storedPaymentMethods'.gsub(/{.+?}/, '%s')
|
data/lib/adyen/version.rb
CHANGED