簡體   English   中英

stripe.redirectToCheckout 的“結果 object”是什么?

[英]What is the " result object " from stripe.redirectToCheckout?

    var stripe = Stripe('pk_test_51JaZneFymkOlJfbtifS7RjJeFPZTchtlvU5iiVmemkU76vOFWWPZOW9GwBDb9518RCoOfkvUQkGV92TyEMaXqYgh00eb6kLKZj');
     var session = "<?php echo $checkout_session['id']; ?>";
          stripe.redirectToCheckout({ sessionId: session })
                  .then(function(result) {
          // If `redirectToCheckout` fails due to a browser or network
          // error, you should display the localized error message to your
          // customer using `error.message`.
          if (result.error) {
            alert(result.error.message);
          }
        })
        .catch(function(error) {
          console.error('Error:', error);
        });          

出於某種原因,我無法訪問 >>.then(function(result) << 中的“result”值 << 誰能告訴我“result”可用的值有哪些?

雖然這在大多數情況下不太可能發生,但您會返回包含error所述messageresult

您可以使用例如 Chrome 的網絡節流來模擬網絡故障來對此進行測試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM