From 8cc80d7e59f4718fffed7cb0c8ebeb2a8d68928f Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 24 Feb 2018 09:40:42 +0100 Subject: [PATCH] Fixed payments for PRO accounts --- pages/paypal/success.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/paypal/success.go b/pages/paypal/success.go index 6bd509e3..ef7e6e6c 100644 --- a/pages/paypal/success.go +++ b/pages/paypal/success.go @@ -35,7 +35,14 @@ func Success(ctx *aero.Context) string { return ctx.Error(http.StatusInternalServerError, "Could not initiate PayPal client", err) } - c.SetAccessToken(token) + // Get access token + _, err = c.GetAccessToken() + + if err != nil { + return ctx.Error(http.StatusInternalServerError, "Could not get PayPal access token", err) + } + + // Execute payment execute, err := c.ExecuteApprovedPayment(paymentID, payerID) if err != nil {