|
1 | | -require_relative './service' |
| 1 | +require_relative 'disputes/disputes_api' |
| 2 | + |
2 | 3 | module Adyen |
3 | 4 |
|
4 | 5 | # NOTE: This class is auto generated by OpenAPI Generator |
5 | 6 | # Ref: https://openapi-generator.tech |
6 | 7 | # |
7 | 8 | # Do not edit the class manually. |
8 | | - class Disputes < Service |
| 9 | + class Disputes |
9 | 10 | attr_accessor :service, :version |
10 | 11 |
|
11 | 12 | DEFAULT_VERSION = 30 |
12 | 13 | def initialize(client, version = DEFAULT_VERSION) |
13 | | - super(client, version, 'Disputes') |
14 | | - end |
15 | | - |
16 | | - # Accept a dispute |
17 | | - def accept_dispute(request, headers: {}) |
18 | | - endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s') |
19 | | - endpoint = endpoint.gsub(%r{^/}, '') |
20 | | - endpoint = format(endpoint) |
21 | | - |
22 | | - action = { method: 'post', url: endpoint } |
23 | | - @client.call_adyen_api(@service, action, request, headers, @version) |
24 | | - end |
25 | | - |
26 | | - # Defend a dispute |
27 | | - def defend_dispute(request, headers: {}) |
28 | | - endpoint = '/defendDispute'.gsub(/{.+?}/, '%s') |
29 | | - endpoint = endpoint.gsub(%r{^/}, '') |
30 | | - endpoint = format(endpoint) |
31 | | - |
32 | | - action = { method: 'post', url: endpoint } |
33 | | - @client.call_adyen_api(@service, action, request, headers, @version) |
34 | | - end |
35 | | - |
36 | | - # Delete a defense document |
37 | | - def delete_dispute_defense_document(request, headers: {}) |
38 | | - endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s') |
39 | | - endpoint = endpoint.gsub(%r{^/}, '') |
40 | | - endpoint = format(endpoint) |
41 | | - |
42 | | - action = { method: 'post', url: endpoint } |
43 | | - @client.call_adyen_api(@service, action, request, headers, @version) |
44 | | - end |
45 | | - |
46 | | - # Get applicable defense reasons |
47 | | - def retrieve_applicable_defense_reasons(request, headers: {}) |
48 | | - endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s') |
49 | | - endpoint = endpoint.gsub(%r{^/}, '') |
50 | | - endpoint = format(endpoint) |
51 | | - |
52 | | - action = { method: 'post', url: endpoint } |
53 | | - @client.call_adyen_api(@service, action, request, headers, @version) |
| 14 | + @service = 'Disputes' |
| 15 | + @client = client |
| 16 | + @version = version |
54 | 17 | end |
55 | 18 |
|
56 | | - # Supply a defense document |
57 | | - def supply_defense_document(request, headers: {}) |
58 | | - endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s') |
59 | | - endpoint = endpoint.gsub(%r{^/}, '') |
60 | | - endpoint = format(endpoint) |
61 | | - |
62 | | - action = { method: 'post', url: endpoint } |
63 | | - @client.call_adyen_api(@service, action, request, headers, @version) |
| 19 | + def disputes_api |
| 20 | + @disputes_api ||= Adyen::DisputesApi.new(@client, @version) |
64 | 21 | end |
65 | 22 |
|
66 | 23 | end |
|
0 commit comments