UNPKG

@adyen/api-library

Version:

The Adyen API Library for NodeJS enables you to work with Adyen APIs.

65 lines (64 loc) 2.99 kB
import { configurationWebhooks } from ".."; /** * Union type for all supported webhook requests. * Allows generic handling of configuration-related webhook events. */ export type GenericWebhook = configurationWebhooks.AccountHolderNotificationRequest | configurationWebhooks.BalanceAccountNotificationRequest | configurationWebhooks.CardOrderNotificationRequest | configurationWebhooks.NetworkTokenNotificationRequest | configurationWebhooks.PaymentNotificationRequest | configurationWebhooks.ScoreNotificationRequest | configurationWebhooks.SweepConfigurationNotificationRequest; /** * Handler for processing ConfigurationWebhooks. * * This class provides functionality to deserialize the payload of ConfigurationWebhooks events. */ export declare class ConfigurationWebhooksHandler { private readonly payload; constructor(jsonPayload: string); /** * This method checks the type of the webhook payload and returns the appropriate deserialized object. * * @returns A deserialized object of type GenericWebhook. * @throws Error if the type is not recognized. */ getGenericWebhook(): GenericWebhook; /** * Deserialize the webhook payload into a AccountHolderNotificationRequest * * @returns Deserialized AccountHolderNotificationRequest object. */ getAccountHolderNotificationRequest(): configurationWebhooks.AccountHolderNotificationRequest; /** * Deserialize the webhook payload into a BalanceAccountNotificationRequest * * @returns Deserialized BalanceAccountNotificationRequest object. */ getBalanceAccountNotificationRequest(): configurationWebhooks.BalanceAccountNotificationRequest; /** * Deserialize the webhook payload into a CardOrderNotificationRequest * * @returns Deserialized CardOrderNotificationRequest object. */ getCardOrderNotificationRequest(): configurationWebhooks.CardOrderNotificationRequest; /** * Deserialize the webhook payload into a NetworkTokenNotificationRequest * * @returns Deserialized NetworkTokenNotificationRequest object. */ getNetworkTokenNotificationRequest(): configurationWebhooks.NetworkTokenNotificationRequest; /** * Deserialize the webhook payload into a PaymentNotificationRequest * * @returns Deserialized PaymentNotificationRequest object. */ getPaymentNotificationRequest(): configurationWebhooks.PaymentNotificationRequest; /** * Deserialize the webhook payload into a ScoreNotificationRequest * * @returns Deserialized ScoreNotificationRequest object. */ getScoreNotificationRequest(): configurationWebhooks.ScoreNotificationRequest; /** * Deserialize the webhook payload into a SweepConfigurationNotificationRequest * * @returns Deserialized SweepConfigurationNotificationRequest object. */ getSweepConfigurationNotificationRequest(): configurationWebhooks.SweepConfigurationNotificationRequest; }