代码之家  ›  专栏  ›  技术社区  ›  Muhammad Shahzad

在重定向url中分条3dSecure createSource set custom参数

  •  0
  • Muhammad Shahzad  · 技术社区  · 6 年前

    我无法在3dSecure create source函数中设置自定义参数,有人知道吗?我尝试了一些方法,但它覆盖了我的URL参数。

    当我添加重定向url时: return_url: "www.example.com?orderid=10", 在3dSecure授权后,它会将我重定向到 www.example.com?client_secret=xyz&livemode=false&source=sdf

    我拿不到我的 orderid

    严重的很差的3dSecure的条带实现。他们在文档中提到,您可以设置自定义GET params,但没有给出示例。 You may include any other GET parameters you may need when specifying redirect

       stripe.createSource({
             type: 'three_d_secure',
             amount: totalAmount,
             currency: "eur",
             three_d_secure: {
                 card: result.source.id
             },
             redirect: {
    
                 return_url: "www.example.com?orderid=10",
             }
         }).then(function(result2) {
    
          });
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   korben    6 年前

    我从以前写过的东西中挑出了一个有效的例子。你可以在这里找到它:

    https://jsfiddle.net/78y1brho/

    populateCard() -在线功能#33。

    这段代码是设置返回变量的地方。当我这样做的时候,一切都很顺利,我回到了:

    https://test.test.test/myresponse?client_secret=src_client_secret_xxx&livemode=false&source=src_xxx&this=atest

    值得注意的是 this=atest 最后。我想可能只是你的url中缺少了一个协议(https://),它正在修剪所有东西。也许试着把它包括进去?