@rebilly/framepay-vue 1.1.9 → 1.2.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.
Files changed (2) hide show
  1. package/dist/build.js +61 -1
  2. package/package.json +2 -2
package/dist/build.js CHANGED
@@ -592,6 +592,66 @@ var DigitalWalletMixin = {
592
592
  }
593
593
  };
594
594
 
595
+ var ApplePayMixin = {
596
+ render: function render(createElement) {
597
+ return createElement('div', {
598
+ domProps: {
599
+ id: this.mountId
600
+ }
601
+ });
602
+ },
603
+ props: {
604
+ id: {
605
+ type: String
606
+ },
607
+ configuration: {}
608
+ },
609
+ data: function data() {
610
+ return {
611
+ element: null,
612
+ mountId: this.id ? this.id : "".concat(this.$options.name, "-mount")
613
+ };
614
+ },
615
+ methods: {
616
+ mountElement: function mountElement(selector) {
617
+ var _this = this;
618
+
619
+ initializeRebilly(this.configuration).then(function (Rebilly) {
620
+ try {
621
+ _this.element = Rebilly.applePay.mount(selector);
622
+ Rebilly.on('token-ready', function (token) {
623
+ // https://github.com/vuejs/vue/issues/4332#issuecomment-263444492
624
+ // Emit token on the element level:
625
+ _this.$emit('token-ready', token); // Emit token on the RebillyForm level:
626
+
627
+
628
+ _this.$parent.$emit('token-ready', token);
629
+ });
630
+ } catch (e) {
631
+ throw new MountError({
632
+ details: e
633
+ });
634
+ }
635
+ });
636
+ }
637
+ },
638
+ watch: {
639
+ configuration: function configuration(value) {
640
+ if (value) {
641
+ updateConfig(value);
642
+ }
643
+ }
644
+ },
645
+ created: function created() {
646
+ this.mountElement("#".concat(this.mountId));
647
+ },
648
+ beforeDestroy: function beforeDestroy() {
649
+ if (this.element) {
650
+ this.element.destroy();
651
+ }
652
+ }
653
+ };
654
+
595
655
  var RebillyCard = {
596
656
  name: 'rebilly-card',
597
657
  data: function data() {
@@ -680,7 +740,7 @@ var RebillyApplePay = {
680
740
  elementType: FIELD_TYPES.REBILLY_APPLE_PAY
681
741
  };
682
742
  },
683
- mixins: [DigitalWalletMixin]
743
+ mixins: [ApplePayMixin]
684
744
  };
685
745
 
686
746
  var FramePay = {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-vue",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "description": "Official Vue wrapper for Rebilly FramePay",
5
- "author": "Mathew Sonke <mathew.sonke@rebilly.com>",
5
+ "author": "Rebilly",
6
6
  "repository": "https://github.com/Rebilly/framepay-vue",
7
7
  "license": "MIT",
8
8
  "main": "dist/build.js",