Skip to content

Commit

Permalink
Merge pull request #1266 from anyproto/go-3511-pretty-error-codes-for…
Browse files Browse the repository at this point in the history
…-verifyreceipt

GO-3511 Add error codes on VerifyReceipt
  • Loading branch information
KirillSto authored May 28, 2024
2 parents d44af3e + 6c2e0d2 commit e518210
Show file tree
Hide file tree
Showing 6 changed files with 1,127 additions and 1,109 deletions.
4 changes: 3 additions & 1 deletion core/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ func (mw *Middleware) MembershipVerifyAppStoreReceipt(ctx context.Context, req *
errToCode(payments.ErrNoConnection, pb.RpcMembershipVerifyAppStoreReceiptResponseError_PAYMENT_NODE_ERROR),
errToCode(net.ErrUnableToConnect, pb.RpcMembershipVerifyAppStoreReceiptResponseError_PAYMENT_NODE_ERROR),
errToCode(payments.ErrCacheProblem, pb.RpcMembershipVerifyAppStoreReceiptResponseError_CACHE_ERROR),
errToCode(proto.ErrInvalidReceipt, pb.RpcMembershipVerifyAppStoreReceiptResponseError_INVALID_RECEIPT),
errToCode(proto.ErrAppleInvalidReceipt, pb.RpcMembershipVerifyAppStoreReceiptResponseError_INVALID_RECEIPT),
errToCode(proto.ErrApplePurchaseRegistration, pb.RpcMembershipVerifyAppStoreReceiptResponseError_PURCHASE_REGISTRATION_ERROR),
errToCode(proto.ErrAppleSubscriptionRenew, pb.RpcMembershipVerifyAppStoreReceiptResponseError_SUBSCRIPTION_RENEW_ERROR),
errToCode(proto.ErrUnknown, pb.RpcMembershipVerifyAppStoreReceiptResponseError_UNKNOWN_ERROR),
)

Expand Down
2 changes: 2 additions & 0 deletions docs/proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -20435,6 +20435,8 @@ Middleware-to-front-end response, that can contain a NULL error or a non-NULL er
| PAYMENT_NODE_ERROR | 4 | |
| CACHE_ERROR | 5 | |
| INVALID_RECEIPT | 6 | |
| PURCHASE_REGISTRATION_ERROR | 7 | |
| SUBSCRIPTION_RENEW_ERROR | 8 | |



Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/PuerkitoBio/goquery v1.9.2
github.com/VividCortex/ewma v1.2.0
github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786
github.com/anyproto/any-sync v0.4.19
github.com/anyproto/any-sync v0.4.20
github.com/anyproto/go-naturaldate/v2 v2.0.2-0.20230524105841-9829cfd13438
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/avast/retry-go/v4 v4.6.0
Expand Down Expand Up @@ -294,4 +294,3 @@ replace github.com/araddon/dateparse => github.com/mehanizm/dateparse v0.0.0-202
replace github.com/multiformats/go-multiaddr => github.com/anyproto/go-multiaddr v0.8.1-0.20221213144344-0b6b93adaec4

replace github.com/gogo/protobuf => github.com/anyproto/protobuf v1.3.3-0.20240201225420-6e325cf0ac38

4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsVi
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anyproto/any-sync v0.4.19 h1:MT7Bi4CPKfV+KL+JZwajle0DvZuxaReeg2kjtSLa3DE=
github.com/anyproto/any-sync v0.4.19/go.mod h1:Shjw2qXQKjsUfu5wVJjLpInSbMfecK8GGe+TOd16jrw=
github.com/anyproto/any-sync v0.4.20-0.20240523092748-45dd2364ccf7 h1:tdPQC075gUkgZnesbxrZXSBdasvvwHTm0ARe7kvekQk=
github.com/anyproto/any-sync v0.4.20-0.20240523092748-45dd2364ccf7/go.mod h1:Shjw2qXQKjsUfu5wVJjLpInSbMfecK8GGe+TOd16jrw=
github.com/anyproto/any-sync v0.4.20 h1:fCFJxJaNHM5gkEmzHtdbUqNvwCRpsr/GheiyEO7E4lI=
github.com/anyproto/any-sync v0.4.20/go.mod h1:sO/zUrmnCZKnH/3KaRH3JQSZMuINS3X7ZJa+d4YgfkA=
github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580 h1:Ba80IlCCxkZ9H1GF+7vFu/TSpPvbpDCxXJ5ogc4euYc=
github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580/go.mod h1:T/uWAYxrXdaXw64ihI++9RMbKTCpKd/yE9+saARew7k=
github.com/anyproto/go-chash v0.1.0 h1:I9meTPjXFRfXZHRJzjOHC/XF7Q5vzysKkiT/grsogXY=
Expand Down
Loading

0 comments on commit e518210

Please sign in to comment.