@alipay/ams-checkout 0.0.1754894468-dev.12 → 0.0.1754894468-dev.14
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.
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Logger } from "../../util/logger";
|
|
2
2
|
import { BusContext, BusMessage, BusSubscriber } from "../../core/bus";
|
|
3
|
-
export declare class ApplePayInitMessage {
|
|
4
|
-
private environment;
|
|
5
|
-
private locale;
|
|
6
|
-
}
|
|
7
3
|
export declare class ApplePayBusSubscriber extends BusSubscriber {
|
|
8
4
|
private applePay;
|
|
9
5
|
logger: Logger;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
7
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
5
8
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
6
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -8,9 +11,6 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
8
11
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
9
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -18,11 +18,13 @@ import { BusManager, BusMessage, BusSubscriber } from "../../core/bus";
|
|
|
18
18
|
import { ApplePayActionEnum, PaymentActionEnum, SDKCallbackActionEnum } from "../../core/bus/interface";
|
|
19
19
|
import ApplePayComponent, { ApplePayComponentEvent } from "./component";
|
|
20
20
|
import ApplePayService from "./service";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
|
|
22
|
+
// TODO 无意义代码
|
|
23
|
+
// export class ApplePayInitMessage {
|
|
24
|
+
// private environment:string;
|
|
25
|
+
// private locale:string;
|
|
26
|
+
// }
|
|
27
|
+
|
|
26
28
|
export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
27
29
|
_inherits(ApplePayBusSubscriber, _BusSubscriber);
|
|
28
30
|
var _super = _createSuper(ApplePayBusSubscriber);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
|
2
2
|
import type { IcreatePaymentParams, EventPayload } from '../../types';
|
|
3
|
+
export declare const getServerPath: (_environment: string, version: string) => string;
|
|
4
|
+
export declare const getServerHost: (_environment: string, version: string) => string;
|
|
3
5
|
export default class CheckoutApp {
|
|
4
6
|
app: any;
|
|
5
7
|
paymentMethodsResult: any;
|
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
import { BASEPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
|
16
16
|
import { MessageName } from "../../types";
|
|
17
17
|
import { getOrigin, getType, getViewPort, isDom, isJsonString, serialize } from "../../util";
|
|
18
|
-
var getServerPath = function getServerPath() {
|
|
18
|
+
export var getServerPath = function getServerPath() {
|
|
19
19
|
var _environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
|
|
20
20
|
var version = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
21
|
var host = '';
|
|
@@ -35,7 +35,7 @@ var getServerPath = function getServerPath() {
|
|
|
35
35
|
}
|
|
36
36
|
return host;
|
|
37
37
|
};
|
|
38
|
-
var getServerHost = function getServerHost(_environment, version) {
|
|
38
|
+
export var getServerHost = function getServerHost(_environment, version) {
|
|
39
39
|
var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
|
|
40
40
|
var macth = reg.exec(getServerPath(_environment, version));
|
|
41
41
|
return macth && macth[0] || '';
|