Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 3877 #292

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions paymentservice/paymentserviceclient/paymentserviceclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type AnyPpClientService interface {
FinalizeSubscription(ctx context.Context, in *pp.FinalizeSubscriptionRequestSigned) (out *pp.FinalizeSubscriptionResponse, err error)
GetAllTiers(ctx context.Context, in *pp.GetTiersRequestSigned) (out *pp.GetTiersResponse, err error)
VerifyAppStoreReceipt(ctx context.Context, in *pp.VerifyAppStoreReceiptRequestSigned) (out *pp.VerifyAppStoreReceiptResponse, err error)
GetRefCodeMy(ctx context.Context, in *pp.GetRefCodeMyRequestSigned) (out *pp.GetRefCodeMyResponse, err error)
SetRefCodeOfMyInviter(ctx context.Context, in *pp.SetRefCodeOfMyInviterRequestSigned) (out *pp.SetRefCodeOfMyInviterResponse, err error)

app.Component
}
Expand Down Expand Up @@ -165,3 +167,23 @@ func (s *service) VerifyAppStoreReceipt(ctx context.Context, in *pp.VerifyAppSto
})
return
}

func (s *service) GetRefCodeMy(ctx context.Context, in *pp.GetRefCodeMyRequestSigned) (out *pp.GetRefCodeMyResponse, err error) {
err = s.doClient(ctx, func(cl pp.DRPCAnyPaymentProcessingClient) error {
if out, err = cl.GetRefCodeMy(ctx, in); err != nil {
return rpcerr.Unwrap(err)
}
return nil
})
return
}

func (s *service) SetRefCodeOfMyInviter(ctx context.Context, in *pp.SetRefCodeOfMyInviterRequestSigned) (out *pp.SetRefCodeOfMyInviterResponse, err error) {
err = s.doClient(ctx, func(cl pp.DRPCAnyPaymentProcessingClient) error {
if out, err = cl.SetRefCodeOfMyInviter(ctx, in); err != nil {
return rpcerr.Unwrap(err)
}
return nil
})
return
}
2 changes: 2 additions & 0 deletions paymentservice/paymentserviceproto/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ var (
ErrAppleInvalidReceipt = errGroup.Register(errors.New("invalid AppStore receipt"), uint64(ErrorCodes_AppleInvalidReceipt))
ErrApplePurchaseRegistration = errGroup.Register(errors.New("error on purchase registration"), uint64(ErrorCodes_ApplePurchaseRegistration))
ErrAppleSubscriptionRenew = errGroup.Register(errors.New("error on subscription renew"), uint64(ErrorCodes_AppleSubscriptionRenew))
ErrRefCodeAlreadySet = errGroup.Register(errors.New("ref code was already set by you"), uint64(ErrorCodes_RefCodeAlreadySet))
ErrRefCodeInvalid = errGroup.Register(errors.New("ref code is invalid"), uint64(ErrorCodes_RefCodeInvalid))
)
Loading
Loading