Inheritance: extends braintree\Base
 public function testBuildsASampleNotificationForAPartnerMerchantDeclinedWebhook()
 {
     $sampleNotification = Braintree\WebhookTesting::sampleNotification(Braintree\WebhookNotification::PARTNER_MERCHANT_DECLINED, "my_id");
     $webhookNotification = Braintree\WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']);
     $this->assertEquals(Braintree\WebhookNotification::PARTNER_MERCHANT_DECLINED, $webhookNotification->kind);
     $this->assertEquals("abc123", $webhookNotification->partnerMerchant->partnerMerchantId);
 }
 /**
  * Parse the given Braintree webhook notification request.
  *
  * @return WebhookNotification
  */
 protected function parseBraintreeNotification()
 {
     return WebhookNotification::parse(Yii::$app->request->post('bt_signature'), Yii::$app->request->post('bt_payload'));
 }
 public function testAccountUpdaterDailyReportWebhook()
 {
     $sampleNotification = Braintree\WebhookTesting::sampleNotification(Braintree\WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT, "my_id");
     $webhookNotification = Braintree\WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']);
     $this->assertEquals(Braintree\WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT, $webhookNotification->kind);
     $this->assertEquals("link-to-csv-report", $webhookNotification->accountUpdaterDailyReport->reportUrl);
     $this->assertEquals(new DateTime("2016-01-14"), $webhookNotification->accountUpdaterDailyReport->reportDate);
 }
示例#4
0
 public function parseWebhookNotification($signature, $payload)
 {
     return WebhookNotification::parse($signature, $payload);
 }
 /**
  * Parse the given Braintree webhook notification request.
  *
  * @param  Request  $request
  * @return WebhookNotification
  */
 protected function parseBraintreeNotification($request)
 {
     return WebhookNotification::parse($request->bt_signature, $request->bt_payload);
 }
 public function testBuildsASampleNotificationForACheckWebhook()
 {
     $sampleNotification = Braintree\WebhookTesting::sampleNotification(Braintree\WebhookNotification::CHECK, "");
     $webhookNotification = Braintree\WebhookNotification::parse($sampleNotification["bt_signature"], $sampleNotification["bt_payload"]);
     $this->assertEquals(Braintree\WebhookNotification::CHECK, $webhookNotification->kind);
 }