Skip to content

Commit

Permalink
Add Disputes API
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleffio committed Oct 19, 2023
1 parent e827bad commit a66fb68
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 15 deletions.
63 changes: 63 additions & 0 deletions Adyen/services/disputes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from .base import AdyenServiceBase


class AdyenDisputesApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenDisputesApi, self).__init__(client=client)
self.service = "disputes"
self.baseUrl = "https://ca-test.adyen.com/ca/services/DisputeService/v30"

def accept_dispute(self, request, idempotency_key=None, **kwargs):
"""
Accept a dispute
"""
endpoint = self.baseUrl + f"/acceptDispute"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def defend_dispute(self, request, idempotency_key=None, **kwargs):
"""
Defend a dispute
"""
endpoint = self.baseUrl + f"/defendDispute"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def delete_dispute_defense_document(self, request, idempotency_key=None, **kwargs):
"""
Delete a defense document
"""
endpoint = self.baseUrl + f"/deleteDisputeDefenseDocument"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def download_dispute_defense_document(self, request, idempotency_key=None, **kwargs):
"""
Download a defense document
"""
endpoint = self.baseUrl + f"/downloadDisputeDefenseDocument"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def retrieve_applicable_defense_reasons(self, request, idempotency_key=None, **kwargs):
"""
Get applicable defense reasons
"""
endpoint = self.baseUrl + f"/retrieveApplicableDefenseReasons"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def supply_defense_document(self, request, idempotency_key=None, **kwargs):
"""
Supply a defense document
"""
endpoint = self.baseUrl + f"/supplyDefenseDocument"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ openapi-generator-jar:=build/openapi-generator-cli.jar
openapi-generator-cli:=java -jar $(openapi-generator-jar)
output:=build/out
services:=balancePlatform checkout legalEntityManagement management payments payouts transfers
smallServices:=binlookup dataProtection recurring storedValue terminal
smallServices:=binlookup dataProtection recurring storedValue terminal disputes

all: $(services) $(smallServices)

Expand All @@ -36,6 +36,7 @@ platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
platformsHostedOnboardingPage: spec=HopService-v6
transfers: spec=TransferService-v3
balanceControlService: spec=BalanceControlService-v1
disputes: spec=DisputeService-v30

$(services): build/spec $(openapi-generator-jar)
rm -rf Adyen/services/$@ $(output)
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
This is the officially supported Python library for using Adyen's APIs.

## Supported API versions
| API | Description | Service Name | Supported version |
| --- | ----------- | ------------ | ----------------- |
|[BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | binLookup | **v52** |
| [Balance Platform API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Balance Platform 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 | **v2** |
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview)| Our latest integration for accepting online payments. | checkout | **v70** |
| [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Endpoint for requesting data erasure. | dataProtection | **v1** |
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Endpoint to manage legal entities | legalEntityManagement | **v3** |
| [Management API](https://docs.adyen.com/api-explorer/Management/1/overview)| Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management | **v1** |
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview)| Our classic integration for online payments. | payments | **v68** |
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview)| Endpoints for sending funds to your customers. | payouts | **v68** |
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview)| Endpoints for managing your point-of-sale payment terminals. | terminal | **v1** |
| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview)| Endpoints for managing saved payment details. | recurring | **v68** |
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Endpoints for managing gift cards. | storedValue | **v46** |
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | Endpoints for managing transfers, getting information about transactions or moving fund | transfers | **v3** |
| API | Description | Service Name | Supported version |
|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|-------------------|
| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | binLookup | **v52** |
| [Balance Platform API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Balance Platform 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 | **v2** |
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Our latest integration for accepting online payments. | checkout | **v70** |
| [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Endpoint for requesting data erasure. | dataProtection | **v1** |
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Endpoint to manage legal entities | legalEntityManagement | **v3** |
| [Management API](https://docs.adyen.com/api-explorer/Management/1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management | **v1** |
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | Our classic integration for online payments. | payments | **v68** |
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | Endpoints for sending funds to your customers. | payouts | **v68** |
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | Endpoints for managing your point-of-sale payment terminals. | terminal | **v1** |
| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | Endpoints for managing saved payment details. | recurring | **v68** |
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Endpoints for managing gift cards. | storedValue | **v46** |
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | Endpoints for managing transfers, getting information about transactions or moving fund | transfers | **v3** |
| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | disputes | **v30** |

For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).

Expand Down

0 comments on commit a66fb68

Please sign in to comment.