adjust stripe checkout experience
This commit is contained in:
parent
ce4911049e
commit
f762c04140
2 changed files with 32 additions and 5 deletions
|
|
@ -80,7 +80,7 @@ const VideoList: NextPage = () => {
|
||||||
}, [closeQueryParam]);
|
}, [closeQueryParam]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (checkoutCanceledQueryParam === "false" && closeQueryParam === "false") {
|
if (checkoutCanceledQueryParam && closeQueryParam === "false") {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
void router.push("/videos").then(() => router.reload());
|
void router.push("/videos").then(() => router.reload());
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
@ -152,9 +152,34 @@ const VideoList: NextPage = () => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
<div className="flex flex-col">
|
||||||
|
{checkoutCanceledQueryParam === "true" ? (
|
||||||
|
<>
|
||||||
<span className="text-lg font-semibold text-zinc-700">
|
<span className="text-lg font-semibold text-zinc-700">
|
||||||
|
Purchase cancelled
|
||||||
|
</span>
|
||||||
|
{closeQueryParam === "true" ? (
|
||||||
|
<span className="mt-1 text-base text-zinc-500">
|
||||||
You can now close this window
|
You can now close this window
|
||||||
</span>
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="mt-1 text-base text-zinc-500">
|
||||||
|
You will be redirected shortly
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<span className="text-lg font-semibold text-zinc-700">
|
||||||
|
Successfully logged in
|
||||||
|
</span>
|
||||||
|
<span className="mt-1 text-base text-zinc-500">
|
||||||
|
You can now close this window and try to upload the
|
||||||
|
video again!
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ export const stripeRouter = createTRPCRouter({
|
||||||
success_url: input.recordModalOpen
|
success_url: input.recordModalOpen
|
||||||
? `${baseUrl}/videos?checkoutCanceled=false&close=true`
|
? `${baseUrl}/videos?checkoutCanceled=false&close=true`
|
||||||
: `${baseUrl}/videos?checkoutCanceled=false&close=false`,
|
: `${baseUrl}/videos?checkoutCanceled=false&close=false`,
|
||||||
cancel_url: `${baseUrl}/videos?checkoutCanceled=true`,
|
cancel_url: input.recordModalOpen
|
||||||
|
? `${baseUrl}/videos?checkoutCanceled=true&close=true`
|
||||||
|
: `${baseUrl}/videos?checkoutCanceled=true&close=false`,
|
||||||
subscription_data: {
|
subscription_data: {
|
||||||
trial_settings: {
|
trial_settings: {
|
||||||
end_behavior: {
|
end_behavior: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue