English 中文(简体)
果帕网络——确定支助客户版本
原标题:Apple Pay Web - determine supported client version

如何确定由谁来支付 Apple果网基版本的客户支持?

在核对文件时,仅发现supportsVersion(序号:boolean

问题回答

在你找到能发挥作用的版本之前,不会以其他方式反对所有版本。

static getLatestSupportedVersion(): number {
  if (!this.doesBrowserSupport()) {
    return 0
  }
  // https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_on_the_web_version_history
  const LATEST_VERSION = 16
  let applePayVersion = LATEST_VERSION
  while (!this.supportsVersion(applePayVersion) && applePayVersion > 1) {
    --applePayVersion
  }
  return applePayVersion
}

static supportsVersion(number): boolean {
  return window.ApplePaySession.supportsVersion(number)
}

static doesBrowserSupport(): boolean {
  if (window["ApplePaySession"]) {
    return true
  }
  return false
}




相关问题
xcode datatask not running

I am new in using swift5. I am going to integrate Apple Pay with my app, however the datatask seems not working cannot see any log from the console. Can anyone tell me what I am done wrong? also how ...

Apple Pay & Google Pay (P2P) with Flutter

I m new to Payment Integration and I want to use Apple Pay and Google Pay as an option in my flutter app. I ve discovered this package Pay that integerates both of them. the case is that I want to let ...

热门标签