@alipay/ams-checkout 0.0.1710212811-dev.1 → 0.0.1710212811-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
8
  import { IGetMerchantSession, ICompletePaymentAuthorized, ICompleteApplePay, ILogError, IApplePayTrace } from './interface';
9
- import { IpaymentSessionMetaData } from '../../types';
9
+ import { ApplePaySubTypeEnum, IpaymentSessionMetaData } from '../../types';
10
10
  /**
11
11
  * Apple Pay Service
12
12
  */
@@ -19,7 +19,6 @@ declare class ApplePayService {
19
19
  private completeApplePay;
20
20
  private logError;
21
21
  private applePayTrace;
22
- private onEventCallback;
23
22
  constructor();
24
23
  /**
25
24
  * set Apple Pay Params
@@ -31,9 +30,11 @@ declare class ApplePayService {
31
30
  */
32
31
  setApplePayParams(getMerchantSession: IGetMerchantSession, completePaymentAuthorized: ICompletePaymentAuthorized, completeApplePay: ICompleteApplePay, logError: ILogError, applePayTrace: IApplePayTrace): void;
33
32
  /**
34
- * Apple Pay is enabled
33
+ * Is Apple Pay Enabled
34
+ * @param subTypeEnum
35
+ * @returns
35
36
  */
36
- isEnabled: () => boolean;
37
+ canMakePayments(subTypeEnum?: ApplePaySubTypeEnum): any;
37
38
  /**
38
39
  * has Active Card in Apple Pay
39
40
  * @param merchantIdentifier
@@ -17,6 +17,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
17
17
  */
18
18
  /* eslint-disable @typescript-eslint/no-explicit-any */
19
19
  import { APPLE_PAY_VERSION, APPLE_PAY_RECURRING_VERSION } from "./interface";
20
+ import { ApplePaySubTypeEnum } from "../../types";
21
+
20
22
  /**
21
23
  * Apple Pay Service
22
24
  */
@@ -32,13 +34,6 @@ var ApplePayService = /*#__PURE__*/function () {
32
34
  _defineProperty(this, "completeApplePay", void 0);
33
35
  _defineProperty(this, "logError", void 0);
34
36
  _defineProperty(this, "applePayTrace", void 0);
35
- _defineProperty(this, "onEventCallback", void 0);
36
- /**
37
- * Apple Pay is enabled
38
- */
39
- _defineProperty(this, "isEnabled", function () {
40
- return window.ApplePaySession ? window.ApplePaySession.canMakePayments() : false;
41
- });
42
37
  _defineProperty(this, "onvalidatemerchant", function (event) {
43
38
  _this.applePayTrace('onValidateMerchant');
44
39
  _this.getMerchantSession({
@@ -183,14 +178,28 @@ var ApplePayService = /*#__PURE__*/function () {
183
178
  this.logError = logError;
184
179
  this.applePayTrace = applePayTrace;
185
180
  }
181
+
182
+ /**
183
+ * Is Apple Pay Enabled
184
+ * @param subTypeEnum
185
+ * @returns
186
+ */
186
187
  }, {
187
- key: "hasActiveCard",
188
- value: (
188
+ key: "canMakePayments",
189
+ value: function canMakePayments(subTypeEnum) {
190
+ if (ApplePaySubTypeEnum.ApplePayRecurringPayment === subTypeEnum) {
191
+ return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_RECURRING_VERSION) : false;
192
+ }
193
+ return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_VERSION) : false;
194
+ }
195
+
189
196
  /**
190
197
  * has Active Card in Apple Pay
191
198
  * @param merchantIdentifier
192
199
  */
193
- function () {
200
+ }, {
201
+ key: "hasActiveCard",
202
+ value: (function () {
194
203
  var _hasActiveCard = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(merchantIdentifier) {
195
204
  var _window3, ApplePaySession;
196
205
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -23,7 +23,7 @@ declare class ApplePayComponent extends CoreInstance {
23
23
  * @param subTypeEnum
24
24
  * @returns
25
25
  */
26
- canMakePayments(subTypeEnum: ApplePaySubTypeEnum): any;
26
+ canMakePayments(subTypeEnum?: ApplePaySubTypeEnum): any;
27
27
  /**
28
28
  * Submit Pay
29
29
  * @param paymentSessionData
@@ -28,12 +28,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
29
29
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
30
30
  */
31
- import { ApplePaySubTypeEnum, componentSignEnum, environmentEnum, eventCodeEnum, productSceneEnum } from "../../types";
31
+ import { componentSignEnum, environmentEnum, eventCodeEnum, productSceneEnum } from "../../types";
32
32
  import ApplePayService from "../../common/applepay";
33
33
  import { getComponentSign, parseSessionData } from "../component";
34
34
  import { getApplePayPaymentSession, submitPayInfo } from "../../service";
35
35
  import CoreInstance from "../instance";
36
- import { APPLE_PAY_RECURRING_VERSION, APPLE_PAY_VERSION } from "../../common/applepay/interface";
37
36
  import { EVENT } from "../../constant";
38
37
 
39
38
  /**
@@ -139,10 +138,7 @@ var ApplePayComponent = /*#__PURE__*/function (_CoreInstance) {
139
138
  }, {
140
139
  key: "canMakePayments",
141
140
  value: function canMakePayments(subTypeEnum) {
142
- if (ApplePaySubTypeEnum.ApplePayRecurringPayment === subTypeEnum) {
143
- return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_RECURRING_VERSION) : false;
144
- }
145
- return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_VERSION) : false;
141
+ return window.ApplePaySession ? this._applePayService.canMakePayments(subTypeEnum) : false;
146
142
  }
147
143
 
148
144
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1710212811-dev.1",
3
+ "version": "0.0.1710212811-dev.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",