@paystack/inline-js 2.13.0-dev.2 → 2.13.0-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.
package/dist/inline.js CHANGED
@@ -753,15 +753,20 @@ var PaystackPop = (function () {
753
753
  }
754
754
 
755
755
  loadScript('https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js', container).then(function () {
756
- mountApplePayButton(container, {
757
- styles: parseApplePayCustomStyles(styles.applePay),
758
- theme: styles.theme
759
- });
760
- mountedElements.applePay = true;
761
- resolve(mountedElements);
756
+ try {
757
+ mountApplePayButton(container, {
758
+ styles: parseApplePayCustomStyles(styles.applePay),
759
+ theme: styles.theme
760
+ });
761
+ mountedElements.applePay = true;
762
+ resolve(mountedElements);
763
+ } catch (error) {
764
+ throw new Error(error);
765
+ }
762
766
  }).catch(function () {
763
- // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
767
+ console.log('failed to load apple sdk'); // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
764
768
  // so custom styled apple pay button is mounted instead. See documentation here https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css
769
+
765
770
  mountApplePayFallbackButton(container, {
766
771
  styles: parseApplePayCustomStyles(styles.applePay),
767
772
  theme: styles.theme
package/es/inline.js CHANGED
@@ -750,15 +750,20 @@ function mountPaymentRequestButtons(container, _ref3) {
750
750
  }
751
751
 
752
752
  loadScript('https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js', container).then(function () {
753
- mountApplePayButton(container, {
754
- styles: parseApplePayCustomStyles(styles.applePay),
755
- theme: styles.theme
756
- });
757
- mountedElements.applePay = true;
758
- resolve(mountedElements);
753
+ try {
754
+ mountApplePayButton(container, {
755
+ styles: parseApplePayCustomStyles(styles.applePay),
756
+ theme: styles.theme
757
+ });
758
+ mountedElements.applePay = true;
759
+ resolve(mountedElements);
760
+ } catch (error) {
761
+ throw new Error(error);
762
+ }
759
763
  }).catch(function () {
760
- // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
764
+ console.log('failed to load apple sdk'); // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
761
765
  // so custom styled apple pay button is mounted instead. See documentation here https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css
766
+
762
767
  mountApplePayFallbackButton(container, {
763
768
  styles: parseApplePayCustomStyles(styles.applePay),
764
769
  theme: styles.theme
package/lib/inline.js CHANGED
@@ -752,15 +752,20 @@ function mountPaymentRequestButtons(container, _ref3) {
752
752
  }
753
753
 
754
754
  loadScript('https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js', container).then(function () {
755
- mountApplePayButton(container, {
756
- styles: parseApplePayCustomStyles(styles.applePay),
757
- theme: styles.theme
758
- });
759
- mountedElements.applePay = true;
760
- resolve(mountedElements);
755
+ try {
756
+ mountApplePayButton(container, {
757
+ styles: parseApplePayCustomStyles(styles.applePay),
758
+ theme: styles.theme
759
+ });
760
+ mountedElements.applePay = true;
761
+ resolve(mountedElements);
762
+ } catch (error) {
763
+ throw new Error(error);
764
+ }
761
765
  }).catch(function () {
762
- // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
766
+ console.log('failed to load apple sdk'); // if the loading of the apple pay SDK fails, that means using the apple-pay-button web component won't work
763
767
  // so custom styled apple pay button is mounted instead. See documentation here https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css
768
+
764
769
  mountApplePayFallbackButton(container, {
765
770
  styles: parseApplePayCustomStyles(styles.applePay),
766
771
  theme: styles.theme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/inline-js",
3
- "version": "2.13.0-dev.2",
3
+ "version": "2.13.0-dev.3",
4
4
  "description": "Client-side library to load the Paystack checkout form",
5
5
  "main": "lib/inline.js",
6
6
  "module": "es/inline.js",