Skip to content

Commit 9bd90e3

Browse files
committed
[CC-2868] [CC-2868] Add chargeback webhook handling.
1 parent f3799ac commit 9bd90e3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/integration/WebhookTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function testFetchResourceFromEvent(): void
231231
$webhookNotification = [
232232
'event' => 'chargebacks',
233233
'publicKey' => 's-pub-xyz',
234-
'retrieveUrl' => 'https=>//sbx-api.unzer.com/v1/payments/' . self::CHARGEDBACK_PAYMENT_ID . '/charges/s-chg-1/chargebacks/s-cbk-1',
234+
'retrieveUrl' => 'https://sbx-api.unzer.com/v1/payments/' . self::CHARGEDBACK_PAYMENT_ID . '/charges/s-chg-1/chargebacks/s-cbk-1',
235235
'paymentId' => self::CHARGEDBACK_PAYMENT_ID
236236
];
237237

test/unit/Services/WebhooksServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function fetchResourceByEventWithEmptyRetrieveUrlShouldThrowException():
331331
}
332332

333333
/**
334-
* Verify exception is thrown if the retrieveURL is empty.
334+
* Verify that a chargeback is returned from a webhook event.
335335
*
336336
* @test
337337
*/
@@ -341,9 +341,9 @@ public function fetchChargebackByEventShouldReturnChargeback(): void
341341
$unzer = new Unzer('s-priv-1234');
342342
$webhookService = new WebhookService($unzer);
343343

344-
$paymentId = 'p-pay-42';
345-
$chargeId = 'p-chg-1';
346-
$chargebackId = 'p-cbk-1';
344+
$paymentId = 's-pay-42';
345+
$chargeId = 's-chg-1';
346+
$chargebackId = 's-cbk-1';
347347
$retrieveUrl = "https://api.unzer.com/v1/payments/{$paymentId}/charges/{$chargeId}/chargebacks/{$chargebackId}";
348348

349349
// Partial mock: keep original behavior except fetchChargebackById which we want to intercept

0 commit comments

Comments
 (0)