Fixed payments for PRO accounts

This commit is contained in:
Eduard Urbach 2018-02-24 09:40:42 +01:00
parent 0911881a87
commit 8cc80d7e59

View File

@ -35,7 +35,14 @@ func Success(ctx *aero.Context) string {
return ctx.Error(http.StatusInternalServerError, "Could not initiate PayPal client", err) 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) execute, err := c.ExecuteApprovedPayment(paymentID, payerID)
if err != nil { if err != nil {