Supported payment URL in Portal

refs https://github.com/TryGhost/Team/issues/2078

As part of decoupling Stripe from the members feature, we are going to be using
payment URLs rather than Stripe sepcific session ids and publick keys.

This prepares Portal to work with the new system, whilst retainign the existing
functionality
This commit is contained in:
Fabien "egg" O'Carroll 2022-10-19 11:06:10 +07:00
parent fbc23a624e
commit 4f54cbc37a

View File

@ -392,6 +392,9 @@ function setupGhostApi({siteUrl = window.location.origin, apiUrl, apiKey}) {
}
return res.json();
}).then(function (result) {
if (result.url) {
return window.location.assign(result.url);
}
const stripe = window.Stripe(result.publicKey);
return stripe.redirectToCheckout({
sessionId: result.sessionId