You are here

public static function Braintree_WebhookTesting::sampleNotification in Commerce Braintree 7

4 calls to Braintree_WebhookTesting::sampleNotification()
Braintree_WebhookNotificationTest::testParsingInvalidSignatureRaisesError in braintree_php/tests/unit/WebhookNotificationTest.php
Braintree_WebhookNotificationTest::testParsingModifiedSignatureRaisesError in braintree_php/tests/unit/WebhookNotificationTest.php
Braintree_WebhookNotificationTest::testParsingUnknownPublicKeyRaisesError in braintree_php/tests/unit/WebhookNotificationTest.php
Braintree_WebhookNotificationTest::testSampleNotificationReturnsAParsableNotification in braintree_php/tests/unit/WebhookNotificationTest.php

File

braintree_php/lib/Braintree/WebhookTesting.php, line 4

Class

Braintree_WebhookTesting

Code

public static function sampleNotification($kind, $id) {
  $payload = base64_encode(self::_sampleXml($kind, $id));
  $signature = Braintree_Configuration::publicKey() . "|" . Braintree_Digest::hexDigest($payload);
  return array(
    'signature' => $signature,
    'payload' => $payload,
  );
}