mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-06 23:58:35 +00:00
Add the order.refunded event type
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -13,6 +13,12 @@ final class EventType
|
|||||||
public const ORDER_PAYMENT_FAILED = 'order.payment_failed';
|
public const ORDER_PAYMENT_FAILED = 'order.payment_failed';
|
||||||
public const ORDER_CANCELLED = 'order.cancelled';
|
public const ORDER_CANCELLED = 'order.cancelled';
|
||||||
public const ORDER_SHIPPED = 'order.shipped';
|
public const ORDER_SHIPPED = 'order.shipped';
|
||||||
|
/**
|
||||||
|
* Money was given back for an order (a refund or a partial cancellation, with a credit note);
|
||||||
|
* see the order's `refunds` and `refunded_total`. A full refund also cancels the order
|
||||||
|
* (order.cancelled follows).
|
||||||
|
*/
|
||||||
|
public const ORDER_REFUNDED = 'order.refunded';
|
||||||
|
|
||||||
public const SUBSCRIPTION_CREATED = 'subscription.created';
|
public const SUBSCRIPTION_CREATED = 'subscription.created';
|
||||||
public const SUBSCRIPTION_ACTIVATED = 'subscription.activated';
|
public const SUBSCRIPTION_ACTIVATED = 'subscription.activated';
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ class WebhookTest extends TestCase
|
|||||||
$this->assertContains(EventType::SUBSCRIPTION_RENEWED, EventType::all());
|
$this->assertContains(EventType::SUBSCRIPTION_RENEWED, EventType::all());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_refunds_have_their_own_event_type(): void
|
||||||
|
{
|
||||||
|
$this->assertSame('order.refunded', EventType::ORDER_REFUNDED);
|
||||||
|
$this->assertContains(EventType::ORDER_REFUNDED, EventType::all());
|
||||||
|
}
|
||||||
|
|
||||||
public function test_a_change_carries_the_previous_attributes(): void
|
public function test_a_change_carries_the_previous_attributes(): void
|
||||||
{
|
{
|
||||||
$this->payload = json_encode(['id' => '01JEVT', 'type' => EventType::SUBSCRIPTION_UPDATED, 'created' => time(), 'data' => [
|
$this->payload = json_encode(['id' => '01JEVT', 'type' => EventType::SUBSCRIPTION_UPDATED, 'created' => time(), 'data' => [
|
||||||
|
|||||||
Reference in new issue
Block a user