Commit 5b0b3129 authored by Mo Firouz's avatar Mo Firouz
Browse files

Add pipeline hooks for purchase validation

parent be0873d2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -188,6 +188,9 @@ func (p *pipeline) processRequest(logger *zap.Logger, session *session, original
	case *Envelope_Rpc:
		p.rpc(logger, session, envelope)

	case *Envelope_Purchase:
		p.purchaseValidate(logger, session, envelope)

	case *Envelope_NotificationsList:
		p.notificationsList(logger, session, envelope)
	case *Envelope_NotificationsRemove:
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ func (p *pipeline) convertApplePurchase(purchase *TPurchaseValidation_ApplePurch

func (p *pipeline) convertGooglePurchase(purchase *TPurchaseValidation_GooglePurchase) (*iap.GooglePurchase, error) {
	if p.purchaseService.AppleClient == nil {
		return nil, errors.New("Apple in-app purchase environment is not setup.")
		return nil, errors.New("Google in-app purchase environment is not setup.")
	}

	if !(purchase.ProductType == "product" || purchase.ProductType == "subscription") {