如何在成功时重定向我的paypal支付?

pw136qt2  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(181)

我正在尝试用npm模块编写一些代码https://www.npmjs.com/package/@paypal/react paypal js
但它要么没有读取代码,要么代码没有重定向回。我正在使用next/router进行重定向。请帮忙。

const onApprove = (data, actions) => {
        return actions.order.capture().then(function (details) {
            const { payer } = details;
      const router = useRouter();
            setBillingDetails(payer);
            setSucceeded(true);
            router.push("https://duke-bot.com")
        });
    };

编辑:付款重定向回我以前所在的页面,即结账页面,但它不读取其他页面的重定向

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题