public static List < Event > parse ( String requestBody , String signatureHeader , String webhookEndpointSecret ) { if ( isValidSignature ( requestBody , signatureHeader , webhookEndpointSecret ) ) { return WebhookParser . parse ( requestBody ) ; } else { throw new InvalidSignatureException ( ) ; } }
Validates that a webhook was genuinely sent by GoCardless using isValidSignature and then parses it into an array of com . gocardless . resources . Event objects representing each event included in the webhook .