@rebilly/framepay-vue 1.4.0 → 2.1.0
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/build.js +109 -86
- package/package.json +7 -7
package/dist/build.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { h, markRaw } from 'vue';
|
|
2
|
+
|
|
1
3
|
function MountError() {
|
|
2
4
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
3
5
|
_ref$message = _ref.message,
|
|
@@ -157,30 +159,14 @@ function createToken (form, extraData) {
|
|
|
157
159
|
});
|
|
158
160
|
}
|
|
159
161
|
|
|
160
|
-
function _defineProperty(obj, key, value) {
|
|
161
|
-
if (key in obj) {
|
|
162
|
-
Object.defineProperty(obj, key, {
|
|
163
|
-
value: value,
|
|
164
|
-
enumerable: true,
|
|
165
|
-
configurable: true,
|
|
166
|
-
writable: true
|
|
167
|
-
});
|
|
168
|
-
} else {
|
|
169
|
-
obj[key] = value;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return obj;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
162
|
function ownKeys(object, enumerableOnly) {
|
|
176
163
|
var keys = Object.keys(object);
|
|
177
164
|
|
|
178
165
|
if (Object.getOwnPropertySymbols) {
|
|
179
166
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
180
|
-
|
|
167
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
181
168
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
182
|
-
});
|
|
183
|
-
keys.push.apply(keys, symbols);
|
|
169
|
+
})), keys.push.apply(keys, symbols);
|
|
184
170
|
}
|
|
185
171
|
|
|
186
172
|
return keys;
|
|
@@ -188,24 +174,32 @@ function ownKeys(object, enumerableOnly) {
|
|
|
188
174
|
|
|
189
175
|
function _objectSpread2(target) {
|
|
190
176
|
for (var i = 1; i < arguments.length; i++) {
|
|
191
|
-
var source = arguments[i]
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
198
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
199
|
-
} else {
|
|
200
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
201
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
202
|
-
});
|
|
203
|
-
}
|
|
177
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
178
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
179
|
+
_defineProperty(target, key, source[key]);
|
|
180
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
181
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
182
|
+
});
|
|
204
183
|
}
|
|
205
184
|
|
|
206
185
|
return target;
|
|
207
186
|
}
|
|
208
187
|
|
|
188
|
+
function _defineProperty(obj, key, value) {
|
|
189
|
+
if (key in obj) {
|
|
190
|
+
Object.defineProperty(obj, key, {
|
|
191
|
+
value: value,
|
|
192
|
+
enumerable: true,
|
|
193
|
+
configurable: true,
|
|
194
|
+
writable: true
|
|
195
|
+
});
|
|
196
|
+
} else {
|
|
197
|
+
obj[key] = value;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return obj;
|
|
201
|
+
}
|
|
202
|
+
|
|
209
203
|
function updateConfig (configuration) {
|
|
210
204
|
return initializeRebilly(configuration).then(function (Rebilly) {
|
|
211
205
|
Rebilly.update(_objectSpread2({}, configuration));
|
|
@@ -213,7 +207,7 @@ function updateConfig (configuration) {
|
|
|
213
207
|
}
|
|
214
208
|
|
|
215
209
|
//
|
|
216
|
-
var script = {
|
|
210
|
+
var script$1 = {
|
|
217
211
|
name: 'rebilly-form',
|
|
218
212
|
props: {
|
|
219
213
|
extraData: {},
|
|
@@ -332,10 +326,10 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
|
|
|
332
326
|
}
|
|
333
327
|
|
|
334
328
|
/* script */
|
|
335
|
-
const __vue_script__ = script;
|
|
329
|
+
const __vue_script__$1 = script$1;
|
|
336
330
|
|
|
337
331
|
/* template */
|
|
338
|
-
var __vue_render__ = function() {
|
|
332
|
+
var __vue_render__$1 = function () {
|
|
339
333
|
var _vm = this;
|
|
340
334
|
var _h = _vm.$createElement;
|
|
341
335
|
var _c = _vm._self._c || _h;
|
|
@@ -346,17 +340,17 @@ var __vue_render__ = function() {
|
|
|
346
340
|
2
|
|
347
341
|
)
|
|
348
342
|
};
|
|
349
|
-
var __vue_staticRenderFns__ = [];
|
|
350
|
-
__vue_render__._withStripped = true;
|
|
343
|
+
var __vue_staticRenderFns__$1 = [];
|
|
344
|
+
__vue_render__$1._withStripped = true;
|
|
351
345
|
|
|
352
346
|
/* style */
|
|
353
|
-
const __vue_inject_styles__ = undefined;
|
|
347
|
+
const __vue_inject_styles__$1 = undefined;
|
|
354
348
|
/* scoped */
|
|
355
|
-
const __vue_scope_id__ = undefined;
|
|
349
|
+
const __vue_scope_id__$1 = undefined;
|
|
356
350
|
/* module identifier */
|
|
357
|
-
const __vue_module_identifier__ = undefined;
|
|
351
|
+
const __vue_module_identifier__$1 = undefined;
|
|
358
352
|
/* functional template */
|
|
359
|
-
const __vue_is_functional_template__ = false;
|
|
353
|
+
const __vue_is_functional_template__$1 = false;
|
|
360
354
|
/* style inject */
|
|
361
355
|
|
|
362
356
|
/* style inject SSR */
|
|
@@ -365,13 +359,13 @@ __vue_render__._withStripped = true;
|
|
|
365
359
|
|
|
366
360
|
|
|
367
361
|
|
|
368
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
369
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
370
|
-
__vue_inject_styles__,
|
|
371
|
-
__vue_script__,
|
|
372
|
-
__vue_scope_id__,
|
|
373
|
-
__vue_is_functional_template__,
|
|
374
|
-
__vue_module_identifier__,
|
|
362
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
|
|
363
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
364
|
+
__vue_inject_styles__$1,
|
|
365
|
+
__vue_script__$1,
|
|
366
|
+
__vue_scope_id__$1,
|
|
367
|
+
__vue_is_functional_template__$1,
|
|
368
|
+
__vue_module_identifier__$1,
|
|
375
369
|
false,
|
|
376
370
|
undefined,
|
|
377
371
|
undefined,
|
|
@@ -385,33 +379,33 @@ __vue_render__._withStripped = true;
|
|
|
385
379
|
//
|
|
386
380
|
//
|
|
387
381
|
//
|
|
388
|
-
var script
|
|
382
|
+
var script = {
|
|
389
383
|
name: 'rebilly-token'
|
|
390
384
|
};
|
|
391
385
|
|
|
392
386
|
/* script */
|
|
393
|
-
const __vue_script__
|
|
387
|
+
const __vue_script__ = script;
|
|
394
388
|
|
|
395
389
|
/* template */
|
|
396
|
-
var __vue_render__
|
|
390
|
+
var __vue_render__ = function () {
|
|
397
391
|
var _vm = this;
|
|
398
392
|
var _h = _vm.$createElement;
|
|
399
393
|
var _c = _vm._self._c || _h;
|
|
400
394
|
return _c("input", {
|
|
401
|
-
attrs: { id: "rebilly-token", "data-rebilly": "token", type: "hidden" }
|
|
395
|
+
attrs: { id: "rebilly-token", "data-rebilly": "token", type: "hidden" },
|
|
402
396
|
})
|
|
403
397
|
};
|
|
404
|
-
var __vue_staticRenderFns__
|
|
405
|
-
__vue_render__
|
|
398
|
+
var __vue_staticRenderFns__ = [];
|
|
399
|
+
__vue_render__._withStripped = true;
|
|
406
400
|
|
|
407
401
|
/* style */
|
|
408
|
-
const __vue_inject_styles__
|
|
402
|
+
const __vue_inject_styles__ = undefined;
|
|
409
403
|
/* scoped */
|
|
410
|
-
const __vue_scope_id__
|
|
404
|
+
const __vue_scope_id__ = undefined;
|
|
411
405
|
/* module identifier */
|
|
412
|
-
const __vue_module_identifier__
|
|
406
|
+
const __vue_module_identifier__ = undefined;
|
|
413
407
|
/* functional template */
|
|
414
|
-
const __vue_is_functional_template__
|
|
408
|
+
const __vue_is_functional_template__ = false;
|
|
415
409
|
/* style inject */
|
|
416
410
|
|
|
417
411
|
/* style inject SSR */
|
|
@@ -420,13 +414,13 @@ __vue_render__$1._withStripped = true;
|
|
|
420
414
|
|
|
421
415
|
|
|
422
416
|
|
|
423
|
-
const __vue_component__
|
|
424
|
-
{ render: __vue_render__
|
|
425
|
-
__vue_inject_styles__
|
|
426
|
-
__vue_script__
|
|
427
|
-
__vue_scope_id__
|
|
428
|
-
__vue_is_functional_template__
|
|
429
|
-
__vue_module_identifier__
|
|
417
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
418
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
419
|
+
__vue_inject_styles__,
|
|
420
|
+
__vue_script__,
|
|
421
|
+
__vue_scope_id__,
|
|
422
|
+
__vue_is_functional_template__,
|
|
423
|
+
__vue_module_identifier__,
|
|
430
424
|
false,
|
|
431
425
|
undefined,
|
|
432
426
|
undefined,
|
|
@@ -434,8 +428,9 @@ __vue_render__$1._withStripped = true;
|
|
|
434
428
|
);
|
|
435
429
|
|
|
436
430
|
var BaseElementMixin = {
|
|
437
|
-
render: function render(
|
|
438
|
-
return
|
|
431
|
+
render: function render() {
|
|
432
|
+
return h('div', {
|
|
433
|
+
id: this.mountId,
|
|
439
434
|
domProps: {
|
|
440
435
|
id: this.mountId
|
|
441
436
|
}
|
|
@@ -460,11 +455,11 @@ var BaseElementMixin = {
|
|
|
460
455
|
initializeRebilly(this.configuration).then(function (Rebilly) {
|
|
461
456
|
try {
|
|
462
457
|
if (_this.elementType.startsWith('card')) {
|
|
463
|
-
_this.element = Rebilly.card.mount(selector, _this.elementType);
|
|
458
|
+
_this.element = markRaw(Rebilly.card.mount(selector, _this.elementType));
|
|
464
459
|
} else if (_this.elementType === 'iban') {
|
|
465
|
-
_this.element = Rebilly.iban.mount(selector);
|
|
460
|
+
_this.element = markRaw(Rebilly.iban.mount(selector));
|
|
466
461
|
} else if ([FIELD_TYPES.REBILLY_BBAN_ACCOUNT_TYPE, FIELD_TYPES.REBILLY_BBAN_ACCOUNT_NUMBER, FIELD_TYPES.REBILLY_BBAN_ROUTING_NUMBER].includes(_this.elementType)) {
|
|
467
|
-
_this.element = Rebilly.bban.mount(selector, _this.elementType);
|
|
462
|
+
_this.element = markRaw(Rebilly.bban.mount(selector, _this.elementType));
|
|
468
463
|
}
|
|
469
464
|
|
|
470
465
|
_this.element.on('ready', function () {
|
|
@@ -486,21 +481,31 @@ var BaseElementMixin = {
|
|
|
486
481
|
throw new MountError();
|
|
487
482
|
}
|
|
488
483
|
});
|
|
484
|
+
},
|
|
485
|
+
destroyElement: function destroyElement() {
|
|
486
|
+
if (this.element) {
|
|
487
|
+
this.element.destroy();
|
|
488
|
+
}
|
|
489
489
|
}
|
|
490
490
|
},
|
|
491
491
|
created: function created() {
|
|
492
492
|
this.mountElement("#".concat(this.mountId));
|
|
493
493
|
},
|
|
494
|
+
// in vue 2 beforeDestroy is emitted but not in vue 3
|
|
494
495
|
beforeDestroy: function beforeDestroy() {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
this.destroyElement();
|
|
497
|
+
},
|
|
498
|
+
// in vue 3 beforeDestroy hook is replaced with beforeUnmount,
|
|
499
|
+
// we should keep both of them for compatibility purpose
|
|
500
|
+
beforeUnmount: function beforeUnmount() {
|
|
501
|
+
this.destroyElement();
|
|
498
502
|
}
|
|
499
503
|
};
|
|
500
504
|
|
|
501
505
|
var GooglePayMixin = {
|
|
502
|
-
render: function render(
|
|
503
|
-
return
|
|
506
|
+
render: function render() {
|
|
507
|
+
return h('div', {
|
|
508
|
+
id: this.mountId,
|
|
504
509
|
domProps: {
|
|
505
510
|
id: this.mountId
|
|
506
511
|
}
|
|
@@ -524,7 +529,7 @@ var GooglePayMixin = {
|
|
|
524
529
|
|
|
525
530
|
initializeRebilly(this.configuration).then(function (Rebilly) {
|
|
526
531
|
try {
|
|
527
|
-
_this.element = Rebilly.googlePay.mount(selector);
|
|
532
|
+
_this.element = markRaw(Rebilly.googlePay.mount(selector));
|
|
528
533
|
|
|
529
534
|
_this.element.on('ready', function () {
|
|
530
535
|
return _this.$emit('ready');
|
|
@@ -560,6 +565,11 @@ var GooglePayMixin = {
|
|
|
560
565
|
});
|
|
561
566
|
}
|
|
562
567
|
});
|
|
568
|
+
},
|
|
569
|
+
destroyElement: function destroyElement() {
|
|
570
|
+
if (this.element) {
|
|
571
|
+
this.element.destroy();
|
|
572
|
+
}
|
|
563
573
|
}
|
|
564
574
|
},
|
|
565
575
|
watch: {
|
|
@@ -572,16 +582,21 @@ var GooglePayMixin = {
|
|
|
572
582
|
created: function created() {
|
|
573
583
|
this.mountElement("#".concat(this.mountId));
|
|
574
584
|
},
|
|
585
|
+
// in vue 2 beforeDestroy is emitted but not in vue 3
|
|
575
586
|
beforeDestroy: function beforeDestroy() {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
587
|
+
this.destroyElement();
|
|
588
|
+
},
|
|
589
|
+
// in vue 3 beforeDestroy hook is replaced with beforeUnmount,
|
|
590
|
+
// we should keep both of them for compatibility purpose
|
|
591
|
+
beforeUnmount: function beforeUnmount() {
|
|
592
|
+
this.destroyElement();
|
|
579
593
|
}
|
|
580
594
|
};
|
|
581
595
|
|
|
582
596
|
var NonIframeElementMixin = {
|
|
583
|
-
render: function render(
|
|
584
|
-
return
|
|
597
|
+
render: function render() {
|
|
598
|
+
return h('div', {
|
|
599
|
+
id: this.mountId,
|
|
585
600
|
domProps: {
|
|
586
601
|
id: this.mountId
|
|
587
602
|
}
|
|
@@ -613,7 +628,7 @@ var NonIframeElementMixin = {
|
|
|
613
628
|
namespace = Rebilly.paypal;
|
|
614
629
|
}
|
|
615
630
|
|
|
616
|
-
_this.element = namespace.mount(selector);
|
|
631
|
+
_this.element = markRaw(namespace.mount(selector));
|
|
617
632
|
Rebilly.on('token-ready', function (token) {
|
|
618
633
|
// https://github.com/vuejs/vue/issues/4332#issuecomment-263444492
|
|
619
634
|
// Emit token on the element level:
|
|
@@ -628,6 +643,11 @@ var NonIframeElementMixin = {
|
|
|
628
643
|
});
|
|
629
644
|
}
|
|
630
645
|
});
|
|
646
|
+
},
|
|
647
|
+
destroyElement: function destroyElement() {
|
|
648
|
+
if (this.element) {
|
|
649
|
+
this.element.destroy();
|
|
650
|
+
}
|
|
631
651
|
}
|
|
632
652
|
},
|
|
633
653
|
watch: {
|
|
@@ -640,10 +660,14 @@ var NonIframeElementMixin = {
|
|
|
640
660
|
created: function created() {
|
|
641
661
|
this.mountElement("#".concat(this.mountId));
|
|
642
662
|
},
|
|
663
|
+
// in vue 2 beforeDestroy is emitted but not in vue 3
|
|
643
664
|
beforeDestroy: function beforeDestroy() {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
665
|
+
this.destroyElement();
|
|
666
|
+
},
|
|
667
|
+
// in vue 3 beforeDestroy hook is replaced with beforeUnmount,
|
|
668
|
+
// we should keep both of them for compatibility purpose
|
|
669
|
+
beforeUnmount: function beforeUnmount() {
|
|
670
|
+
this.destroyElement();
|
|
647
671
|
}
|
|
648
672
|
};
|
|
649
673
|
|
|
@@ -755,5 +779,4 @@ var FramePay = {
|
|
|
755
779
|
}
|
|
756
780
|
};
|
|
757
781
|
|
|
758
|
-
export default
|
|
759
|
-
export { RebillyApplePay, RebillyBbanAccountNumber, RebillyBbanAccountType, RebillyBbanRoutingNumber, RebillyCard, RebillyCardCvv, RebillyCardExpiration, RebillyCardNumber, FIELD_TYPES as RebillyFieldTypes, __vue_component__ as RebillyForm, RebillyGooglePay, RebillyIban, RebillyPaypal, __vue_component__$1 as RebillyToken, createToken, updateConfig };
|
|
782
|
+
export { RebillyApplePay, RebillyBbanAccountNumber, RebillyBbanAccountType, RebillyBbanRoutingNumber, RebillyCard, RebillyCardCvv, RebillyCardExpiration, RebillyCardNumber, FIELD_TYPES as RebillyFieldTypes, __vue_component__$1 as RebillyForm, RebillyGooglePay, RebillyIban, RebillyPaypal, __vue_component__ as RebillyToken, createToken, FramePay as default, updateConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebilly/framepay-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Official Vue wrapper for Rebilly FramePay",
|
|
5
5
|
"author": "Rebilly",
|
|
6
6
|
"repository": "https://github.com/Rebilly/framepay-vue",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@testing-library/cypress": "^7.0.2",
|
|
40
|
-
"@vue/cli-plugin-babel": "^4.5.
|
|
41
|
-
"@vue/cli-plugin-eslint": "^4.5.
|
|
42
|
-
"@vue/cli-plugin-unit-jest": "^4.5.
|
|
43
|
-
"@vue/cli-service": "^4.5.
|
|
40
|
+
"@vue/cli-plugin-babel": "^4.5.19",
|
|
41
|
+
"@vue/cli-plugin-eslint": "^4.5.19",
|
|
42
|
+
"@vue/cli-plugin-unit-jest": "^4.5.19",
|
|
43
|
+
"@vue/cli-service": "^4.5.19",
|
|
44
44
|
"@vue/eslint-config-airbnb": "^5.1.0",
|
|
45
45
|
"@vue/test-utils": "^1.1.1",
|
|
46
46
|
"babel-core": "7.0.0-bridge.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"rollup-plugin-babel": "^4.3.2",
|
|
57
57
|
"rollup-plugin-commonjs": "^10.0.0",
|
|
58
58
|
"rollup-plugin-vue": "^5.1.9",
|
|
59
|
-
"vue": "^2.
|
|
60
|
-
"vue-template-compiler": "^2.
|
|
59
|
+
"vue": "^2.7.10",
|
|
60
|
+
"vue-template-compiler": "^2.7.10"
|
|
61
61
|
},
|
|
62
62
|
"eslintConfig": {
|
|
63
63
|
"root": true,
|