Skip to content
Snippets Groups Projects
Commit a9ff16df authored by Alexander Kovalev's avatar Alexander Kovalev
Browse files

Merge branch 'MRM-6344-0.17.1' into 'release/v0.17.1'

MRM-6344 Content insurance - User buy a product - no email with documents after purchase

See merge request mashroom/backend/cardpayment!57
parents 49503907 f741ccd1
Branches
Tags b0.17.1 b0.17.1#hf0
No related merge requests found
...@@ -863,6 +863,8 @@ func (srv *serviceImpl) handleWebhookCheckoutSessionCompletedSubscription( ...@@ -863,6 +863,8 @@ func (srv *serviceImpl) handleWebhookCheckoutSessionCompletedSubscription(
if err != nil { if err != nil {
return err return err
} }
go srv.notifyUpdate(context.Background(), m)
} }
return nil return nil
......
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"math" "math"
"net/url" "net/url"
"strings"
"github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes"
"github.com/stripe/stripe-go/v72" "github.com/stripe/stripe-go/v72"
...@@ -766,6 +767,9 @@ func (srv *serviceImpl) CreateSubscription( ...@@ -766,6 +767,9 @@ func (srv *serviceImpl) CreateSubscription(
cancel.RawQuery = q.Encode() cancel.RawQuery = q.Encode()
} }
successURL := strings.ReplaceAll(success.String(), "%7BCHECKOUT_SESSION_ID%7D", "{CHECKOUT_SESSION_ID}")
cancelURL := strings.ReplaceAll(cancel.String(), "%7BCHECKOUT_SESSION_ID%7D", "{CHECKOUT_SESSION_ID}")
s, err := session.New(&stripe.CheckoutSessionParams{ s, err := session.New(&stripe.CheckoutSessionParams{
PaymentMethodTypes: stripe.StringSlice([]string{ PaymentMethodTypes: stripe.StringSlice([]string{
"card", "card",
...@@ -773,8 +777,8 @@ func (srv *serviceImpl) CreateSubscription( ...@@ -773,8 +777,8 @@ func (srv *serviceImpl) CreateSubscription(
LineItems: items, LineItems: items,
Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)), Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)),
Customer: stripe.String(customerID), Customer: stripe.String(customerID),
SuccessURL: stripe.String(success.String()), SuccessURL: stripe.String(successURL),
CancelURL: stripe.String(cancel.String()), CancelURL: stripe.String(cancelURL),
}) })
if err != nil { if err != nil {
return nil, err return nil, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment