【问题标题】:How can I integrate Apple Pay JS with angular如何将 Apple Pay JS 与 Angular 集成
【发布时间】:2021-04-05 04:24:29
【问题描述】:

我正在考虑将 Apple Pay 集成到我的结帐页面中。如何通过验证 ApplePaySession 类是否存在来检查 Apple Pay JS API 在浏览器中是否可用。

当我给出条件时,

if (window.ApplePaySession && ApplePaySession.canMakePayments()){}

它显示错误,即; "Property 'ApplePaySession' does not exist on type 'Window & typeof globalThis'".

【问题讨论】:

    标签: angular applepay applepayjs


    【解决方案1】:

    在@component 上方添加以下内容:

    declare var ApplePaySession: any;
    

    【讨论】:

      猜你喜欢
      • 2021-09-16
      • 2016-10-15
      • 2020-10-05
      • 2020-03-27
      • 2018-09-30
      • 2023-02-08
      • 2020-05-23
      • 1970-01-01
      • 2019-09-23
      相关资源
      最近更新 更多