func (b *backend) ProcessVerifyUserPayment(user *database.User, vupt v1.VerifyUserPayment) (*v1.VerifyUserPaymentReply, error) {
	var reply v1.VerifyUserPaymentReply
	if b.HasUserPaid(user) {
		reply.HasPaid = true
		return &reply, nil
	}

	if paywallHasExpired(user.NewUserPaywallPollExpiry) {
		b.GenerateNewUserPaywall(user)

		reply.PaywallAddress = user.NewUserPaywallAddress
		reply.PaywallAmount = user.NewUserPaywallAmount
		reply.PaywallTxNotBefore = user.NewUserPaywallTxNotBefore
		return &reply, nil
	}

	tx, err := util.FetchTxWithBlockExplorers(user.NewUserPaywallAddress,
		user.NewUserPaywallAmount, user.NewUserPaywallTxNotBefore,
		b.cfg.MinConfirmationsRequired)
	if err != nil {
		if err == util.ErrCannotVerifyPayment {
			return nil, v1.UserError{
				ErrorCode: v1.ErrorStatusCannotVerifyPayment,
			}
		}
		return nil, err
	}

	if tx != "" {
		reply.HasPaid = true

		err = b.updateUserAsPaid(user, tx)
		if err != nil {
			return nil, err
		}
	} else {
		// Add the user to the in-memory pool.
	}

	return &reply, nil
}
// ProcessVerifyUserPayment verifies that the provided transaction
// meets the minimum requirements to mark the user as paid, and then does
// that in the user database.
ProcessVerifyUserPayment verifies that the provided transaction
meets the minimum requirements to mark the user as paid, and then does
that in the user database.
// ProcessVerifyUserPayment verifies that the provided transaction // meets the minimum requirements to mark the user as paid and then does // that in the user database .
func (b *backend) ProcessVerifyUserPayment(user *database.User, vupt v1.VerifyUserPayment) (*v1.VerifyUserPaymentReply, error) {
	var reply v1.VerifyUserPaymentReply
	if b.HasUserPaid(user) {
		reply.HasPaid = true
		return &reply, nil
	}
	if paywallHasExpired(user.NewUserPaywallPollExpiry) {
		b.GenerateNewUserPaywall(user)
		reply.PaywallAddress = user.NewUserPaywallAddress
		reply.PaywallAmount = user.NewUserPaywallAmount
		reply.PaywallTxNotBefore = user.NewUserPaywallTxNotBefore
		return &reply, nil
	}
	tx, err := util.FetchTxWithBlockExplorers(user.NewUserPaywallAddress,
		user.NewUserPaywallAmount, user.NewUserPaywallTxNotBefore,
		b.cfg.MinConfirmationsRequired)
	if err != nil {
		if err == util.ErrCannotVerifyPayment {
			return nil, v1.UserError{
				ErrorCode: v1.ErrorStatusCannotVerifyPayment,
			}
		}
		return nil, err
	}
	if tx != "" {
		reply.HasPaid = true
		err = b.updateUserAsPaid(user, tx)
		if err != nil {
			return nil, err
		}
	} else {
	}
	return &reply, nil
}
func ( b * backend ) ProcessVerifyUserPayment ( user * database . User , vupt v1 . VerifyUserPayment ) ( * v1 . VerifyUserPaymentReply , error ) { var reply v1 . VerifyUserPaymentReply if b . HasUserPaid ( user ) { reply . HasPaid = true return & reply , nil } if paywallHasExpired ( user . NewUserPaywallPollExpiry ) { b . GenerateNewUserPaywall ( user ) reply . PaywallAddress = user . NewUserPaywallAddress reply . PaywallAmount = user . NewUserPaywallAmount reply . PaywallTxNotBefore = user . NewUserPaywallTxNotBefore return & reply , nil } tx , err := util . FetchTxWithBlockExplorers ( user . NewUserPaywallAddress , user . NewUserPaywallAmount , user . NewUserPaywallTxNotBefore , b . cfg . MinConfirmationsRequired ) if err != nil { if err == util . ErrCannotVerifyPayment { return nil , v1 . UserError { ErrorCode : v1 . ErrorStatusCannotVerifyPayment , } } return nil , err } if tx != " " { reply . HasPaid = true err = b . updateUserAsPaid ( user , tx ) if err != nil { return nil , err } } else { } return & reply , nil }
ProcessVerifyUserPayment verifies that the provided transaction
meets the minimum requirements to mark the user as paid, and then does
that in the user database.
ProcessVerifyUserPayment verifies that the provided transaction meets the minimum requirements to mark the user as paid and then does that in the user database .
// Add the user to the in-memory pool.