@@ -23,11 +23,8 @@ import (
2323
2424// https://stripe.com/docs/api/events/types
2525const (
26- invoiceUpdatedEventType = "invoice.updated"
27- invoiceFinalizedEventType = "invoice.finalized"
28- customerCreatedEventType = "customer.created"
29- customerSubscriptionDeleted = "customer.subscription.deleted"
30- chargeDisputeCreated = "charge.dispute.created"
26+ invoiceUpdatedEventType = "invoice.updated"
27+ customerCreatedEventType = "customer.created"
3128)
3229
3330const (
@@ -55,7 +52,7 @@ func TestWebhookAcceptsPostRequests(t *testing.T) {
5552
5653 srv := baseServerWithStripeWebhook (t , & billingservice.NoOpClient {})
5754
58- payload := payloadForStripeEvent (t , invoiceFinalizedEventType )
55+ payload := payloadForStripeEvent (t , InvoiceFinalizedEventType )
5956
6057 url := fmt .Sprintf ("%s%s" , srv .HTTPAddress (), "/webhook" )
6158
@@ -80,11 +77,11 @@ func TestWebhookIgnoresIrrelevantEvents_NoopClient(t *testing.T) {
8077 ExpectedStatusCode int
8178 }{
8279 {
83- EventType : invoiceFinalizedEventType ,
80+ EventType : InvoiceFinalizedEventType ,
8481 ExpectedStatusCode : http .StatusOK ,
8582 },
8683 {
87- EventType : customerSubscriptionDeleted ,
84+ EventType : CustomerSubscriptionDeletedEventType ,
8885 ExpectedStatusCode : http .StatusOK ,
8986 },
9087 {
@@ -96,7 +93,7 @@ func TestWebhookIgnoresIrrelevantEvents_NoopClient(t *testing.T) {
9693 ExpectedStatusCode : http .StatusBadRequest ,
9794 },
9895 {
99- EventType : chargeDisputeCreated ,
96+ EventType : ChargeDisputeCreatedEventType ,
10097 ExpectedStatusCode : http .StatusOK ,
10198 },
10299 }
@@ -134,7 +131,7 @@ func TestWebhookInvokesFinalizeInvoiceRPC(t *testing.T) {
134131
135132 url := fmt .Sprintf ("%s%s" , srv .HTTPAddress (), "/webhook" )
136133
137- payload := payloadForStripeEvent (t , invoiceFinalizedEventType )
134+ payload := payloadForStripeEvent (t , InvoiceFinalizedEventType )
138135 req , err := http .NewRequest (http .MethodPost , url , bytes .NewReader (payload ))
139136 require .NoError (t , err )
140137
@@ -154,7 +151,7 @@ func TestWebhookInvokesCancelSubscriptionRPC(t *testing.T) {
154151
155152 url := fmt .Sprintf ("%s%s" , srv .HTTPAddress (), "/webhook" )
156153
157- payload := payloadForStripeEvent (t , customerSubscriptionDeleted )
154+ payload := payloadForStripeEvent (t , CustomerSubscriptionDeletedEventType )
158155 req , err := http .NewRequest (http .MethodPost , url , bytes .NewReader (payload ))
159156 require .NoError (t , err )
160157
0 commit comments