Skip to content

Commit

Permalink
Add banking webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jillingk committed Aug 2, 2023
1 parent d493fc3 commit e16f977
Show file tree
Hide file tree
Showing 102 changed files with 49,076 additions and 25 deletions.
6 changes: 5 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:=BalanceControl BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers BinLookup StoredValue POSTerminalManagement Recurring
modelGen:=BalanceControl BalancePlatform Checkout ConfigurationWebhooks StoredValue Payments Payout Management LegalEntityManagement TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks
models:=src/Adyen/Model
output:=target/out

Expand All @@ -24,6 +24,10 @@ Payout: spec=PayoutService-v68
Management: spec=ManagementService-v1
LegalEntityManagement: spec=LegalEntityService-v3
Transfers: spec=TransferService-v3
# BalanceWebhooks
ConfigurationWebhooks: spec=BalancePlatformConfigurationNotification-v1
ReportWebhooks: spec=BalancePlatformReportNotification-v1
TransferWebhooks: spec=BalancePlatformTransferNotification-v3

# Classic Platforms
marketpay/account: spec=AccountService-v6
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ The library supports all APIs under the following services:
| [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** |

## Supported Webhook versions
The library supports all webhooks under the following model directories:

| Webhooks | Description | Model Name | Supported Version |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|-------------------|
| [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. | [ConfigurationNotification](src/Adyen/Model/ConfigurationWebhooks) | **v1** |
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/3/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. | [TransferNotification](src/Adyen/Model/TransferWebhooks) | **v3** |
| [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 | [ReportNotification](src/Adyen/Model/ReportWebhooks) | **v1** |
| [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/).

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

Expand Down Expand Up @@ -146,6 +156,18 @@ $result = $service->paymentLinks($createPaymentLinkRequest);

$paymentLink = $result->getUrl(); // or use $result['url'] if you want to use arrayAccess
~~~~
### Using Banking Webhooks
~~~~ php
...

$jsonString = 'webhook_payload';
$isValid = $hmac->validateHMAC("YOUR_HMAC_KEY", "YOUR_HMAC_SIGN", $jsonString);

if ($isValid) {
$webhookParser = new BankingWebhookParser($jsonString);
$result = $webhookParser->getGenericWebhook();
}
~~~~

### Example integration

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
SCRIPT

Vagrant.configure("2") do |config|
config.vm.box = "mpasternak/focal64-arm"
config.vm.box = "jeffnoxon/ubuntu-20.04-arm64"
config.vm.network "private_network", ip: "192.168.58.30"
config.vm.provider :parallels do |v|
v.memory = "4096"
Expand Down
Loading

0 comments on commit e16f977

Please sign in to comment.