@@ -14,77 +14,77 @@ func TestPaymentErrorConstructors(t *testing.T) {
1414 tests := []struct {
1515 name string
1616 err * PaymentError
17- want string
17+ want ErrorType
1818 status int
1919 detail string
2020 }{
2121 {
2222 name : "payment required default detail" ,
2323 err : ErrPaymentRequired ("api.example.com" , "" ),
24- want : "https://mpp.dev/errors/payment-required" ,
24+ want : ErrorTypePaymentRequired ,
2525 status : http .StatusPaymentRequired ,
2626 detail : "Payment is required to access this resource" ,
2727 },
2828 {
2929 name : "payment required custom detail" ,
3030 err : ErrPaymentRequired ("api.example.com" , "custom detail" ),
31- want : "https://mpp.dev/errors/payment-required" ,
31+ want : ErrorTypePaymentRequired ,
3232 status : http .StatusPaymentRequired ,
3333 detail : "custom detail" ,
3434 },
3535 {
3636 name : "malformed credential" ,
3737 err : ErrMalformedCredential ("bad credential" ),
38- want : "https://mpp.dev/errors/malformed-credential" ,
38+ want : ErrorTypeMalformedCredential ,
3939 status : http .StatusBadRequest ,
4040 detail : "bad credential" ,
4141 },
4242 {
4343 name : "invalid challenge" ,
4444 err : ErrInvalidChallenge ("challenge-1" , "tampered" ),
45- want : "https://mpp.dev/errors/invalid-challenge" ,
45+ want : ErrorTypeInvalidChallenge ,
4646 status : http .StatusBadRequest ,
4747 detail : "challenge challenge-1: tampered" ,
4848 },
4949 {
5050 name : "verification failed" ,
5151 err : ErrVerificationFailed ("signature mismatch" ),
52- want : "https://mpp.dev/errors/verification-failed" ,
52+ want : ErrorTypeVerificationFailed ,
5353 status : http .StatusPaymentRequired ,
5454 detail : "signature mismatch" ,
5555 },
5656 {
5757 name : "payment expired" ,
5858 err : ErrPaymentExpired ("2026-01-01T00:00:00Z" ),
59- want : "https://mpp.dev/errors/payment-expired" ,
59+ want : ErrorTypePaymentExpired ,
6060 status : http .StatusPaymentRequired ,
6161 detail : "payment expired at 2026-01-01T00:00:00Z" ,
6262 },
6363 {
6464 name : "invalid payload" ,
6565 err : ErrInvalidPayload ("invalid payload" ),
66- want : "https://mpp.dev/errors/invalid-payload" ,
66+ want : ErrorTypeInvalidPayload ,
6767 status : http .StatusBadRequest ,
6868 detail : "invalid payload" ,
6969 },
7070 {
7171 name : "bad request" ,
7272 err : ErrBadRequest ("bad request" ),
73- want : "https://mpp.dev/errors/bad-request" ,
73+ want : ErrorTypeBadRequest ,
7474 status : http .StatusBadRequest ,
7575 detail : "bad request" ,
7676 },
7777 {
7878 name : "payment insufficient" ,
7979 err : ErrPaymentInsufficient ("not enough" ),
80- want : "https://mpp.dev/errors/payment-insufficient" ,
80+ want : ErrorTypePaymentInsufficient ,
8181 status : http .StatusPaymentRequired ,
8282 detail : "not enough" ,
8383 },
8484 {
8585 name : "method unsupported" ,
8686 err : ErrMethodUnsupported ("stripe" ),
87- want : "https://mpp.dev/errors/method-unsupported" ,
87+ want : ErrorTypeMethodUnsupported ,
8888 status : http .StatusBadRequest ,
8989 detail : `payment method "stripe" is not supported` ,
9090 },
0 commit comments