Skip to content

Commit

Permalink
Refactor payments and add transactionwebhooksV4 (#584)
Browse files Browse the repository at this point in the history
* refactor payments

* support for TransactionWebhooksv4

---------

Co-authored-by: system-mr <[email protected]>
  • Loading branch information
jillingk and system-mr authored Nov 6, 2023
1 parent 5940427 commit c39acd0
Show file tree
Hide file tree
Showing 19 changed files with 3,877 additions and 35 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi-generator-jar:=target/openapi-generator-cli.jar
openapi-generator-cli:=java -jar $(openapi-generator-jar)

generator:=php
modelGen:=AcsWebhooks BalanceControl BalancePlatform Checkout ConfigurationWebhooks Disputes Payments Payout Management ManagementWebhooks LegalEntityManagement TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks
modelGen:=AcsWebhooks BalanceControl BalancePlatform Checkout ConfigurationWebhooks Disputes Payments Payout Management ManagementWebhooks LegalEntityManagement TransactionWebhooks TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks
models:=src/Adyen/Model
output:=target/out

Expand All @@ -31,6 +31,7 @@ AcsWebhooks: spec=BalancePlatformAcsNotification-v1
ConfigurationWebhooks: spec=BalancePlatformConfigurationNotification-v1
ReportWebhooks: spec=BalancePlatformReportNotification-v1
TransferWebhooks: spec=BalancePlatformTransferNotification-v4
TransactionWebhooks: spec=BalancePlatformTransactionNotification-v4
# ManagementWebhooks
ManagementWebhooks: spec=ManagementNotificationService-v3

Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ The library supports all APIs under the following services:
| [Terminal API (Cloud communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/cloud) | Our point-of-sale integration. | [Cloud-based Terminal API](src/Adyen/Service/PosPayment.php) | Cloud-based Terminal API | |
| [Terminal API (Local communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/local) | Our point-of-sale integration. | [Local-based Terminal API](src/Adyen/Service/PosPayment.php) | Local-based Terminal API | |
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. | [POSTerminalManagement](src/Adyen/Service/POSTerminalManagementApi.php) | **v1** |
| [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](src/Adyen/Service/DisputesApi.php) | **v30** |
| [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](src/Adyen/Service/DisputesApi.php) | **v30** |
## Supported Webhook versions
The library supports all webhooks under the following model directories:

| Webhooks | Description | Model Name | Supported Version |
|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------|
| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [AcsWebhooks](src/Adyen/Model/AcsWebhooks) | **v1** |
| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationWebhooks](src/Adyen/Model/ConfigurationWebhooks) | **v1** |
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferWebhooks](src/Adyen/Model/TransferWebhooks) | **v4** |
| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportWebhooks](src/Adyen/Model/ReportWebhooks) | **v1** |
| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/Adyen/Model/ManagementWebhooks) | **v3** |
| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/Adyen/Service/Notification.php) | **v1** |
| Webhooks | Description | Model Name | Supported Version |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------|
| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [AcsWebhooks](src/Adyen/Model/AcsWebhooks) | **v1** |
| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationWebhooks](src/Adyen/Model/ConfigurationWebhooks) | **v1** |
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferWebhooks](src/Adyen/Model/TransferWebhooks) | **v4** |
| [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransactionWebhooks](src/Model/TransactionWebhooks) | **v4** |
| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportWebhooks](src/Adyen/Model/ReportWebhooks) | **v1** |
| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/Adyen/Model/ManagementWebhooks) | **v3** |
| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/Adyen/Service/Notification.php) | **v1** |

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

Expand Down
4 changes: 4 additions & 0 deletions src/Adyen/Model/Payments/Recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ public function getModelName()
public const CONTRACT_PAYOUT = 'PAYOUT';
public const TOKEN_SERVICE_VISATOKENSERVICE = 'VISATOKENSERVICE';
public const TOKEN_SERVICE_MCTOKENSERVICE = 'MCTOKENSERVICE';
public const TOKEN_SERVICE_AMEXTOKENSERVICE = 'AMEXTOKENSERVICE';
public const TOKEN_SERVICE_TOKEN_SHARING = 'TOKEN_SHARING';

/**
* Gets allowable values of the enum
Expand All @@ -268,6 +270,8 @@ public function getTokenServiceAllowableValues()
return [
self::TOKEN_SERVICE_VISATOKENSERVICE,
self::TOKEN_SERVICE_MCTOKENSERVICE,
self::TOKEN_SERVICE_AMEXTOKENSERVICE,
self::TOKEN_SERVICE_TOKEN_SHARING,
];
}
/**
Expand Down
15 changes: 6 additions & 9 deletions src/Adyen/Model/Payments/Split.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ public function listInvalidProperties()
{
$invalidProperties = [];

if ($this->container['amount'] === null) {
$invalidProperties[] = "'amount' can't be null";
}
if ($this->container['type'] === null) {
$invalidProperties[] = "'type' can't be null";
}
Expand Down Expand Up @@ -360,7 +357,7 @@ public function getAccount()
/**
* Sets account
*
* @param string|null $account Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**.
* @param string|null $account The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked.
*
* @return self
*/
Expand All @@ -377,7 +374,7 @@ public function setAccount($account)
/**
* Gets amount
*
* @return \Adyen\Model\Payments\SplitAmount
* @return \Adyen\Model\Payments\SplitAmount|null
*/
public function getAmount()
{
Expand All @@ -387,7 +384,7 @@ public function getAmount()
/**
* Sets amount
*
* @param \Adyen\Model\Payments\SplitAmount $amount amount
* @param \Adyen\Model\Payments\SplitAmount|null $amount amount
*
* @return self
*/
Expand All @@ -414,7 +411,7 @@ public function getDescription()
/**
* Sets description
*
* @param string|null $description A description of this split.
* @param string|null $description Your description for the split item.
*
* @return self
*/
Expand All @@ -441,7 +438,7 @@ public function getReference()
/**
* Sets reference
*
* @param string|null $reference Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms.
* @param string|null $reference Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports.
*
* @return self
*/
Expand All @@ -468,7 +465,7 @@ public function getType()
/**
* Sets type
*
* @param string $type The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.
* @param string $type The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**.
*
* @return self
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Adyen/Model/Payments/SplitAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function getCurrency()
/**
* Sets currency
*
* @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used.
* @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency.
*
* @return self
*/
Expand All @@ -326,7 +326,7 @@ public function getValue()
/**
* Sets value
*
* @param int $value The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes).
* @param int $value The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
*
* @return self
*/
Expand Down
Loading

0 comments on commit c39acd0

Please sign in to comment.