允许删除Adyen Drop的保存信用卡信息

发布于 2025-02-11 20:47:21 字数 1106 浏览 3 评论 0原文

我正在使用样本.NET代码进行使用Adyen付款的POC。 目前,我正在努力配置Dropin Checkout。

我能够允许保存信用卡信息,添加enablestoredEtails属性到结帐。

我看到还有另一个属性showRemovePaymentMethodButton,我相信它将用于从drop中删除保存的信用卡信息,但是当我添加该属性的

正确方法是允许用户的正确方法 时,没有任何变化要在Dropin Checkout上删除保存的信用卡信息?

这是我正在处理的代码的一部分:

return new AdyenCheckout(
{
  clientKey,
  locale: "en_US",
  environment: "test",
  session: session,
  showPayButton: true,
  paymentMethodsConfiguration: {
    ideal: {
      showImage: true,
    },
    card: {
      hasHolderName: true,
      holderNameRequired: true,
      name: "Credit or debit card",
      amount: {
        value: 2000,
        currency: "USD",
        },
      enableStoreDetails: true,
      showRemovePaymentMethodButton: true
    },
    paypal: {
      amount: {
        value: 1000,
        currency: "USD",
      },
      environment: "test", // Change this to "live" when you're ready to accept live PayPal payments
      countryCode: "US", // Only needed for test. This will be automatically retrieved when you are in production.
    },
  },

I am working on a POC with Adyen payments using the sample .Net code.
Currently I am working on configuring the DropIn checkout.

I was able to allow save credit card info adding the enableStoreDetails attribute to the checkout.

I see that there is another attribute showRemovePaymentMethodButton and I believe it would be used to remove saved credit card info from the Drop In, but nothing changes when I add that attribute

What is the correct way of allowing a user to remove a saved credit card info at the DropIn checkout?

This is part of the code I am working on:

return new AdyenCheckout(
{
  clientKey,
  locale: "en_US",
  environment: "test",
  session: session,
  showPayButton: true,
  paymentMethodsConfiguration: {
    ideal: {
      showImage: true,
    },
    card: {
      hasHolderName: true,
      holderNameRequired: true,
      name: "Credit or debit card",
      amount: {
        value: 2000,
        currency: "USD",
        },
      enableStoreDetails: true,
      showRemovePaymentMethodButton: true
    },
    paypal: {
      amount: {
        value: 1000,
        currency: "USD",
      },
      environment: "test", // Change this to "live" when you're ready to accept live PayPal payments
      countryCode: "US", // Only needed for test. This will be automatically retrieved when you are in production.
    },
  },

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

八巷 2025-02-18 20:47:21

回调OnDisableStoredPaymentMethod(...)也需要包含在Dropin中。根据文档:OnDisableStoredPaymentMethod(StordPaymentMethodID,Resolve,recult)删除了存储的付款方法(需要在homecontroller.cs中工作以支持 /disable端点)。当购物者删除存储的付款方式时,这就是称为。要删除所选的付款方式,请使用StorePaymentMethodID进行A /禁用请求。然后根据 /禁用响应来调用Resolve()或recond()。

有关更多信息( https://docs.adyen。 com/inline-payments/dokenization/toking-tokens#disable存储details )和/或高级用例,您可以在此处找到更多信息: https://docs.adyen.com/online-payments/web-drop-in/web-drop-in/optional-configuration

希望有帮助!

编辑/添加示例:

const dropin = checkout
  .create('dropin', {
    showRemovePaymentMethodButton: true,
    onDisableStoredPaymentMethod(storedPaymentMethodId, resolve, reject) {
      console.log('hey there');
    }
  })
  .mount('#dropin-container');

The callback onDisableStoredPaymentMethod(...) also needs to be included in the Dropin. According to the documentation: onDisableStoredPaymentMethod(storedPaymentMethodId, resolve, reject) removes the stored payment method (requires work in the HomeController.cs to support the /disable endpoint). This is called when a shopper removes a stored payment method. To remove the selected payment method, make a /disable request using the storedPaymentMethodId. Then call either resolve() or reject(), depending on the /disable response.

For more information (https://docs.adyen.com/online-payments/tokenization/managing-tokens#disable-stored-details) and/or advanced use-cases, you can find more information here: https://docs.adyen.com/online-payments/web-drop-in/optional-configuration

Hope that helped!

Edit/added example:

const dropin = checkout
  .create('dropin', {
    showRemovePaymentMethodButton: true,
    onDisableStoredPaymentMethod(storedPaymentMethodId, resolve, reject) {
      console.log('hey there');
    }
  })
  .mount('#dropin-container');

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文