@alipay/ams-checkout 0.0.1744283958-dev.1 → 0.0.1744283958-dev.4
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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/constant/index.d.ts +3 -0
- package/esm/constant/index.js +3 -0
- package/esm/core/component/element/elementContainerService/containerService.d.ts +2 -0
- package/esm/core/component/element/elementContainerService/containerService.js +7 -1
- package/esm/core/component/element/elementContainerService/index.d.ts +1 -0
- package/esm/core/component/element/elementContainerService/index.js +5 -0
- package/esm/core/component/element/elementController/index.d.ts +1 -0
- package/esm/core/component/element/elementController/index.js +137 -99
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +4 -1
- package/esm/core/component/element/elementProcessor/addressProcessor.js +26 -5
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +4 -1
- package/esm/core/component/element/elementProcessor/authProcessor.js +26 -3
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +26 -20
- package/esm/core/component/element/mock.d.ts +2 -0
- package/esm/core/component/element/mock.js +360 -0
- package/package.json +1 -1
@@ -1,4 +1,10 @@
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
2
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3
9
|
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); } }
|
4
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -11,6 +17,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
11
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
12
18
|
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; } }
|
13
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
20
|
+
import { parseSessionData } from "../../index";
|
14
21
|
import PackageJson from "../../../../../package.json";
|
15
22
|
import { generateIframeSrc as _generateIframeSrc } from "../util";
|
16
23
|
import BaseElementProcessor from "./baseElementProcessor";
|
@@ -91,10 +98,26 @@ var AuthProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
91
98
|
}
|
92
99
|
}, {
|
93
100
|
key: "update",
|
94
|
-
value: function update(
|
101
|
+
value: function update(_ref3) {
|
102
|
+
var data = _ref3.data,
|
103
|
+
paymentSessionData = _ref3.paymentSessionData;
|
104
|
+
var _parseSessionData = parseSessionData(paymentSessionData),
|
105
|
+
_parseSessionData2 = _slicedToArray(_parseSessionData, 2),
|
106
|
+
parseData = _parseSessionData2[0],
|
107
|
+
sessionData = _parseSessionData2[1];
|
95
108
|
// 实现 update 方法的具体逻辑
|
96
|
-
|
97
|
-
|
109
|
+
this.eventCenter.dispatchToApp({
|
110
|
+
event: 'updatePayment',
|
111
|
+
data: {
|
112
|
+
params: {
|
113
|
+
paymentSessionData: paymentSessionData,
|
114
|
+
sessionResult: parseData,
|
115
|
+
sessionData: sessionData,
|
116
|
+
originActionQueryResult: data.originActionQueryResult,
|
117
|
+
originOneAccountQueryResult: data.originOneAccountQueryResult
|
118
|
+
}
|
119
|
+
}
|
120
|
+
});
|
98
121
|
}
|
99
122
|
}]);
|
100
123
|
return AuthProcessor;
|
@@ -23,7 +23,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
23
23
|
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; }
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
25
25
|
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); }
|
26
|
-
import { parseSessionData } from "
|
26
|
+
import { parseSessionData } from "../../index";
|
27
27
|
import PackageJson from "../../../../../package.json";
|
28
28
|
import { EVENT } from "../../../../constant";
|
29
29
|
import { ServiceProvider } from "../../../../foundation/service";
|
@@ -57,7 +57,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
57
57
|
data: {
|
58
58
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
59
59
|
paymentSessionData: paymentContext === null || paymentContext === void 0 ? void 0 : paymentContext.paymentSessionId,
|
60
|
-
queryResult: extraParam === null || extraParam === void 0 ? void 0 : extraParam.
|
60
|
+
queryResult: extraParam === null || extraParam === void 0 ? void 0 : extraParam.originActionQueryResult,
|
61
61
|
envInfo: {
|
62
62
|
screenHeight: screen.height,
|
63
63
|
screenWidth: screen.width
|
@@ -230,7 +230,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
230
230
|
value: function () {
|
231
231
|
var _obtainData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
232
232
|
var _paymentSessionObj$co;
|
233
|
-
var requestService, _this$elementContaine3, paymentSession, paymentSessionObj, _this$options2, environment, locale, _ref4, paymentSessionConfig, hostSign, isConnect, generateActionQueryPromise, generateOneAccountQueryPromise, _yield$Promise$all, _yield$Promise$all2,
|
233
|
+
var requestService, _this$elementContaine3, paymentSession, paymentSessionObj, _this$options2, environment, locale, _ref4, paymentSessionConfig, hostSign, isConnect, LOCAL_MOCK, generateActionQueryPromise, generateOneAccountQueryPromise, _yield$Promise$all, _yield$Promise$all2, originActionQueryResult, originOneAccountQueryResult;
|
234
234
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
235
235
|
while (1) switch (_context2.prev = _context2.next) {
|
236
236
|
case 0:
|
@@ -240,12 +240,16 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
240
240
|
_ref4 = paymentSessionObj || {}, paymentSessionConfig = _ref4.paymentSessionConfig;
|
241
241
|
hostSign = paymentSession.split('&&')[1] || '';
|
242
242
|
isConnect = paymentSessionObj === null || paymentSessionObj === void 0 || (_paymentSessionObj$co = paymentSessionObj.connectFactor) === null || _paymentSessionObj$co === void 0 ? void 0 : _paymentSessionObj$co.enableConnect;
|
243
|
+
LOCAL_MOCK = window.location.href.indexOf('LOCAL_MOCK=1') !== -1;
|
243
244
|
generateActionQueryPromise = function generateActionQueryPromise() {
|
244
245
|
return new Promise(function (resolve, reject) {
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
246
|
+
if (LOCAL_MOCK) {
|
247
|
+
setTimeout(function () {
|
248
|
+
resolve(oneAccount);
|
249
|
+
resolve(sdkAction);
|
250
|
+
}, 100);
|
251
|
+
return;
|
252
|
+
}
|
249
253
|
requestService.request({
|
250
254
|
paymentSessionConfig: paymentSessionConfig,
|
251
255
|
paymentSessionData: paymentSession
|
@@ -267,10 +271,12 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
267
271
|
};
|
268
272
|
generateOneAccountQueryPromise = function generateOneAccountQueryPromise() {
|
269
273
|
return new Promise(function (resolve, reject) {
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
+
if (LOCAL_MOCK) {
|
275
|
+
setTimeout(function () {
|
276
|
+
resolve(oneAccount);
|
277
|
+
}, 100);
|
278
|
+
return;
|
279
|
+
}
|
274
280
|
requestService.request({
|
275
281
|
paymentSessionConfig: paymentSessionConfig,
|
276
282
|
paymentSessionData: paymentSession,
|
@@ -292,22 +298,22 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
292
298
|
});
|
293
299
|
});
|
294
300
|
};
|
295
|
-
_context2.next =
|
301
|
+
_context2.next = 11;
|
296
302
|
return Promise.all(isConnect ? [generateActionQueryPromise(), generateOneAccountQueryPromise()] : [generateActionQueryPromise()]);
|
297
|
-
case
|
303
|
+
case 11:
|
298
304
|
_yield$Promise$all = _context2.sent;
|
299
305
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
300
|
-
|
301
|
-
|
306
|
+
originActionQueryResult = _yield$Promise$all2[0];
|
307
|
+
originOneAccountQueryResult = _yield$Promise$all2[1];
|
302
308
|
this.obtainDataRes = {
|
303
|
-
|
304
|
-
|
309
|
+
originActionQueryResult: originActionQueryResult,
|
310
|
+
originOneAccountQueryResult: originOneAccountQueryResult
|
305
311
|
};
|
306
312
|
return _context2.abrupt("return", {
|
307
|
-
|
308
|
-
|
313
|
+
originActionQueryResult: originActionQueryResult,
|
314
|
+
originOneAccountQueryResult: originOneAccountQueryResult
|
309
315
|
});
|
310
|
-
case
|
316
|
+
case 17:
|
311
317
|
case "end":
|
312
318
|
return _context2.stop();
|
313
319
|
}
|
@@ -564,4 +564,364 @@ export var submitResult = {
|
|
564
564
|
locale: 'en_US',
|
565
565
|
preferred: true
|
566
566
|
}]
|
567
|
+
};
|
568
|
+
export var sdkActionUpdate = {
|
569
|
+
amountConfirmRequired: false,
|
570
|
+
autoDebitWithToken: false,
|
571
|
+
checkoutSettings: '{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',
|
572
|
+
errorActions: {},
|
573
|
+
extendInfo: {},
|
574
|
+
goods: [{
|
575
|
+
goodsName: 'Goods No.1',
|
576
|
+
goodsQuantity: '1',
|
577
|
+
goodsTotalAmount: {
|
578
|
+
amount: '200.00',
|
579
|
+
currency: 'PEN',
|
580
|
+
currencyLabel: 'S/.',
|
581
|
+
formattedAmount: '200.00',
|
582
|
+
formattedAmountWithCurrency: 'S/. 200.00',
|
583
|
+
value: '20000'
|
584
|
+
},
|
585
|
+
goodsTotalAmountView: {
|
586
|
+
currency: 'PEN',
|
587
|
+
currencyDivider: ' ',
|
588
|
+
currencyLabel: 'S/.',
|
589
|
+
currencySymbolPosition: 'L',
|
590
|
+
formattedValue: '200.00',
|
591
|
+
value: '200.00'
|
592
|
+
},
|
593
|
+
goodsUnitAmount: {
|
594
|
+
amount: '200.00',
|
595
|
+
currency: 'PEN',
|
596
|
+
currencyLabel: 'S/.',
|
597
|
+
formattedAmount: '200.00',
|
598
|
+
formattedAmountWithCurrency: 'S/. 200.00',
|
599
|
+
value: '20000'
|
600
|
+
},
|
601
|
+
goodsUnitAmountView: {
|
602
|
+
currency: 'PEN',
|
603
|
+
currencyDivider: ' ',
|
604
|
+
currencyLabel: 'S/.',
|
605
|
+
currencySymbolPosition: 'L',
|
606
|
+
formattedValue: '200.00',
|
607
|
+
value: '200.00'
|
608
|
+
},
|
609
|
+
referenceGoodsId: 'amsdm_good_tony_c_20230227_095825_922'
|
610
|
+
}, {
|
611
|
+
goodsName: 'Goods No.2',
|
612
|
+
goodsQuantity: '2',
|
613
|
+
goodsTotalAmount: {
|
614
|
+
amount: '40000',
|
615
|
+
currency: 'KRW',
|
616
|
+
currencyLabel: '₩',
|
617
|
+
formattedAmount: '40,000',
|
618
|
+
formattedAmountWithCurrency: '₩ 40,000',
|
619
|
+
value: '40000'
|
620
|
+
},
|
621
|
+
goodsTotalAmountView: {
|
622
|
+
currency: 'KRW',
|
623
|
+
currencyDivider: ' ',
|
624
|
+
currencyLabel: '₩',
|
625
|
+
currencySymbolPosition: 'L',
|
626
|
+
formattedValue: '40,000',
|
627
|
+
value: '40000'
|
628
|
+
},
|
629
|
+
goodsUnitAmount: {
|
630
|
+
amount: '20000',
|
631
|
+
currency: 'KRW',
|
632
|
+
currencyLabel: '₩',
|
633
|
+
formattedAmount: '20,000',
|
634
|
+
formattedAmountWithCurrency: '₩ 20,000',
|
635
|
+
value: '20000'
|
636
|
+
},
|
637
|
+
goodsUnitAmountView: {
|
638
|
+
currency: 'KRW',
|
639
|
+
currencyDivider: ' ',
|
640
|
+
currencyLabel: '₩',
|
641
|
+
currencySymbolPosition: 'L',
|
642
|
+
formattedValue: '20,000',
|
643
|
+
value: '20000'
|
644
|
+
},
|
645
|
+
referenceGoodsId: 'amsdm_good_tony_c_20230227_095825_922'
|
646
|
+
}],
|
647
|
+
links: {
|
648
|
+
policyInfo: '["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',
|
649
|
+
privacyLink: 'https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002',
|
650
|
+
cookieLink: 'https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001'
|
651
|
+
},
|
652
|
+
needInstallmentAbility: false,
|
653
|
+
needOtherElements: true,
|
654
|
+
orderAmount: {
|
655
|
+
amount: '200.00',
|
656
|
+
currency: 'BRL',
|
657
|
+
currencyLabel: 'R$',
|
658
|
+
formattedAmount: '200,00',
|
659
|
+
formattedAmountWithCurrency: 'R$ 200,00',
|
660
|
+
value: '20000'
|
661
|
+
},
|
662
|
+
orderAmountView: {
|
663
|
+
currency: 'BRL',
|
664
|
+
currencyDivider: ' ',
|
665
|
+
currencyLabel: 'R$',
|
666
|
+
currencySymbolPosition: 'L',
|
667
|
+
formattedValue: '200.00',
|
668
|
+
value: '200.00'
|
669
|
+
},
|
670
|
+
pageStyle: {
|
671
|
+
checkoutSettings: '{"addressAutoComplete":false}'
|
672
|
+
},
|
673
|
+
paymentAmount: {
|
674
|
+
amount: '200.00',
|
675
|
+
currency: 'BRL',
|
676
|
+
currencyLabel: 'R$',
|
677
|
+
formattedAmount: '200,00',
|
678
|
+
formattedAmountWithCurrency: 'R$ 200,00',
|
679
|
+
value: '20000'
|
680
|
+
},
|
681
|
+
paymentAmountView: {
|
682
|
+
currency: 'BRL',
|
683
|
+
currencyDivider: ' ',
|
684
|
+
currencyLabel: 'R$',
|
685
|
+
currencySymbolPosition: 'L',
|
686
|
+
formattedValue: '200.00',
|
687
|
+
value: '200.00'
|
688
|
+
},
|
689
|
+
paymentMethods: [{
|
690
|
+
antomPage: 'paymentMetaPage',
|
691
|
+
category: 'CARD',
|
692
|
+
icon: 'https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg',
|
693
|
+
iconName: 'Card',
|
694
|
+
links: [],
|
695
|
+
logoList: [{
|
696
|
+
cardBrand: 'GWANGJUBANK',
|
697
|
+
logoUrl: 'https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg'
|
698
|
+
}, {
|
699
|
+
cardBrand: 'SHINHYEOP',
|
700
|
+
logoUrl: 'https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg'
|
701
|
+
}],
|
702
|
+
paymentElements: [{
|
703
|
+
paymentElementKey: 'paymentMethodId',
|
704
|
+
elementType: 'CARD',
|
705
|
+
elementMandatory: false,
|
706
|
+
title: 'Card Information',
|
707
|
+
defaultValue: '',
|
708
|
+
extendInfo: '{"needOtherElements":false,"isTempTokenization":"true"}',
|
709
|
+
subPaymentElementView: [{
|
710
|
+
defaultText: 'Card Number',
|
711
|
+
elementMandatory: true,
|
712
|
+
elementRegx: '^\\d{15,18}$',
|
713
|
+
elementType: 'DIGIT_18',
|
714
|
+
paramIllegalText: 'cardNo error',
|
715
|
+
paymentElementKey: 'cardNo',
|
716
|
+
title: 'Card Number',
|
717
|
+
defaultValue: '',
|
718
|
+
extendInfo: '{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'
|
719
|
+
}, {
|
720
|
+
defaultText: 'CVV',
|
721
|
+
defaultValue: '',
|
722
|
+
elementMandatory: true,
|
723
|
+
elementRegx: '^\\d{3,4}$',
|
724
|
+
elementType: 'DIGIT_4',
|
725
|
+
extendInfo: '{"excludeMetaDataCodes":"null"}',
|
726
|
+
paramIllegalText: 'Please enter a valid 3 or 4 digit CVV number',
|
727
|
+
paymentElementKey: 'cardCVV'
|
728
|
+
}, {
|
729
|
+
defaultText: 'Name on Card',
|
730
|
+
elementMandatory: true,
|
731
|
+
elementRegx: '',
|
732
|
+
elementType: 'TEXT',
|
733
|
+
paramIllegalText: 'Please enter a Name on Card',
|
734
|
+
paymentElementKey: 'cardHolderName',
|
735
|
+
defaultValue: '',
|
736
|
+
extendInfo: '{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'
|
737
|
+
}, {
|
738
|
+
defaultText: 'Exp Date(MM/YY)',
|
739
|
+
elementMandatory: true,
|
740
|
+
elementRegx: '.{5}',
|
741
|
+
paramIllegalText: 'Please enter a Exp Date',
|
742
|
+
elementType: 'TEXT',
|
743
|
+
paymentElementKey: 'expiryYear',
|
744
|
+
title: 'Please enter a Exp Date',
|
745
|
+
defaultValue: '',
|
746
|
+
extendInfo: '{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'
|
747
|
+
}, {
|
748
|
+
defaultText: 'Exp Date(MM/YY)',
|
749
|
+
elementMandatory: true,
|
750
|
+
elementRegx: '',
|
751
|
+
elementType: 'TEXT',
|
752
|
+
paymentElementKey: 'expiryMonth',
|
753
|
+
title: 'Please enter a Exp Date',
|
754
|
+
defaultValue: '',
|
755
|
+
extendInfo: '{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'
|
756
|
+
}]
|
757
|
+
}, {
|
758
|
+
defaultText: 'Save this payment method for future use.',
|
759
|
+
elementMandatory: false,
|
760
|
+
elementType: 'CHECKBOX',
|
761
|
+
extendInfo: '{}',
|
762
|
+
paymentElementKey: 'bindPaymentMethod'
|
763
|
+
}, {
|
764
|
+
elementMandatory: false,
|
765
|
+
elementType: 'DIGIT_4',
|
766
|
+
extendInfo: '[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',
|
767
|
+
paymentElementKey: 'tenor',
|
768
|
+
title: 'Instalment plan',
|
769
|
+
defaultValue: ''
|
770
|
+
}, {
|
771
|
+
defaultText: '_ _ _. _ _ _. _ _ _-_ _',
|
772
|
+
defaultValue: '',
|
773
|
+
elementMandatory: true,
|
774
|
+
elementRegx: '^\\d{11}$',
|
775
|
+
elementType: 'DIGIT_11',
|
776
|
+
extendInfo: '{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',
|
777
|
+
paramIllegalText: 'Please enter a valid 11-digit CPF number',
|
778
|
+
paymentElementKey: 'cpf',
|
779
|
+
title: 'CPF Code'
|
780
|
+
}, {
|
781
|
+
defaultText: 'Enter your email address',
|
782
|
+
defaultValue: '',
|
783
|
+
elementMandatory: true,
|
784
|
+
elementRegx: '^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$',
|
785
|
+
elementType: 'TEXT',
|
786
|
+
extendInfo: '{"excludeMetaDataCodes":"null"}',
|
787
|
+
paramIllegalText: 'Email address format invalid',
|
788
|
+
paymentElementKey: 'payerEmail',
|
789
|
+
title: 'Email'
|
790
|
+
}],
|
791
|
+
paymentMethod: 'CARD',
|
792
|
+
paymentMethodName: 'Card',
|
793
|
+
paymentMethodType: 'CARD',
|
794
|
+
webRedirectType: 'PAGE_REFRESH'
|
795
|
+
}],
|
796
|
+
savedPaymentMethods: [],
|
797
|
+
storePolicies: '[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',
|
798
|
+
success: true,
|
799
|
+
redirectUrl: '',
|
800
|
+
supportedLanguages: [{
|
801
|
+
locale: 'en_US',
|
802
|
+
preferred: true,
|
803
|
+
title: 'English'
|
804
|
+
}, {
|
805
|
+
locale: 'it_IT',
|
806
|
+
preferred: false,
|
807
|
+
title: 'Português'
|
808
|
+
}, {
|
809
|
+
locale: 'de_DE',
|
810
|
+
preferred: false
|
811
|
+
}, {
|
812
|
+
locale: 'fr_FR',
|
813
|
+
preferred: false
|
814
|
+
}, {
|
815
|
+
locale: 'nl_NL',
|
816
|
+
preferred: false
|
817
|
+
}, {
|
818
|
+
locale: 'es_ES',
|
819
|
+
preferred: false
|
820
|
+
}, {
|
821
|
+
locale: 'zh_CN',
|
822
|
+
preferred: false
|
823
|
+
}, {
|
824
|
+
country: 'KR',
|
825
|
+
locale: 'ko_KR',
|
826
|
+
preferred: false,
|
827
|
+
title: '한국어'
|
828
|
+
}]
|
829
|
+
};
|
830
|
+
export var oneAccountUpdate = {
|
831
|
+
accountInfo: {
|
832
|
+
email: 'xxxxx@163.com',
|
833
|
+
accountStatus: 'EFFECTIVE',
|
834
|
+
oneAccountId: 'xxxxxxkk'
|
835
|
+
},
|
836
|
+
goods: {
|
837
|
+
goodsName: 'xxxxxxx',
|
838
|
+
goodsImageUrl: '',
|
839
|
+
goodsQuantity: 100,
|
840
|
+
goodsUnitAmount: {
|
841
|
+
currency: 'EUR',
|
842
|
+
value: 100,
|
843
|
+
currencyLabel: ''
|
844
|
+
}
|
845
|
+
},
|
846
|
+
paymentMethods: [{
|
847
|
+
paymentMethodType: 'CARD',
|
848
|
+
iconName: 'VISA',
|
849
|
+
icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
|
850
|
+
paymentMethodId: 'card-id',
|
851
|
+
paymentMethodDetail: {
|
852
|
+
last4: '**** 1233'
|
853
|
+
}
|
854
|
+
}, {
|
855
|
+
paymentMethodType: 'CARD',
|
856
|
+
iconName: 'VISA2',
|
857
|
+
icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
|
858
|
+
paymentMethodId: 'card-id2',
|
859
|
+
paymentMethodDetail: {
|
860
|
+
last4: '**** 1235'
|
861
|
+
}
|
862
|
+
}
|
863
|
+
// {
|
864
|
+
// "paymentMethodType": "dana",
|
865
|
+
// "iconName": "DANA",
|
866
|
+
// "icon": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",
|
867
|
+
// "paymentMethodElements": {},
|
868
|
+
// },
|
869
|
+
],
|
870
|
+
links: {
|
871
|
+
privacyLink: 'https://global.alipay.com/docs/ac/Platform/bahzqeb-',
|
872
|
+
cookieLink: 'https://global.alipay.com/docs/ac/Platform/x1rhufzj'
|
873
|
+
},
|
874
|
+
shippings: [{
|
875
|
+
shippingName: {
|
876
|
+
firstName: '111111',
|
877
|
+
lastName: '11111'
|
878
|
+
},
|
879
|
+
prefer: '1',
|
880
|
+
shippingId: 'xxxx1',
|
881
|
+
shippingPhoneNo: 'xxxxxx123',
|
882
|
+
shippingAddress: {
|
883
|
+
region: 'ID',
|
884
|
+
state: 'Nusa',
|
885
|
+
city: 'Nusa Tenggara Bar.',
|
886
|
+
address1: 'Kec. Mataram, Kota Mataram',
|
887
|
+
address2: 'Jl. Bangil V No.6, Pagesangan Tim',
|
888
|
+
zipCode: '123445'
|
889
|
+
}
|
890
|
+
}],
|
891
|
+
metaData: {
|
892
|
+
countryList: [{
|
893
|
+
countryName: 'China',
|
894
|
+
default: true
|
895
|
+
}, {
|
896
|
+
countryName: 'Singapore',
|
897
|
+
default: false
|
898
|
+
}]
|
899
|
+
},
|
900
|
+
errorActions: {},
|
901
|
+
extendInfo: {},
|
902
|
+
merchantId: '111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=',
|
903
|
+
needInstallmentAbility: false,
|
904
|
+
needOtherElements: false,
|
905
|
+
orderDescription: 'AMSDM_GIFT',
|
906
|
+
success: true,
|
907
|
+
supportedLanguages: [{
|
908
|
+
locale: 'en_US',
|
909
|
+
preferred: true,
|
910
|
+
title: 'English'
|
911
|
+
}, {
|
912
|
+
country: 'BR',
|
913
|
+
locale: 'pt_BR',
|
914
|
+
preferred: false,
|
915
|
+
title: 'Português'
|
916
|
+
}, {
|
917
|
+
country: 'KR',
|
918
|
+
locale: 'ko_KR',
|
919
|
+
preferred: false,
|
920
|
+
title: '한국어'
|
921
|
+
}, {
|
922
|
+
country: 'MX,CL,PE',
|
923
|
+
locale: 'es_ES',
|
924
|
+
preferred: false,
|
925
|
+
title: 'Español'
|
926
|
+
}]
|
567
927
|
};
|