WooCommerce PayPal Powered by Braintree Payment Gateway - Version 2.6.0

Version Description

Download this release

Release Info

Developer SkyVerge
Plugin Icon 128x128 WooCommerce PayPal Powered by Braintree Payment Gateway
Version 2.6.0
Comparing to
See all releases

Code changes from version 2.5.0 to 2.6.0

Files changed (145) hide show
  1. assets/js/frontend/wc-braintree-apple-pay.min.js +1 -1
  2. assets/js/frontend/wc-braintree.min.js +1 -1
  3. class-wc-braintree.php +3 -3
  4. i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot +4 -4
  5. includes/PayPal/Buttons/Abstract_Button.php +1 -1
  6. includes/PayPal/Buttons/Cart.php +1 -1
  7. includes/PayPal/Buttons/Product.php +1 -1
  8. includes/api/class-wc-braintree-api-response-message-helper.php +1 -1
  9. includes/api/class-wc-braintree-api.php +1 -1
  10. includes/api/requests/abstract-wc-braintree-api-request.php +1 -1
  11. includes/api/requests/class-wc-braintree-api-customer-request.php +1 -1
  12. includes/api/requests/class-wc-braintree-api-transaction-request.php +1 -1
  13. includes/api/responses/abstract-wc-braintree-api-response.php +1 -1
  14. includes/api/responses/abstract-wc-braintree-api-transaction-response.php +1 -1
  15. includes/api/responses/abstract-wc-braintree-api-vault-response.php +1 -1
  16. includes/api/responses/class-wc-braintree-api-client-token-response.php +1 -1
  17. includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php +1 -1
  18. includes/api/responses/class-wc-braintree-api-customer-response.php +1 -1
  19. includes/api/responses/class-wc-braintree-api-merchant-configuration-response.php +1 -1
  20. includes/api/responses/class-wc-braintree-api-payment-method-response.php +1 -1
  21. includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php +1 -1
  22. includes/apple-pay/api/class-wc-braintree-apple-pay-api-payment-response.php +1 -1
  23. includes/apple-pay/class-wc-braintree-apple-pay-frontend.php +1 -1
  24. includes/apple-pay/class-wc-braintree-apple-pay.php +1 -1
  25. includes/class-wc-braintree-capture.php +1 -1
  26. includes/class-wc-braintree-frontend.php +1 -1
  27. includes/class-wc-braintree-lifecycle.php +1 -1
  28. includes/class-wc-braintree-payment-method-handler.php +1 -1
  29. includes/class-wc-braintree-payment-method.php +1 -1
  30. includes/class-wc-gateway-braintree-credit-card.php +1 -1
  31. includes/class-wc-gateway-braintree-paypal.php +1 -1
  32. includes/class-wc-gateway-braintree.php +1 -1
  33. includes/integrations/Pre_Orders.php +1 -1
  34. includes/integrations/Product_Addons.php +1 -1
  35. includes/payment-forms/abstract-wc-braintree-payment-form.php +1 -1
  36. includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php +2 -2
  37. includes/payment-forms/class-wc-braintree-paypal-payment-form.php +35 -10
  38. readme.txt +6 -2
  39. vendor/autoload.php +1 -1
  40. vendor/composer/ClassLoader.php +36 -2
  41. vendor/composer/InstalledVersions.php +301 -0
  42. vendor/composer/autoload_classmap.php +1 -0
  43. vendor/composer/autoload_real.php +8 -6
  44. vendor/composer/autoload_static.php +9 -4
  45. vendor/composer/installed.json +85 -79
  46. vendor/composer/installed.php +42 -0
  47. vendor/composer/platform_check.php +26 -0
  48. vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php +2 -2
  49. vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php +2 -2
  50. vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php +2 -2
  51. vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php +5 -5
  52. vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php +6 -6
  53. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php +3 -3
  54. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php +3 -3
  55. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php +3 -3
  56. vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php +2 -2
  57. vendor/skyverge/wc-plugin-framework/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php +3 -3
  58. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php +2 -2
  59. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php +2 -2
  60. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php +2 -2
  61. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php +2 -2
  62. vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php +2 -2
  63. vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php +2 -2
  64. vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php +2 -2
  65. vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php +2 -2
  66. vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt +6 -0
  67. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php +2 -2
  68. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php +21 -5
  69. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php +2 -2
  70. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php +2 -2
  71. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php +2 -2
  72. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php +2 -2
  73. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php +3 -3
  74. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php +2 -2
  75. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php +2 -2
  76. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php +2 -2
  77. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php +2 -2
  78. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php +2 -2
  79. vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po +1 -1
  80. vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot +2 -2
  81. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php +2 -2
  82. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php +3 -3
  83. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php +7 -7
  84. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php +4 -4
  85. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php +4 -4
  86. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php +6 -6
  87. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php +8 -8
  88. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Orders.php +2 -2
  89. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php +2 -2
  90. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php +2 -2
  91. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php +3 -3
  92. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php +2 -2
  93. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php +3 -3
  94. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php +2 -2
  95. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php +5 -5
  96. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php +4 -4
  97. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php +3 -3
  98. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php +3 -3
  99. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php +3 -3
  100. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php +3 -3
  101. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php +2 -2
  102. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php +2 -2
  103. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php +2 -2
  104. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php +2 -2
  105. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php +2 -2
  106. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php +2 -2
  107. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php +2 -2
  108. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php +2 -2
  109. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php +2 -2
  110. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php +2 -2
  111. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php +2 -2
  112. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php +2 -2
  113. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php +2 -2
  114. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php +2 -2
  115. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php +2 -2
  116. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js +1 -1
  117. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map +1 -1
  118. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js +1 -1
  119. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map +1 -1
  120. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js +1 -1
  121. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map +1 -1
  122. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js +1 -1
  123. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map +1 -1
  124. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js +3 -3
  125. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +2 -2
  126. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php +2 -2
  127. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php +2 -2
  128. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php +4 -4
  129. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php +3 -3
  130. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php +6 -6
  131. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php +2 -2
  132. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +3 -3
  133. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php +2 -2
  134. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php +2 -2
  135. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php +2 -2
  136. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +2 -2
  137. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php +2 -2
  138. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php +2 -2
  139. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php +5 -5
  140. vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/Controllers/Settings.php +4 -4
  141. vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php +2 -2
  142. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php +2 -2
  143. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php +2 -2
  144. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php +2 -2
  145. woocommerce-gateway-paypal-powered-by-braintree.php +3 -3
assets/js/frontend/wc-braintree-apple-pay.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var _createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),_get=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)};function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(function(){function i(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}jQuery(document).ready(function(t){var r;function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.on_validate_merchant=t.on_validate_merchant.bind(t),t.process_authorization=t.process_authorization.bind(t),t.store_name=e.store_name,t.client_token_nonce=e.client_token_nonce,t}return r=window.WC_Braintree_Apple_Pay_Handler=(_inherits(o,SV_WC_Apple_Pay_Handler_v5_10_5),_createClass(o,[{key:"is_available",value:function(){return window.ApplePaySession&&ApplePaySession.canMakePayments()}},{key:"init",value:function(){if(this.is_available())return this.instance?_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"init",this).call(this):this.create_client()}},{key:"create_client",value:function(){var t=this;return this.get_client_token().done(function(e){if(e.success)return braintree.client.create({authorization:e.data}).then(function(e){return t.client=e,t.create_instance()}).catch(function(e){return console.error("Could not create Braintree client"),console.error(e)})}).fail(function(e,t,n){return console.error("Could not retrieve the client token via AJAX: "+n)})}},{key:"get_client_token",value:function(){var e={action:"wc_"+this.gateway_id+"_get_client_token",nonce:this.client_token_nonce};return t.post(this.ajax_url,e)}},{key:"create_instance",value:function(){var t=this;return braintree.applePay.create({client:this.client}).then(function(e){return t.instance=e,ApplePaySession.canMakePaymentsWithActiveCard(e.merchantIdentifier).then(function(e){if(e)return t.init()})}).catch(function(e){return console.error("Could not create Braintree Apple Pay instance. "+e.message),console.error(e)})}},{key:"get_new_session",value:function(e){e=this.instance.createPaymentRequest(e);return _get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"get_new_session",this).call(this,e)}},{key:"on_validate_merchant",value:function(e){var t=this;return i(this,r),this.instance.performValidation({validationURL:e.validationURL,displayName:this.store_name}).then(function(e){return t.session.completeMerchantValidation(e)}).catch(function(e){return t.session.abort(),t.fail_payment("Merchant could not be validated. "+e.message)})}},{key:"process_authorization",value:function(t){var n=this;return i(this,r),this.instance.tokenize({token:t.token}).then(function(e){return t.braintree_nonce=e.nonce,_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"process_authorization",n).call(n,t)}).catch(function(e){return n.set_payment_status(!1),n.fail_payment("Payment could not be processed. "+e)})}}]),o),t(document.body).trigger("wc_braintree_apple_pay_handler_loaded")})}).call(void 0);
1
+ "use strict";var _createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),_get=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)};function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(function(){function i(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}jQuery(document).ready(function(t){var r;function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.on_validate_merchant=t.on_validate_merchant.bind(t),t.process_authorization=t.process_authorization.bind(t),t.store_name=e.store_name,t.client_token_nonce=e.client_token_nonce,t}return r=window.WC_Braintree_Apple_Pay_Handler=(_inherits(o,SV_WC_Apple_Pay_Handler_v5_10_7),_createClass(o,[{key:"is_available",value:function(){return window.ApplePaySession&&ApplePaySession.canMakePayments()}},{key:"init",value:function(){if(this.is_available())return this.instance?_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"init",this).call(this):this.create_client()}},{key:"create_client",value:function(){var t=this;return this.get_client_token().done(function(e){if(e.success)return braintree.client.create({authorization:e.data}).then(function(e){return t.client=e,t.create_instance()}).catch(function(e){return console.error("Could not create Braintree client"),console.error(e)})}).fail(function(e,t,n){return console.error("Could not retrieve the client token via AJAX: "+n)})}},{key:"get_client_token",value:function(){var e={action:"wc_"+this.gateway_id+"_get_client_token",nonce:this.client_token_nonce};return t.post(this.ajax_url,e)}},{key:"create_instance",value:function(){var t=this;return braintree.applePay.create({client:this.client}).then(function(e){return t.instance=e,ApplePaySession.canMakePaymentsWithActiveCard(e.merchantIdentifier).then(function(e){if(e)return t.init()})}).catch(function(e){return console.error("Could not create Braintree Apple Pay instance. "+e.message),console.error(e)})}},{key:"get_new_session",value:function(e){e=this.instance.createPaymentRequest(e);return _get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"get_new_session",this).call(this,e)}},{key:"on_validate_merchant",value:function(e){var t=this;return i(this,r),this.instance.performValidation({validationURL:e.validationURL,displayName:this.store_name}).then(function(e){return t.session.completeMerchantValidation(e)}).catch(function(e){return t.session.abort(),t.fail_payment("Merchant could not be validated. "+e.message)})}},{key:"process_authorization",value:function(t){var n=this;return i(this,r),this.instance.tokenize({token:t.token}).then(function(e){return t.braintree_nonce=e.nonce,_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"process_authorization",n).call(n,t)}).catch(function(e){return n.set_payment_status(!1),n.fail_payment("Payment could not be processed. "+e)})}}]),o),t(document.body).trigger("wc_braintree_apple_pay_handler_loaded")})}).call(void 0);
assets/js/frontend/wc-braintree.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var _get=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)},_createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){function u(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}var c=[].indexOf;jQuery(document).ready(function(s){var e,n,i;function t(e){_classCallCheck(this,t),this.show_integration_ui=this.show_integration_ui.bind(this),this.hide_integration_ui=this.hide_integration_ui.bind(this),this.id=e.id,this.id_dasherized=e.id_dasherized,this.name=e.name,this.type=e.type,this.debug=e.debug,this.client_token_nonce=e.client_token_nonce,this.ajax_url=e.ajax_url,this.integration_error_message=e.integration_error_message,this.payment_error_message=e.payment_error_message,this.params=window.sv_wc_payment_gateway_payment_form_params}function a(e){_classCallCheck(this,a);var t=_possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e));return t.show_integration_ui=t.show_integration_ui.bind(t),t.hide_integration_ui=t.hide_integration_ui.bind(t),t.csc_required=e.csc_required,t.hosted_fields_styles=e.hosted_fields_styles,t.threeds=e.threeds,t.enabled_card_types=e.enabled_card_types,t.init(),t}function r(e){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.on_approve=t.on_approve.bind(t),t.get_linked_account_html=t.get_linked_account_html.bind(t),t.is_test_environment=e.is_test_environment,t.is_paypal_pay_later_enabled=e.is_paypal_pay_later_enabled,t.is_paypal_card_enabled=e.is_paypal_card_enabled,t.force_buyer_country=e.force_buyer_country,t.must_login_message=e.must_login_message,t.must_login_add_method_message=e.must_login_add_method_message,t.button_styles=e.button_styles,t.cart_payment_nonce=e.cart_payment_nonce,t.paypal_intent=e.paypal_intent,t.init(),t}function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.is_paypal_card_enabled=!1,t.set_payment_method_nonce=e.set_payment_method_nonce,t.cart_handler_url=e.cart_handler_url,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}function _(e){_classCallCheck(this,_);var t=_possibleConstructorReturn(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.validate_product_button=t.validate_product_button.bind(t),t.validate_product_data=t.validate_product_data.bind(t),t.is_paypal_card_enabled=!1,t.product_checkout_nonce=e.product_checkout_nonce,t.product_checkout_url=e.product_checkout_url,t.is_product_page=e.is_product_page,t.validate_product_url=e.validate_product_url,t.validate_product_nonce=e.validate_product_nonce,t.should_validate_product_data=e.should_validate_product_data,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.is_product_page&&t.handle_product_page(),t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}return window.WC_Braintree_Payment_Form_Handler=(_createClass(t,[{key:"init",value:function(){return this.is_sdk_ready()?s("form.checkout").length?this.handle_checkout_page():s("form#order_review").length?this.handle_pay_page():s("form#add_payment_method").length?this.handle_add_payment_method_page():void 0:console.error("Braintree SDK is missing.")}},{key:"handle_checkout_page",value:function(){var e=this;return this.form=s("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",s(document.body).on("updated_checkout",function(){if(!e.setting_up)return s('iframe[name^="braintree-"]').remove(),e.setup_braintree()}),s(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),s(document.body).on("checkout_error",function(){return e.handle_checkout_error()}),this.form.on("checkout_place_order_"+this.id,function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_checkout_error",value:function(){return this.unblock_ui()}},{key:"handle_pay_page",value:function(){var e=this;return this.form=s("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.form=s("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"verify_form",value:function(){return!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0}},{key:"submit_form",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var n=this,e=s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form");if(s("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(){return s("input.js-wc-"+n.id_dasherized+"-payment-token:checked").val()?e.slideUp(200):e.slideDown(200)}).change(),s("input#createaccount").change(function(e){var t=s("input.js-wc-"+n.id_dasherized+"-tokenize-payment-method").closest("p.form-row");return s(e.target).is(":checked")?(t.slideDown(),t.next().show()):(t.hide(),t.next().hide())}),!s("input#createaccount").is(":checked"))return s("input#createaccount").change()}},{key:"setup_braintree",value:function(){if(!s("#wc-"+this.id_dasherized+"-account-number-hosted iframe").data("ready"))return this.setting_up=!0,this.block_ui(),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.create_client()}},{key:"create_client",value:function(){var r=this;return this.log("Creating client."),this.get_client_token().done(function(e){return e.success?braintree.client.create({authorization:e.data}).then(function(e){return r.client=e,r.log("Client ready."),r.setup_integration()}).catch(function(e){return r.handle_integration_error(e),r.unblock_ui()}):r.handle_integration_error(e.data)}).fail(function(e,t,n){return r.handle_integration_error({message:"Could not retrieve the client token via AJAX: "+n}),r.unblock_ui()})}},{key:"get_client_token",value:function(){this.id;var e={action:"wc_"+this.id+"_get_client_token",nonce:this.client_token_nonce};return s.post(this.ajax_url,e)}},{key:"setup_integration",value:function(){var t=this;return this.log("Creating integration."),this.get_integration_class().create(this.get_integration_options()).then(function(e){return t.integration=e,t.show_integration_ui(),s("#wc-"+t.id_dasherized+"-account-number-hosted iframe").data("ready",!0),t.do_integration_ready(),s(document).trigger("wc_"+t.id+"_integration_ready",t.integration),t.log("Integration ready."),t.setting_up=!1}).catch(function(e){return t.handle_integration_error(e),t.unblock_ui(),t.setting_up=!1})}},{key:"refresh_braintree",value:function(){var e=this;if(null!=this.integration&&!this.refreshing&&!this.setting_up)return this.log("Refreshing integration."),this.refreshing=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.refreshing=!1,e.setup_braintree()})}},{key:"teardown_braintree",value:function(){var e=this;if(null!=this.integration&&!this.tearing_down&&!this.setting_up)return this.log("Tearing down integration."),this.tearing_down=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.tearing_down=!1,e.unblock_ui()})}},{key:"do_integration_ready",value:function(){}},{key:"get_integration_options",value:function(){return{client:this.client}}},{key:"get_integration_class",value:function(){}},{key:"handle_integration_error",value:function(e){return this.log("Integration error. "+e.message,e,"error"),this.hide_integration_ui(),this.unblock_ui()}},{key:"handle_payment_error",value:function(e){return this.log("Payment error. "+e.message,e,"error"),this.render_error(this.get_user_message(e)),this.unblock_ui()}},{key:"render_error",value:function(e){return s(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+e+"</div>").removeClass("processing").unblock(),s("html, body").animate({scrollTop:this.form.offset().top-100},1e3),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),s(document.body).trigger("checkout_error"),this.unblock_ui()}},{key:"get_user_message",value:function(){return this.payment_error_message}},{key:"show_integration_ui",value:function(){if(s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".woocommerce-error").remove(),s("input#createaccount").length&&s("input#createaccount").is(":checked"))return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").show()}},{key:"hide_integration_ui",value:function(){return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").prepend('<div class="woocommerce-error">'+this.integration_error_message+"</div>"),s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").hide()}},{key:"block_ui",value:function(){return s(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return s(this.form_ui_selector).unblock()}},{key:"is_selected",value:function(){return this.get_selected_gateway_id()===this.id}},{key:"is_sdk_ready",value:function(){return"undefined"!=typeof braintree&&null!==braintree&&null!=braintree.client&&null!=this.get_integration_class()}},{key:"has_payment_nonce",value:function(){return this.form.find("input[name=wc_"+this.id+"_payment_nonce]").val()}},{key:"using_payment_token",value:function(){return this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()}},{key:"get_selected_gateway_id",value:function(){return this.form.find("input[name=payment_method]:checked").val()}},{key:"log",value:function(e,t){t=1<arguments.length&&void 0!==t?t:null;if(this.debug)return console.log(this.name+": "+e),t?console.log(t):void 0}}]),t),s(document.body).trigger("wc_braintree_payment_form_handler_loaded"),e=window.WC_Braintree_Credit_Card_Payment_Form_Handler=(_inherits(a,WC_Braintree_Payment_Form_Handler),_createClass(a,[{key:"handle_checkout_error",value:function(){return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_checkout_error",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),s("input[name=wc-"+this.id_dasherized+"-card-type]").val(""),s("input[name=wc-"+this.id_dasherized+"-3d-secure-verified]").val(0)}},{key:"verify_form",value:function(){var e;return this.has_payment_nonce()||!this.csc_required&&this.using_payment_token()?(e=s("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(e)?(this.verify_3d_secure(e.data("nonce"),null,e),!1):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"verify_form",this).call(this)):(this.tokenize_payment(),!1)}},{key:"tokenize_payment",value:function(){var t=this;return this.integration.tokenize().then(function(e){if(t.log("Payment method received.",e),null!=e.nonce&&null!=e.details&&null!=e.details.bin)return t.should_verify_3d_secure(e)?t.verify_3d_secure(e.nonce,e.details.bin):t.submit_form(e.nonce)}).catch(function(e){return t.handle_payment_error(e)})}},{key:"get_integration_options",value:function(){var e={client:this.client,fields:{number:{selector:"#wc-braintree-credit-card-account-number-hosted",placeholder:s("#wc-braintree-credit-card-account-number-hosted").data("placeholder")},cvv:{selector:"#wc-braintree-credit-card-csc-hosted",placeholder:s("#wc-braintree-credit-card-csc-hosted").data("placeholder")},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted",placeholder:s("#wc-braintree-credit-card-expiry-hosted").data("placeholder")}},styles:this.hosted_fields_styles};return this.csc_required&&this.using_payment_token()&&(delete e.fields.number,delete e.fields.expirationDate),this.csc_required||delete e.fields.cvv,e}},{key:"get_integration_class",value:function(){return braintree.hostedFields}},{key:"do_integration_ready",value:function(){var t=this;return this.integration.on("cardTypeChange",function(e){return t.on_card_type_change(e)}),!this.csc_required&&s("input.js-wc-braintree-credit-card-payment-token:checked").val()&&this.teardown_braintree(),this.unblock_ui()}},{key:"handle_saved_payment_methods",value:function(){var e,t,n=this;return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_saved_payment_methods",this).call(this),t=s("div.js-wc-braintree-credit-card-new-payment-method-form"),e=s("div.wc-braintree-hosted-field-card-csc-parent"),s("input.js-wc-braintree-credit-card-payment-token").change(function(){return s("input.js-wc-braintree-credit-card-payment-token:checked").val()?n.csc_required&&e.hasClass("form-row-last")?(e.removeClass("form-row-last").addClass("form-row-first"),t.after(e),n.refresh_braintree()):void 0:(n.csc_required&&e.hasClass("form-row-first")&&(e.removeClass("form-row-first").addClass("form-row-last"),t.find("div.wc-braintree-hosted-field-card-expiry-parent").after(e)),n.refresh_braintree())}).change()}},{key:"get_user_message",value:function(e){var t,n,r,i=[];if("CUSTOMER"===e.type)switch(e.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&i.push(this.params.cvv_missing),this.using_payment_token()||(i.push(this.params.card_number_missing),i.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=e.details)for(t=0,n=(r=e.details.invalidFieldKeys).length;t<n;t++)switch(r[t]){case"number":i.push(this.params.card_number_invalid);break;case"cvv":i.push(this.params.cvv_length_invalid);break;case"expirationDate":i.push(this.params.card_exp_date_invalid)}}else"NETWORK"===e.type&&null!=e.details.originalError.error.message&&(e=e.details.originalError.error.message,/given name format is invalid/.test(e)&&i.push(this.params.first_name_unsupported_characters),/surname format is invalid/.test(e)&&i.push(this.params.last_name_unsupported_characters));return i.length?i.join("<br/>"):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"get_user_message",this).call(this)}},{key:"on_card_type_change",value:function(e){var t,n;if(null!=e.cards)return(t=s("#wc-braintree-credit-card-account-number-hosted")).attr("class",function(e,t){return t.replace(/(^|\s)card-type-\S+/g,"")}),e.cards.length?1===e.cards.length?(n=e.cards[0],s("input[name=wc-"+this.id_dasherized+"-card-type]").val(n.type),null!=n.type&&(e=n.type,0<=c.call(this.enabled_card_types,e))?t.addClass("card-type-"+n.type):t.addClass("card-type-invalid")):void 0:t.addClass("card-type-invalid")}},{key:"is_3d_secure_enabled",value:function(){return this.threeds.enabled&&null!=braintree.threeDSecure}},{key:"setup_integration",value:function(){var t=this;return this.threeds.enabled&&(this.threeds.enabled=this.client.getConfiguration().gatewayConfiguration.threeDSecureEnabled),this.is_3d_secure_enabled()?(s("input[name=wc-"+this.id_dasherized+"-3d-secure-enabled]").val(1),this.threeDSecure&&this.threeDSecure.teardown(),braintree.threeDSecure.create({version:2,client:this.client}).then(function(e){return t.threeDSecure=e,s(document.body).on("click","#wc-braintree-credit-card-3dsecure-container",function(e){return s(e.currentTarget).fadeOut(200),t.threeDSecure.cancelVerifyCard(),t.unblock_ui()}),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",t).call(t)}).catch(function(e){return t.handle_integration_error(e)})):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",this).call(this)}},{key:"should_verify_3d_secure",value:function(e){var t=e.details.cardType;return this.is_3d_secure_enabled()&&"CreditCard"===e.type&&0<=c.call(this.threeds.card_types,t)}},{key:"should_verify_3d_secure_token",value:function(e){if(this.is_3d_secure_enabled()&&e.val()&&e.data("nonce")&&!e.data("verified"))return!0}},{key:"verify_3d_secure",value:function(e,t,n){var r=this,i=2<arguments.length&&void 0!==n?n:null,a=s("#billing_state").val(),o=s("#billing_country").val(),_=s("#shipping_state").val(),n=s("#shipping_country").val(),o=s("input[name=billing_first_name]").val()?{givenName:s("input[name=billing_first_name]").val().latinise(),surname:s("input[name=billing_last_name]").val().latinise(),phoneNumber:s("input[name=billing_phone]").val(),streetAddress:s("input[name=billing_address_1]").val(),extendedAddress:s("input[name=billing_address_2]").val(),locality:s("#billing_city").val(),region:"string"==typeof a&&a.length<=2?a:"",postalCode:s("input[name=billing_postcode]").val(),countryCodeAlpha2:"string"==typeof o&&o.length<=2?o:""}:{},n=s("input[name=shipping_first_name]").val()?{shippingGivenName:s("input[name=shipping_first_name]").val().latinise(),shippingSurname:s("input[name=shipping_last_name]").val().latinise(),shippingAddress:{streetAddress:s("input[name=shipping_address_1]").val(),extendedAddress:s("input[name=shipping_address_2]").val(),locality:s("input[name=shipping_city]").val(),region:"string"==typeof _&&_.length<=2?_:"",postalCode:s("input[name=shipping_postcode]").val(),countryCodeAlpha2:"string"==typeof n&&n.length<=2?n:""}}:{},n={nonce:e,amount:s("input[name=wc-"+this.id_dasherized+"-3d-secure-order-total]").val(),email:s("input[name=billing_email]").val(),billingAddress:o,additionalInformation:n,onLookupComplete:function(e,t){r.log("3D Secure lookup complete.",e);try{return t()}catch(e){return r.handle_payment_error(e)}}};return"1"===s("input[name=wc-"+this.id_dasherized+"-cart-contains-subscription]").val()&&(n.challengeRequested=!0),this.log("Verifying 3D Secure.",n),this.threeDSecure.verifyCard(n).then(function(e){return r.log("3D Secure response received.",e),r.threeds.liability_shift_always_required&&!e.liabilityShifted?r.render_error(r.threeds.failure_message):(null!=i&&i.data("verified",!0),s("input[name=wc-"+r.id_dasherized+"-3d-secure-verified]").val(1),r.submit_form(e.nonce))}).catch(function(e){return r.handle_payment_error(e)})}},{key:"show_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"show_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").show()}},{key:"hide_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"hide_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").hide()}}]),a),s(document.body).trigger("wc_braintree_credit_card_payment_form_handler_loaded"),n=window.WC_Braintree_PayPal_Payment_Form_Handler=(_inherits(r,WC_Braintree_Payment_Form_Handler),_createClass(r,[{key:"init",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"init",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(this.cart_payment_nonce),s(document.body).on("click",'input[name="payment_method"], input.js-wc-braintree-paypal-payment-token',function(){return t.toggle_order_button()}),s(document.body).on("payment_method_selected",function(){return t.toggle_order_button()}),s(document.body).on("click",".wc-braintree-paypal-account .cancel",function(e){return e.preventDefault(),s(e.currentTarget).parent().remove(),t.setup_braintree()}),s(document.body).on("update_checkout",function(e){return t.teardown_braintree()})}},{key:"toggle_order_button",value:function(){return!this.is_selected()||this.has_payment_nonce()||this.using_payment_token()?s("#place_order").show():s("#place_order").hide()}},{key:"verify_form",value:function(){var e=_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"verify_form",this).call(this);return this.has_payment_nonce()||this.using_payment_token()||this.render_error(this.must_login_message),e}},{key:"handle_payment_error",value:function(e){return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_payment_error",this).call(this,e),this.cart_payment_nonce=!1,this.setup_braintree()}},{key:"get_integration_class",value:function(){return braintree.paypalCheckout}},{key:"setup_braintree",value:function(){return this.cart_payment_nonce?this.unblock_ui():(_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setup_braintree",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),this.toggle_order_button())}},{key:"do_integration_ready",value:function(){return u(this,n),this.cart_payment_nonce?this.unblock_ui():(this.load_paypal_sdk(),this.set_device_data())}},{key:"load_paypal_sdk",value:function(){var e,t=this,n=this.get_sdk_options();return this.paypal_sdk_loaded&&this.previous_paypal_sdk_options&&JSON.stringify(this.previous_paypal_sdk_options)===JSON.stringify(n)?this.do_paypal_sdk_loaded():(e=n,this.paypal_sdk_messages_component_loaded&&(e.components="buttons"),this.integration.loadPayPalSDK(e,function(){return t.paypal_sdk_loaded=!0,t.previous_paypal_sdk_options=n,paypal.Messages&&(t.paypal_sdk_messages_component_loaded=!0),t.do_paypal_sdk_loaded()}))}},{key:"do_paypal_sdk_loaded",value:function(){var t=this,e=this.is_single_use()?"checkout":"vault";return this.render_pay_later_messaging(),this.render_button(this.integration.createPayment({flow:e,intent:this.is_single_use()?this.paypal_intent:"tokenize",amount:this.get_order_amount(),currency:this.get_store_currency(),locale:this.get_store_locale()}),this.get_button_styles(),"#wc_braintree_paypal_container").then(function(){return"undefined"===t.get_button_styles().height&&s("#wc_braintree_paypal_container").css({width:"100%"}),t.unblock_ui()}).catch(function(e){return t.log("Could not render the PayPal button. "+e.message,e),t.hide_integration_ui(),t.unblock_ui()})}},{key:"render_pay_later_messaging",value:function(){var t=this,e=s("#wc_braintree_paypal_pay_later_messaging_container");if(e.length)return paypal.Messages?paypal.Messages({amount:this.get_order_amount()}).render("#wc_braintree_paypal_pay_later_messaging_container").catch(function(e){return t.log("Could not render the PayPal Pay Later messeging. "+e.message,e)}):e.hide()}},{key:"render_button",value:function(e,t,n){var r=this;return s(n).html(""),t={env:this.is_test_environment?"sandbox":"production",commit:this.button_is_pay_now(),style:t,onApprove:function(e,t){return r.on_approve(e,t)},onError:function(e){return r.handle_integration_error(e)}},this.is_single_use()?t.createOrder=function(){return e}:t.createBillingAgreement=function(){return e},paypal.Buttons(t).render(n)}},{key:"button_is_pay_now",value:function(){return!s("form#add_payment_method").length}},{key:"get_button_styles",value:function(){return this.button_styles}},{key:"on_approve",value:function(e){var t=this;return u(this,n),this.block_ui(),this.integration.tokenizePayment(e).then(function(e){return t.log("Payment method tokenized.",e),t.set_payment_method(e)}).catch(function(e){return t.handle_payment_error(e),t.unblock_ui()})}},{key:"set_payment_method",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e.nonce),s("#wc_braintree_paypal_container").html(this.get_linked_account_html(e.details)),this.is_single_use()&&s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!0),s("#place_order").show(),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_saved_payment_methods",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").change(function(e){if(null!=t.integration&&s(e.target).is(":visible"))return t.block_ui(),t.do_integration_ready()}).change()}},{key:"get_linked_account_html",value:function(e){var t;return u(this,n),t=s("<div class='wc-"+this.id_dasherized+"-account'></div>"),null!=e.firstName&&null!=e.lastName&&t.append("<span class='name'>"+e.firstName+" "+e.lastName+"</span>"),t.append("<span class='email'>"+e.email+"</span>"),t.append("<a href='#' class='cancel'>Cancel</a>"),t}},{key:"is_single_use",value:function(){var e=s("input[name=wc-braintree-paypal-tokenize-payment-method]");return 0===e.length||("checkbox"===e.attr("type")?!e.is(":checked"):!e.val())}},{key:"get_order_amount",value:function(){return s("input[name=wc_braintree_paypal_amount]").val()}},{key:"get_store_currency",value:function(){return s("input[name=wc_braintree_paypal_currency]").val()}},{key:"get_store_locale",value:function(){return s("input[name=wc_braintree_paypal_locale]").val()}},{key:"get_sdk_options",value:function(){var e,t=[],n=[];return this.is_paypal_card_enabled||n.push("card"),(this.is_paypal_pay_later_enabled?t:n).push("paylater"),e={components:this.is_paypal_pay_later_enabled?"buttons,messages":"buttons",currency:this.get_store_currency(),intent:this.is_single_use()?this.paypal_intent:"tokenize",vault:!this.is_single_use(),commit:this.button_is_pay_now()},this.force_buyer_country&&(e["buyer-country"]=this.force_buyer_country),t.length&&(e["enable-funding"]=t.join(",")),n.length&&(e["disable-funding"]=n.join(",")),e}},{key:"set_device_data",value:function(){if(braintree&&braintree.dataCollector)return braintree.dataCollector.create({client:this.client,paypal:!0}).then(function(e){if(e&&e.deviceData)return s("#wc_braintree_paypal_device_data").val(e.deviceData)})}}]),r),s(document.body).trigger("wc_braintree_paypal_payment_form_handler_loaded"),window.WC_Braintree_PayPal_Cart_Handler=(_inherits(o,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(o,[{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return e.wp_nonce=this.set_payment_method_nonce,s.ajax({type:"POST",url:this.cart_handler_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),o),s(document.body).trigger("wc_braintree_paypal_cart_handler_loaded"),i=window.WC_Braintree_PayPal_Product_Button_Handler=(_inherits(_,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(_,[{key:"handle_product_page",value:function(){return this.product_form={element:s("form.cart"),is_variable:s("form.cart").hasClass("variations_form")},this.should_validate_product_data&&this.product_form.element.on("change",this.validate_product_button),this.product_form.is_variable&&s(document.body).on("woocommerce_variation_has_changed",this.validate_product_button),this.validate_product_button()}},{key:"do_integration_ready",value:function(){if(u(this,i),_get(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"do_integration_ready",this).call(this),this.is_product_page)return this.validate_product_button()}},{key:"validate_product_button",value:function(){if(u(this,i),this.product_form.is_variable&&this.product_form.element.find(".single_add_to_cart_button").is(".disabled"))this.hide_button();else{if(!this.should_validate_product_data)return this.show_button();this.validate_product_data(this.show_button,this.hide_button)}}},{key:"validate_product_data",value:function(t,n){var r=this;return u(this,i),s.ajax({type:"POST",url:this.validate_product_url,data:{wp_nonce:this.validate_product_nonce,product_id:s("input[name=wc_braintree_paypal_product_id]").val(),cart_form:s("form.cart").serialize()}}).done(function(e){return e.data.is_valid?(e.data.order_amount&&r.maybe_update_order_amount(e.data.order_amount),t()):n()}).fail(n)}},{key:"hide_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideUp()}},{key:"show_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideDown()}},{key:"maybe_update_order_amount",value:function(e){if(parseFloat(e)!==parseFloat(this.get_order_amount()))return s('[name="wc_braintree_paypal_amount"]').val(e),this.refresh_braintree()}},{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return(e=e).wp_nonce=this.product_checkout_nonce,e.product_id=s("input[name=wc_braintree_paypal_product_id]").val(),e.cart_form=s("form.cart").serialize(),s.ajax({type:"POST",url:this.product_checkout_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),_),s(document.body).trigger("wc_braintree_paypal_product_button_handler_loaded")})}).call(void 0);
1
+ "use strict";var _get=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)},_createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){function u(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}var c=[].indexOf;jQuery(document).ready(function(s){var e,n,i;function t(e){_classCallCheck(this,t),this.show_integration_ui=this.show_integration_ui.bind(this),this.hide_integration_ui=this.hide_integration_ui.bind(this),this.id=e.id,this.id_dasherized=e.id_dasherized,this.name=e.name,this.type=e.type,this.debug=e.debug,this.client_token_nonce=e.client_token_nonce,this.ajax_url=e.ajax_url,this.integration_error_message=e.integration_error_message,this.payment_error_message=e.payment_error_message,this.params=window.sv_wc_payment_gateway_payment_form_params}function a(e){_classCallCheck(this,a);var t=_possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e));return t.show_integration_ui=t.show_integration_ui.bind(t),t.hide_integration_ui=t.hide_integration_ui.bind(t),t.csc_required=e.csc_required,t.hosted_fields_styles=e.hosted_fields_styles,t.threeds=e.threeds,t.enabled_card_types=e.enabled_card_types,t.init(),t}function r(e){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.on_approve=t.on_approve.bind(t),t.get_linked_account_html=t.get_linked_account_html.bind(t),t.is_test_environment=e.is_test_environment,t.is_paypal_pay_later_enabled=e.is_paypal_pay_later_enabled,t.is_paypal_card_enabled=e.is_paypal_card_enabled,t.disabled_funding_options=e.paypal_disabled_funding_options,t.force_buyer_country=e.force_buyer_country,t.must_login_message=e.must_login_message,t.must_login_add_method_message=e.must_login_add_method_message,t.button_styles=e.button_styles,t.cart_payment_nonce=e.cart_payment_nonce,t.paypal_intent=e.paypal_intent,t.init(),t}function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.is_paypal_card_enabled=!1,t.set_payment_method_nonce=e.set_payment_method_nonce,t.cart_handler_url=e.cart_handler_url,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}function _(e){_classCallCheck(this,_);var t=_possibleConstructorReturn(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.validate_product_button=t.validate_product_button.bind(t),t.validate_product_data=t.validate_product_data.bind(t),t.is_paypal_card_enabled=!1,t.product_checkout_nonce=e.product_checkout_nonce,t.product_checkout_url=e.product_checkout_url,t.is_product_page=e.is_product_page,t.validate_product_url=e.validate_product_url,t.validate_product_nonce=e.validate_product_nonce,t.should_validate_product_data=e.should_validate_product_data,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.is_product_page&&t.handle_product_page(),t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}return window.WC_Braintree_Payment_Form_Handler=(_createClass(t,[{key:"init",value:function(){return this.is_sdk_ready()?s("form.checkout").length?this.handle_checkout_page():s("form#order_review").length?this.handle_pay_page():s("form#add_payment_method").length?this.handle_add_payment_method_page():void 0:console.error("Braintree SDK is missing.")}},{key:"handle_checkout_page",value:function(){var e=this;return this.form=s("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",s(document.body).on("updated_checkout",function(){if(!e.setting_up)return s('iframe[name^="braintree-"]').remove(),e.setup_braintree()}),s(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),s(document.body).on("checkout_error",function(){return e.handle_checkout_error()}),this.form.on("checkout_place_order_"+this.id,function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_checkout_error",value:function(){return this.unblock_ui()}},{key:"handle_pay_page",value:function(){var e=this;return this.form=s("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.form=s("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"verify_form",value:function(){return!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0}},{key:"submit_form",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var n=this,e=s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form");if(s("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(){return s("input.js-wc-"+n.id_dasherized+"-payment-token:checked").val()?e.slideUp(200):e.slideDown(200)}).change(),s("input#createaccount").change(function(e){var t=s("input.js-wc-"+n.id_dasherized+"-tokenize-payment-method").closest("p.form-row");return s(e.target).is(":checked")?(t.slideDown(),t.next().show()):(t.hide(),t.next().hide())}),!s("input#createaccount").is(":checked"))return s("input#createaccount").change()}},{key:"setup_braintree",value:function(){if(!s("#wc-"+this.id_dasherized+"-account-number-hosted iframe").data("ready"))return this.setting_up=!0,this.block_ui(),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.create_client()}},{key:"create_client",value:function(){var r=this;return this.log("Creating client."),this.get_client_token().done(function(e){return e.success?braintree.client.create({authorization:e.data}).then(function(e){return r.client=e,r.log("Client ready."),r.setup_integration()}).catch(function(e){return r.handle_integration_error(e),r.unblock_ui()}):r.handle_integration_error(e.data)}).fail(function(e,t,n){return r.handle_integration_error({message:"Could not retrieve the client token via AJAX: "+n}),r.unblock_ui()})}},{key:"get_client_token",value:function(){this.id;var e={action:"wc_"+this.id+"_get_client_token",nonce:this.client_token_nonce};return s.post(this.ajax_url,e)}},{key:"setup_integration",value:function(){var t=this;return this.log("Creating integration."),this.get_integration_class().create(this.get_integration_options()).then(function(e){return t.integration=e,t.show_integration_ui(),s("#wc-"+t.id_dasherized+"-account-number-hosted iframe").data("ready",!0),t.do_integration_ready(),s(document).trigger("wc_"+t.id+"_integration_ready",t.integration),t.log("Integration ready."),t.setting_up=!1}).catch(function(e){return t.handle_integration_error(e),t.unblock_ui(),t.setting_up=!1})}},{key:"refresh_braintree",value:function(){var e=this;if(null!=this.integration&&!this.refreshing&&!this.setting_up)return this.log("Refreshing integration."),this.refreshing=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.refreshing=!1,e.setup_braintree()})}},{key:"teardown_braintree",value:function(){var e=this;if(null!=this.integration&&!this.tearing_down&&!this.setting_up)return this.log("Tearing down integration."),this.tearing_down=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.tearing_down=!1,e.unblock_ui()})}},{key:"do_integration_ready",value:function(){}},{key:"get_integration_options",value:function(){return{client:this.client}}},{key:"get_integration_class",value:function(){}},{key:"handle_integration_error",value:function(e){return this.log("Integration error. "+e.message,e,"error"),this.hide_integration_ui(),this.unblock_ui()}},{key:"handle_payment_error",value:function(e){return this.log("Payment error. "+e.message,e,"error"),this.render_error(this.get_user_message(e)),this.unblock_ui()}},{key:"render_error",value:function(e){return s(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+e+"</div>").removeClass("processing").unblock(),s("html, body").animate({scrollTop:this.form.offset().top-100},1e3),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),s(document.body).trigger("checkout_error"),this.unblock_ui()}},{key:"get_user_message",value:function(){return this.payment_error_message}},{key:"show_integration_ui",value:function(){if(s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".woocommerce-error").remove(),s("input#createaccount").length&&s("input#createaccount").is(":checked"))return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").show()}},{key:"hide_integration_ui",value:function(){return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").prepend('<div class="woocommerce-error">'+this.integration_error_message+"</div>"),s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").hide()}},{key:"block_ui",value:function(){return s(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return s(this.form_ui_selector).unblock()}},{key:"is_selected",value:function(){return this.get_selected_gateway_id()===this.id}},{key:"is_sdk_ready",value:function(){return"undefined"!=typeof braintree&&null!==braintree&&null!=braintree.client&&null!=this.get_integration_class()}},{key:"has_payment_nonce",value:function(){return this.form.find("input[name=wc_"+this.id+"_payment_nonce]").val()}},{key:"using_payment_token",value:function(){return this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()}},{key:"get_selected_gateway_id",value:function(){return this.form.find("input[name=payment_method]:checked").val()}},{key:"log",value:function(e,t){t=1<arguments.length&&void 0!==t?t:null;if(this.debug)return console.log(this.name+": "+e),t?console.log(t):void 0}}]),t),s(document.body).trigger("wc_braintree_payment_form_handler_loaded"),e=window.WC_Braintree_Credit_Card_Payment_Form_Handler=(_inherits(a,WC_Braintree_Payment_Form_Handler),_createClass(a,[{key:"handle_checkout_error",value:function(){return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_checkout_error",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),s("input[name=wc-"+this.id_dasherized+"-card-type]").val(""),s("input[name=wc-"+this.id_dasherized+"-3d-secure-verified]").val(0)}},{key:"verify_form",value:function(){var e;return this.has_payment_nonce()||!this.csc_required&&this.using_payment_token()?(e=s("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(e)?(this.verify_3d_secure(e.data("nonce"),null,e),!1):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"verify_form",this).call(this)):(this.tokenize_payment(),!1)}},{key:"tokenize_payment",value:function(){var t=this;return this.integration.tokenize().then(function(e){if(t.log("Payment method received.",e),null!=e.nonce&&null!=e.details&&null!=e.details.bin)return t.should_verify_3d_secure(e)?t.verify_3d_secure(e.nonce,e.details.bin):t.submit_form(e.nonce)}).catch(function(e){return t.handle_payment_error(e)})}},{key:"get_integration_options",value:function(){var e={client:this.client,fields:{number:{selector:"#wc-braintree-credit-card-account-number-hosted",placeholder:s("#wc-braintree-credit-card-account-number-hosted").data("placeholder")},cvv:{selector:"#wc-braintree-credit-card-csc-hosted",placeholder:s("#wc-braintree-credit-card-csc-hosted").data("placeholder")},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted",placeholder:s("#wc-braintree-credit-card-expiry-hosted").data("placeholder")}},styles:this.hosted_fields_styles};return this.csc_required&&this.using_payment_token()&&(delete e.fields.number,delete e.fields.expirationDate),this.csc_required||delete e.fields.cvv,e}},{key:"get_integration_class",value:function(){return braintree.hostedFields}},{key:"do_integration_ready",value:function(){var t=this;return this.integration.on("cardTypeChange",function(e){return t.on_card_type_change(e)}),!this.csc_required&&s("input.js-wc-braintree-credit-card-payment-token:checked").val()&&this.teardown_braintree(),this.unblock_ui()}},{key:"handle_saved_payment_methods",value:function(){var e,t,n=this;return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_saved_payment_methods",this).call(this),t=s("div.js-wc-braintree-credit-card-new-payment-method-form"),e=s("div.wc-braintree-hosted-field-card-csc-parent"),s("input.js-wc-braintree-credit-card-payment-token").change(function(){return s("input.js-wc-braintree-credit-card-payment-token:checked").val()?n.csc_required&&e.hasClass("form-row-last")?(e.removeClass("form-row-last").addClass("form-row-first"),t.after(e),n.refresh_braintree()):void 0:(n.csc_required&&e.hasClass("form-row-first")&&(e.removeClass("form-row-first").addClass("form-row-last"),t.find("div.wc-braintree-hosted-field-card-expiry-parent").after(e)),n.refresh_braintree())}).change()}},{key:"get_user_message",value:function(e){var t,n,r,i=[];if("CUSTOMER"===e.type)switch(e.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&i.push(this.params.cvv_missing),this.using_payment_token()||(i.push(this.params.card_number_missing),i.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=e.details)for(t=0,n=(r=e.details.invalidFieldKeys).length;t<n;t++)switch(r[t]){case"number":i.push(this.params.card_number_invalid);break;case"cvv":i.push(this.params.cvv_length_invalid);break;case"expirationDate":i.push(this.params.card_exp_date_invalid)}}else"NETWORK"===e.type&&null!=e.details.originalError.error.message&&(e=e.details.originalError.error.message,/given name format is invalid/.test(e)&&i.push(this.params.first_name_unsupported_characters),/surname format is invalid/.test(e)&&i.push(this.params.last_name_unsupported_characters));return i.length?i.join("<br/>"):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"get_user_message",this).call(this)}},{key:"on_card_type_change",value:function(e){var t,n;if(null!=e.cards)return(t=s("#wc-braintree-credit-card-account-number-hosted")).attr("class",function(e,t){return t.replace(/(^|\s)card-type-\S+/g,"")}),e.cards.length?1===e.cards.length?(n=e.cards[0],s("input[name=wc-"+this.id_dasherized+"-card-type]").val(n.type),null!=n.type&&(e=n.type,0<=c.call(this.enabled_card_types,e))?t.addClass("card-type-"+n.type):t.addClass("card-type-invalid")):void 0:t.addClass("card-type-invalid")}},{key:"is_3d_secure_enabled",value:function(){return this.threeds.enabled&&null!=braintree.threeDSecure}},{key:"setup_integration",value:function(){var t=this;return this.threeds.enabled&&(this.threeds.enabled=this.client.getConfiguration().gatewayConfiguration.threeDSecureEnabled),this.is_3d_secure_enabled()?(s("input[name=wc-"+this.id_dasherized+"-3d-secure-enabled]").val(1),this.threeDSecure&&this.threeDSecure.teardown(),braintree.threeDSecure.create({version:2,client:this.client}).then(function(e){return t.threeDSecure=e,s(document.body).on("click","#wc-braintree-credit-card-3dsecure-container",function(e){return s(e.currentTarget).fadeOut(200),t.threeDSecure.cancelVerifyCard(),t.unblock_ui()}),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",t).call(t)}).catch(function(e){return t.handle_integration_error(e)})):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",this).call(this)}},{key:"should_verify_3d_secure",value:function(e){var t=e.details.cardType;return this.is_3d_secure_enabled()&&"CreditCard"===e.type&&0<=c.call(this.threeds.card_types,t)}},{key:"should_verify_3d_secure_token",value:function(e){if(this.is_3d_secure_enabled()&&e.val()&&e.data("nonce")&&!e.data("verified"))return!0}},{key:"verify_3d_secure",value:function(e,t,n){var r=this,i=2<arguments.length&&void 0!==n?n:null,a=s("#billing_state").val(),o=s("#billing_country").val(),_=s("#shipping_state").val(),n=s("#shipping_country").val(),o=s("input[name=billing_first_name]").val()?{givenName:s("input[name=billing_first_name]").val().latinise(),surname:s("input[name=billing_last_name]").val().latinise(),phoneNumber:s("input[name=billing_phone]").val(),streetAddress:s("input[name=billing_address_1]").val(),extendedAddress:s("input[name=billing_address_2]").val(),locality:s("#billing_city").val(),region:"string"==typeof a&&a.length<=2?a:"",postalCode:s("input[name=billing_postcode]").val(),countryCodeAlpha2:"string"==typeof o&&o.length<=2?o:""}:{},n=s("input[name=shipping_first_name]").val()?{shippingGivenName:s("input[name=shipping_first_name]").val().latinise(),shippingSurname:s("input[name=shipping_last_name]").val().latinise(),shippingAddress:{streetAddress:s("input[name=shipping_address_1]").val(),extendedAddress:s("input[name=shipping_address_2]").val(),locality:s("input[name=shipping_city]").val(),region:"string"==typeof _&&_.length<=2?_:"",postalCode:s("input[name=shipping_postcode]").val(),countryCodeAlpha2:"string"==typeof n&&n.length<=2?n:""}}:{},n={nonce:e,amount:s("input[name=wc-"+this.id_dasherized+"-3d-secure-order-total]").val(),email:s("input[name=billing_email]").val(),billingAddress:o,additionalInformation:n,onLookupComplete:function(e,t){r.log("3D Secure lookup complete.",e);try{return t()}catch(e){return r.handle_payment_error(e)}}};return"1"===s("input[name=wc-"+this.id_dasherized+"-cart-contains-subscription]").val()&&(n.challengeRequested=!0),this.log("Verifying 3D Secure.",n),this.threeDSecure.verifyCard(n).then(function(e){return r.log("3D Secure response received.",e),r.threeds.liability_shift_always_required&&!e.liabilityShifted?r.render_error(r.threeds.failure_message):(null!=i&&i.data("verified",!0),s("input[name=wc-"+r.id_dasherized+"-3d-secure-verified]").val(1),r.submit_form(e.nonce))}).catch(function(e){return r.handle_payment_error(e)})}},{key:"show_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"show_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").show()}},{key:"hide_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"hide_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").hide()}}]),a),s(document.body).trigger("wc_braintree_credit_card_payment_form_handler_loaded"),n=window.WC_Braintree_PayPal_Payment_Form_Handler=(_inherits(r,WC_Braintree_Payment_Form_Handler),_createClass(r,[{key:"init",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"init",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(this.cart_payment_nonce),s(document.body).on("click",'input[name="payment_method"], input.js-wc-braintree-paypal-payment-token',function(){return t.toggle_order_button()}),s(document.body).on("payment_method_selected",function(){return t.toggle_order_button()}),s(document.body).on("click",".wc-braintree-paypal-account .cancel",function(e){return e.preventDefault(),s(e.currentTarget).parent().remove(),t.setup_braintree()}),s(document.body).on("update_checkout",function(e){return t.teardown_braintree()})}},{key:"toggle_order_button",value:function(){return!this.is_selected()||this.has_payment_nonce()||this.using_payment_token()?s("#place_order").show():s("#place_order").hide()}},{key:"verify_form",value:function(){var e=_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"verify_form",this).call(this);return this.has_payment_nonce()||this.using_payment_token()||this.render_error(this.must_login_message),e}},{key:"handle_payment_error",value:function(e){return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_payment_error",this).call(this,e),this.cart_payment_nonce=!1,this.setup_braintree()}},{key:"get_integration_class",value:function(){return braintree.paypalCheckout}},{key:"setup_braintree",value:function(){return this.cart_payment_nonce?this.unblock_ui():(_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setup_braintree",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),this.toggle_order_button())}},{key:"do_integration_ready",value:function(){return u(this,n),this.cart_payment_nonce?this.unblock_ui():(this.load_paypal_sdk(),this.set_device_data())}},{key:"load_paypal_sdk",value:function(){var e,t=this,n=this.get_sdk_options();return this.paypal_sdk_loaded&&this.previous_paypal_sdk_options&&JSON.stringify(this.previous_paypal_sdk_options)===JSON.stringify(n)?this.do_paypal_sdk_loaded():(e=n,this.paypal_sdk_messages_component_loaded&&(e.components="buttons"),this.integration.loadPayPalSDK(e,function(){return t.paypal_sdk_loaded=!0,t.previous_paypal_sdk_options=n,paypal.Messages&&(t.paypal_sdk_messages_component_loaded=!0),t.do_paypal_sdk_loaded()}))}},{key:"do_paypal_sdk_loaded",value:function(){var t=this,e=this.is_single_use()?"checkout":"vault";return this.render_pay_later_messaging(),this.render_button(this.integration.createPayment({flow:e,intent:this.is_single_use()?this.paypal_intent:"tokenize",amount:this.get_order_amount(),currency:this.get_store_currency(),locale:this.get_store_locale()}),this.get_button_styles(),"#wc_braintree_paypal_container").then(function(){return"undefined"===t.get_button_styles().height&&s("#wc_braintree_paypal_container").css({width:"100%"}),t.unblock_ui()}).catch(function(e){return t.log("Could not render the PayPal button. "+e.message,e),t.hide_integration_ui(),t.unblock_ui()})}},{key:"render_pay_later_messaging",value:function(){var t=this,e=s("#wc_braintree_paypal_pay_later_messaging_container");if(e.length)return paypal.Messages?paypal.Messages({amount:this.get_order_amount()}).render("#wc_braintree_paypal_pay_later_messaging_container").catch(function(e){return t.log("Could not render the PayPal Pay Later messeging. "+e.message,e)}):e.hide()}},{key:"render_button",value:function(e,t,n){var r=this;return s(n).html(""),t={env:this.is_test_environment?"sandbox":"production",commit:this.button_is_pay_now(),style:t,onApprove:function(e,t){return r.on_approve(e,t)},onError:function(e){return r.handle_integration_error(e)}},this.is_single_use()?t.createOrder=function(){return e}:t.createBillingAgreement=function(){return e},paypal.Buttons(t).render(n)}},{key:"button_is_pay_now",value:function(){return!s("form#add_payment_method").length}},{key:"get_button_styles",value:function(){return this.button_styles}},{key:"on_approve",value:function(e){var t=this;return u(this,n),this.block_ui(),this.integration.tokenizePayment(e).then(function(e){return t.log("Payment method tokenized.",e),t.set_payment_method(e)}).catch(function(e){return t.handle_payment_error(e),t.unblock_ui()})}},{key:"set_payment_method",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e.nonce),s("#wc_braintree_paypal_container").html(this.get_linked_account_html(e.details)),this.is_single_use()&&s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!0),s("#place_order").show(),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_saved_payment_methods",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").change(function(e){if(null!=t.integration&&s(e.target).is(":visible"))return t.block_ui(),t.do_integration_ready()}).change()}},{key:"get_linked_account_html",value:function(e){var t;return u(this,n),t=s("<div class='wc-"+this.id_dasherized+"-account'></div>"),null!=e.firstName&&null!=e.lastName&&t.append("<span class='name'>"+e.firstName+" "+e.lastName+"</span>"),t.append("<span class='email'>"+e.email+"</span>"),t.append("<a href='#' class='cancel'>Cancel</a>"),t}},{key:"is_single_use",value:function(){var e=s("input[name=wc-braintree-paypal-tokenize-payment-method]");return 0===e.length||("checkbox"===e.attr("type")?!e.is(":checked"):!e.val())}},{key:"get_order_amount",value:function(){return s("input[name=wc_braintree_paypal_amount]").val()}},{key:"get_store_currency",value:function(){return s("input[name=wc_braintree_paypal_currency]").val()}},{key:"get_store_locale",value:function(){return s("input[name=wc_braintree_paypal_locale]").val()}},{key:"get_sdk_options",value:function(){var e=[[],this.disabled_funding_options],t=e[0],n=e[1];return this.is_paypal_card_enabled||n.push("card"),(this.is_paypal_pay_later_enabled?t:n).push("paylater"),e={components:this.is_paypal_pay_later_enabled?"buttons,messages":"buttons",currency:this.get_store_currency(),intent:this.is_single_use()?this.paypal_intent:"tokenize",vault:!this.is_single_use(),commit:this.button_is_pay_now()},this.force_buyer_country&&(e["buyer-country"]=this.force_buyer_country),t.length&&(e["enable-funding"]=t.join(",")),n.length&&(e["disable-funding"]=n.join(",")),e}},{key:"set_device_data",value:function(){if(braintree&&braintree.dataCollector)return braintree.dataCollector.create({client:this.client,paypal:!0}).then(function(e){if(e&&e.deviceData)return s("#wc_braintree_paypal_device_data").val(e.deviceData)})}}]),r),s(document.body).trigger("wc_braintree_paypal_payment_form_handler_loaded"),window.WC_Braintree_PayPal_Cart_Handler=(_inherits(o,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(o,[{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return e.wp_nonce=this.set_payment_method_nonce,s.ajax({type:"POST",url:this.cart_handler_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),o),s(document.body).trigger("wc_braintree_paypal_cart_handler_loaded"),i=window.WC_Braintree_PayPal_Product_Button_Handler=(_inherits(_,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(_,[{key:"handle_product_page",value:function(){return this.product_form={element:s("form.cart"),is_variable:s("form.cart").hasClass("variations_form")},this.should_validate_product_data&&this.product_form.element.on("change",this.validate_product_button),this.product_form.is_variable&&s(document.body).on("woocommerce_variation_has_changed",this.validate_product_button),this.validate_product_button()}},{key:"do_integration_ready",value:function(){if(u(this,i),_get(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"do_integration_ready",this).call(this),this.is_product_page)return this.validate_product_button()}},{key:"validate_product_button",value:function(){if(u(this,i),this.product_form.is_variable&&this.product_form.element.find(".single_add_to_cart_button").is(".disabled"))this.hide_button();else{if(!this.should_validate_product_data)return this.show_button();this.validate_product_data(this.show_button,this.hide_button)}}},{key:"validate_product_data",value:function(t,n){var r=this;return u(this,i),s.ajax({type:"POST",url:this.validate_product_url,data:{wp_nonce:this.validate_product_nonce,product_id:s("input[name=wc_braintree_paypal_product_id]").val(),cart_form:s("form.cart").serialize()}}).done(function(e){return e.data.is_valid?(e.data.order_amount&&r.maybe_update_order_amount(e.data.order_amount),t()):n()}).fail(n)}},{key:"hide_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideUp()}},{key:"show_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideDown()}},{key:"maybe_update_order_amount",value:function(e){if(parseFloat(e)!==parseFloat(this.get_order_amount()))return s('[name="wc_braintree_paypal_amount"]').val(e),this.refresh_braintree()}},{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return(e=e).wp_nonce=this.product_checkout_nonce,e.product_id=s("input[name=wc_braintree_paypal_product_id]").val(),e.cart_form=s("form.cart").serialize(),s.ajax({type:"POST",url:this.product_checkout_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),_),s(document.body).trigger("wc_braintree_paypal_product_button_handler_loaded")})}).call(void 0);
class-wc-braintree.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
@@ -73,7 +73,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
73
 
74
 
75
  /** plugin version number */
76
- const VERSION = '2.5.0';
77
 
78
  /** Braintree JS SDK version */
79
  const BRAINTREE_JS_SDK_VERSION = '3.73.1';
@@ -280,7 +280,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
280
  require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
281
 
282
  foreach ( $class_names as $class_name ) {
283
- class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\{$class_name}", "WC_Braintree\\Plugin_Framework\\{$class_name}" );
284
  }
285
  }
286
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
73
 
74
 
75
  /** plugin version number */
76
+ const VERSION = '2.6.0';
77
 
78
  /** Braintree JS SDK version */
79
  const BRAINTREE_JS_SDK_VERSION = '3.73.1';
280
  require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
281
 
282
  foreach ( $class_names as $class_name ) {
283
+ class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\{$class_name}", "WC_Braintree\\Plugin_Framework\\{$class_name}" );
284
  }
285
  }
286
 
i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the Braintree for WooCommerce Payment Gateway package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Braintree for WooCommerce Payment Gateway 2.5.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
- "POT-Creation-Date: 2021-03-18 22:57:40+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -704,13 +704,13 @@ msgstr ""
704
  msgid "Expiration (MMYY)"
705
  msgstr ""
706
 
707
- #: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:113
708
  msgid ""
709
  "Please click the \"PayPal\" button below to log into your PayPal account "
710
  "before placing your order."
711
  msgstr ""
712
 
713
- #: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:114
714
  msgid ""
715
  "Please click the \"PayPal\" button below to log into your PayPal account "
716
  "before adding your payment method."
2
  # This file is distributed under the same license as the Braintree for WooCommerce Payment Gateway package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Braintree for WooCommerce Payment Gateway 2.6.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
+ "POT-Creation-Date: 2021-04-19 20:05:51+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
704
  msgid "Expiration (MMYY)"
705
  msgstr ""
706
 
707
+ #: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:117
708
  msgid ""
709
  "Please click the \"PayPal\" button below to log into your PayPal account "
710
  "before placing your order."
711
  msgstr ""
712
 
713
+ #: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:118
714
  msgid ""
715
  "Please click the \"PayPal\" button below to log into your PayPal account "
716
  "before adding your payment method."
includes/PayPal/Buttons/Abstract_Button.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
  use WC_Braintree_PayPal_Payment_Form;
29
 
30
  defined( 'ABSPATH' ) or exit;
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
  use WC_Braintree_PayPal_Payment_Form;
29
 
30
  defined( 'ABSPATH' ) or exit;
includes/PayPal/Buttons/Cart.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/PayPal/Buttons/Product.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/api/class-wc-braintree-api-response-message-helper.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/class-wc-braintree-api.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/requests/abstract-wc-braintree-api-request.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/requests/class-wc-braintree-api-customer-request.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/requests/class-wc-braintree-api-transaction-request.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/abstract-wc-braintree-api-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/abstract-wc-braintree-api-transaction-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/abstract-wc-braintree-api-vault-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-client-token-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-customer-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-merchant-configuration-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-payment-method-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/apple-pay/api/class-wc-braintree-apple-pay-api-payment-response.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\Apple_Pay\API;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\Apple_Pay\API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/apple-pay/class-wc-braintree-apple-pay-frontend.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\Apple_Pay;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\Apple_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/apple-pay/class-wc-braintree-apple-pay.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/class-wc-braintree-capture.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/class-wc-braintree-frontend.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  defined( 'ABSPATH' ) or exit;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  /**
30
  * Braintree Frontend class
24
 
25
  defined( 'ABSPATH' ) or exit;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  /**
30
  * Braintree Frontend class
includes/class-wc-braintree-lifecycle.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/class-wc-braintree-payment-method-handler.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/class-wc-braintree-payment-method.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/class-wc-gateway-braintree-credit-card.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/class-wc-gateway-braintree-paypal.php CHANGED
@@ -23,7 +23,7 @@
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons;
26
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
includes/class-wc-gateway-braintree.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/integrations/Pre_Orders.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\Integrations;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\Integrations;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/integrations/Product_Addons.php CHANGED
@@ -25,7 +25,7 @@
25
  namespace WC_Braintree\Integrations;
26
 
27
  use WC_Braintree\PayPal\Buttons;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
25
  namespace WC_Braintree\Integrations;
26
 
27
  use WC_Braintree\PayPal\Buttons;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
includes/payment-forms/abstract-wc-braintree-payment-form.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php CHANGED
@@ -22,7 +22,7 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
@@ -188,7 +188,7 @@ class WC_Braintree_Hosted_Fields_Payment_Form extends WC_Braintree_Payment_Form
188
  */
189
  protected function get_enabled_card_types() {
190
 
191
- $types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $this->get_gateway()->get_card_types() );
192
 
193
  // The Braintree SDK has its own strings for a few card types that we need to match
194
  $types = str_replace( [
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
188
  */
189
  protected function get_enabled_card_types() {
190
 
191
+ $types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $this->get_gateway()->get_card_types() );
192
 
193
  // The Braintree SDK has its own strings for a few card types that we need to match
194
  $types = str_replace( [
includes/payment-forms/class-wc-braintree-paypal-payment-form.php CHANGED
@@ -23,7 +23,7 @@
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons\Abstract_Button;
26
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
@@ -105,16 +105,20 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
105
  // allows the buyer country to be forced during the PayPal SDK loading on test environments
106
  $force_buyer_country = $this->get_gateway()->should_force_buyer_country_on_loading_sdk() ? get_user_meta( wp_get_current_user()->ID, 'billing_country', true ) : null;
107
 
 
 
 
108
  $params = array_merge( $params, [
109
- 'is_test_environment' => $this->get_gateway()->is_test_environment(),
110
- 'is_paypal_pay_later_enabled' => $this->get_gateway()->is_paypal_pay_later_enabled(),
111
- 'is_paypal_card_enabled' => $this->get_gateway()->is_paypal_card_enabled(),
112
- 'force_buyer_country' => $force_buyer_country,
113
- 'must_login_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
114
- 'must_login_add_method_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
115
- 'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
116
- 'cart_payment_nonce' => $this->get_cart_nonce(),
117
- 'paypal_intent' => WC_Gateway_Braintree_PayPal::TRANSACTION_TYPE_AUTHORIZATION === $this->get_gateway()->get_transaction_type() ? 'authorize' : 'capture',
 
118
  ] );
119
 
120
  return $params;
@@ -264,4 +268,25 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
264
  }
265
 
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  }
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons\Abstract_Button;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
105
  // allows the buyer country to be forced during the PayPal SDK loading on test environments
106
  $force_buyer_country = $this->get_gateway()->should_force_buyer_country_on_loading_sdk() ? get_user_meta( wp_get_current_user()->ID, 'billing_country', true ) : null;
107
 
108
+ // gets the disabled funding options
109
+ $disabled_funding_options = $this->get_disabled_funding_options();
110
+
111
  $params = array_merge( $params, [
112
+ 'is_test_environment' => $this->get_gateway()->is_test_environment(),
113
+ 'is_paypal_pay_later_enabled' => $this->get_gateway()->is_paypal_pay_later_enabled() && ! in_array( 'paylater', $disabled_funding_options ),
114
+ 'is_paypal_card_enabled' => $this->get_gateway()->is_paypal_card_enabled(),
115
+ 'paypal_disabled_funding_options' => $disabled_funding_options,
116
+ 'force_buyer_country' => $force_buyer_country,
117
+ 'must_login_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
118
+ 'must_login_add_method_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
119
+ 'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
120
+ 'cart_payment_nonce' => $this->get_cart_nonce(),
121
+ 'paypal_intent' => WC_Gateway_Braintree_PayPal::TRANSACTION_TYPE_AUTHORIZATION === $this->get_gateway()->get_transaction_type() ? 'authorize' : 'capture',
122
  ] );
123
 
124
  return $params;
268
  }
269
 
270
 
271
+ /**
272
+ * Gets the disabled funding options.
273
+ *
274
+ * @since 2.6.0
275
+ *
276
+ * @return array
277
+ */
278
+ protected function get_disabled_funding_options() {
279
+
280
+ /**
281
+ * Filters the PayPal disabled funding options.
282
+ *
283
+ * @since 2.6.0
284
+ *
285
+ * @param array $disabled_funding_options list of current disabled funding options
286
+ * @param \WC_Braintree_PayPal_Payment_Form $this payment form instance
287
+ */
288
+ return apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_disabled_funding_options', [], $this );
289
+ }
290
+
291
+
292
  }
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, dsmithweb, fullysupportedphil, corsonr, zandyring, skyverge
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
4
  Requires at least: 4.4
5
- Tested up to: 5.7
6
  Requires PHP: 5.4
7
- Stable tag: 2.5.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -107,6 +107,10 @@ If not, please get in touch with us through the [plugin forums](https://wordpres
107
 
108
  == Changelog ==
109
 
 
 
 
 
110
  = 2021.03.18 - version 2.5.0 =
111
  * Feature - Upgrade to the latest Braintree JavaScript SDK and add support to show PayPal Pay Later offers to eligible buyers
112
  * Tweak - Add Kount support for US based merchants who are using API keys to connect to Braintree
2
  Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, dsmithweb, fullysupportedphil, corsonr, zandyring, skyverge
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
4
  Requires at least: 4.4
5
+ Tested up to: 5.7.1
6
  Requires PHP: 5.4
7
+ Stable tag: 2.6.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
107
 
108
  == Changelog ==
109
 
110
+ = 2021.04.19 - version 2.6.0 =
111
+ * Tweak - Add a filter to allow customizing the disabled funding PayPal options
112
+ * Fix - Prevent a PHP notice triggered while trying to access the cart object too early in a request
113
+
114
  = 2021.03.18 - version 2.5.0 =
115
  * Feature - Upgrade to the latest Braintree JavaScript SDK and add support to show PayPal Pay Later offers to eligible buyers
116
  * Tweak - Add Kount support for US based merchants who are using API keys to connect to Braintree
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit11b67b4ac7751169ccc19f66f26a8f0f::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -37,11 +37,13 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
 
 
45
  // PSR-4
46
  private $prefixLengthsPsr4 = array();
47
  private $prefixDirsPsr4 = array();
@@ -57,6 +59,13 @@ class ClassLoader
57
  private $missingClasses = array();
58
  private $apcuPrefix;
59
 
 
 
 
 
 
 
 
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
@@ -300,6 +309,17 @@ class ClassLoader
300
  public function register($prepend = false)
301
  {
302
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
 
305
  /**
@@ -308,6 +328,10 @@ class ClassLoader
308
  public function unregister()
309
  {
310
  spl_autoload_unregister(array($this, 'loadClass'));
 
 
 
 
311
  }
312
 
313
  /**
@@ -367,6 +391,16 @@ class ClassLoader
367
  return $file;
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
370
  private function findFileWithExtension($class, $ext)
371
  {
372
  // PSR-4 lookup
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
45
+ private $vendorDir;
46
+
47
  // PSR-4
48
  private $prefixLengthsPsr4 = array();
49
  private $prefixDirsPsr4 = array();
59
  private $missingClasses = array();
60
  private $apcuPrefix;
61
 
62
+ private static $registeredLoaders = array();
63
+
64
+ public function __construct($vendorDir = null)
65
+ {
66
+ $this->vendorDir = $vendorDir;
67
+ }
68
+
69
  public function getPrefixes()
70
  {
71
  if (!empty($this->prefixesPsr0)) {
309
  public function register($prepend = false)
310
  {
311
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312
+
313
+ if (null === $this->vendorDir) {
314
+ return;
315
+ }
316
+
317
+ if ($prepend) {
318
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
319
+ } else {
320
+ unset(self::$registeredLoaders[$this->vendorDir]);
321
+ self::$registeredLoaders[$this->vendorDir] = $this;
322
+ }
323
  }
324
 
325
  /**
328
  public function unregister()
329
  {
330
  spl_autoload_unregister(array($this, 'loadClass'));
331
+
332
+ if (null !== $this->vendorDir) {
333
+ unset(self::$registeredLoaders[$this->vendorDir]);
334
+ }
335
  }
336
 
337
  /**
391
  return $file;
392
  }
393
 
394
+ /**
395
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
396
+ *
397
+ * @return self[]
398
+ */
399
+ public static function getRegisteredLoaders()
400
+ {
401
+ return self::$registeredLoaders;
402
+ }
403
+
404
  private function findFileWithExtension($class, $ext)
405
  {
406
  // PSR-4 lookup
vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ namespace Composer;
14
+
15
+ use Composer\Autoload\ClassLoader;
16
+ use Composer\Semver\VersionParser;
17
+
18
+
19
+
20
+
21
+
22
+
23
+ class InstalledVersions
24
+ {
25
+ private static $installed = array (
26
+ 'root' =>
27
+ array (
28
+ 'pretty_version' => 'dev-master',
29
+ 'version' => 'dev-master',
30
+ 'aliases' =>
31
+ array (
32
+ ),
33
+ 'reference' => 'c770b327db8c2b591fb06344209ad9c3cc5f3ade',
34
+ 'name' => '__root__',
35
+ ),
36
+ 'versions' =>
37
+ array (
38
+ '__root__' =>
39
+ array (
40
+ 'pretty_version' => 'dev-master',
41
+ 'version' => 'dev-master',
42
+ 'aliases' =>
43
+ array (
44
+ ),
45
+ 'reference' => 'c770b327db8c2b591fb06344209ad9c3cc5f3ade',
46
+ ),
47
+ 'braintree/braintree_php' =>
48
+ array (
49
+ 'pretty_version' => '3.34.0',
50
+ 'version' => '3.34.0.0',
51
+ 'aliases' =>
52
+ array (
53
+ ),
54
+ 'reference' => 'fd55c466d0d0088c67705d7ba0b3876d9767bfda',
55
+ ),
56
+ 'skyverge/wc-plugin-framework' =>
57
+ array (
58
+ 'pretty_version' => '5.10.7',
59
+ 'version' => '5.10.7.0',
60
+ 'aliases' =>
61
+ array (
62
+ ),
63
+ 'reference' => '3a2c8cb4af31bd2c5e1af38647c249c37575db2c',
64
+ ),
65
+ ),
66
+ );
67
+ private static $canGetVendors;
68
+ private static $installedByVendor = array();
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ public static function getInstalledPackages()
77
+ {
78
+ $packages = array();
79
+ foreach (self::getInstalled() as $installed) {
80
+ $packages[] = array_keys($installed['versions']);
81
+ }
82
+
83
+
84
+ if (1 === \count($packages)) {
85
+ return $packages[0];
86
+ }
87
+
88
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
89
+ }
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ public static function isInstalled($packageName)
100
+ {
101
+ foreach (self::getInstalled() as $installed) {
102
+ if (isset($installed['versions'][$packageName])) {
103
+ return true;
104
+ }
105
+ }
106
+
107
+ return false;
108
+ }
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
124
+ {
125
+ $constraint = $parser->parseConstraints($constraint);
126
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
127
+
128
+ return $provided->matches($constraint);
129
+ }
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ public static function getVersionRanges($packageName)
141
+ {
142
+ foreach (self::getInstalled() as $installed) {
143
+ if (!isset($installed['versions'][$packageName])) {
144
+ continue;
145
+ }
146
+
147
+ $ranges = array();
148
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
149
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
150
+ }
151
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
152
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
153
+ }
154
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
155
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
156
+ }
157
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
158
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
159
+ }
160
+
161
+ return implode(' || ', $ranges);
162
+ }
163
+
164
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
165
+ }
166
+
167
+
168
+
169
+
170
+
171
+ public static function getVersion($packageName)
172
+ {
173
+ foreach (self::getInstalled() as $installed) {
174
+ if (!isset($installed['versions'][$packageName])) {
175
+ continue;
176
+ }
177
+
178
+ if (!isset($installed['versions'][$packageName]['version'])) {
179
+ return null;
180
+ }
181
+
182
+ return $installed['versions'][$packageName]['version'];
183
+ }
184
+
185
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
186
+ }
187
+
188
+
189
+
190
+
191
+
192
+ public static function getPrettyVersion($packageName)
193
+ {
194
+ foreach (self::getInstalled() as $installed) {
195
+ if (!isset($installed['versions'][$packageName])) {
196
+ continue;
197
+ }
198
+
199
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
200
+ return null;
201
+ }
202
+
203
+ return $installed['versions'][$packageName]['pretty_version'];
204
+ }
205
+
206
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
207
+ }
208
+
209
+
210
+
211
+
212
+
213
+ public static function getReference($packageName)
214
+ {
215
+ foreach (self::getInstalled() as $installed) {
216
+ if (!isset($installed['versions'][$packageName])) {
217
+ continue;
218
+ }
219
+
220
+ if (!isset($installed['versions'][$packageName]['reference'])) {
221
+ return null;
222
+ }
223
+
224
+ return $installed['versions'][$packageName]['reference'];
225
+ }
226
+
227
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
228
+ }
229
+
230
+
231
+
232
+
233
+
234
+ public static function getRootPackage()
235
+ {
236
+ $installed = self::getInstalled();
237
+
238
+ return $installed[0]['root'];
239
+ }
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+ public static function getRawData()
248
+ {
249
+ return self::$installed;
250
+ }
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ public static function reload($data)
271
+ {
272
+ self::$installed = $data;
273
+ self::$installedByVendor = array();
274
+ }
275
+
276
+
277
+
278
+
279
+ private static function getInstalled()
280
+ {
281
+ if (null === self::$canGetVendors) {
282
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
283
+ }
284
+
285
+ $installed = array();
286
+
287
+ if (self::$canGetVendors) {
288
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
289
+ if (isset(self::$installedByVendor[$vendorDir])) {
290
+ $installed[] = self::$installedByVendor[$vendorDir];
291
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
292
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
293
+ }
294
+ }
295
+ }
296
+
297
+ $installed[] = self::$installed;
298
+
299
+ return $installed;
300
+ }
301
+ }
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,17 @@ class ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2', 'loadClassLoader'), true, true);
26
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2', 'loadClassLoader'));
 
 
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
- require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit11b67b4ac7751169ccc19f66f26a8f0f
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ require __DIR__ . '/platform_check.php';
26
+
27
+ spl_autoload_register(array('ComposerAutoloaderInit11b67b4ac7751169ccc19f66f26a8f0f', 'loadClassLoader'), true, true);
28
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit11b67b4ac7751169ccc19f66f26a8f0f', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
+ require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc9d19e2245094822df71c6d5f05869e2
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
@@ -30,12 +30,17 @@ class ComposerStaticInitc9d19e2245094822df71c6d5f05869e2
30
  ),
31
  );
32
 
 
 
 
 
33
  public static function getInitializer(ClassLoader $loader)
34
  {
35
  return \Closure::bind(function () use ($loader) {
36
- $loader->prefixLengthsPsr4 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixLengthsPsr4;
37
- $loader->prefixDirsPsr4 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixDirsPsr4;
38
- $loader->prefixesPsr0 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixesPsr0;
 
39
 
40
  }, null, ClassLoader::class);
41
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
30
  ),
31
  );
32
 
33
+ public static $classMap = array (
34
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
35
+ );
36
+
37
  public static function getInitializer(ClassLoader $loader)
38
  {
39
  return \Closure::bind(function () use ($loader) {
40
+ $loader->prefixLengthsPsr4 = ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f::$prefixLengthsPsr4;
41
+ $loader->prefixDirsPsr4 = ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f::$prefixDirsPsr4;
42
+ $loader->prefixesPsr0 = ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f::$prefixesPsr0;
43
+ $loader->classMap = ComposerStaticInit11b67b4ac7751169ccc19f66f26a8f0f::$classMap;
44
 
45
  }, null, ClassLoader::class);
46
  }
vendor/composer/installed.json CHANGED
@@ -1,82 +1,88 @@
1
- [
2
- {
3
- "name": "braintree/braintree_php",
4
- "version": "3.34.0",
5
- "version_normalized": "3.34.0.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/braintree/braintree_php.git",
9
- "reference": "fd55c466d0d0088c67705d7ba0b3876d9767bfda"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/braintree/braintree_php/zipball/fd55c466d0d0088c67705d7ba0b3876d9767bfda",
14
- "reference": "fd55c466d0d0088c67705d7ba0b3876d9767bfda",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "ext-curl": "*",
19
- "ext-dom": "*",
20
- "ext-hash": "*",
21
- "ext-openssl": "*",
22
- "ext-xmlwriter": "*",
23
- "php": ">=5.4.0"
24
- },
25
- "require-dev": {
26
- "phpunit/phpunit": "3.7.*"
27
- },
28
- "time": "2018-05-21T18:14:47+00:00",
29
- "type": "library",
30
- "installation-source": "dist",
31
- "autoload": {
32
- "psr-0": {
33
- "Braintree": "lib/"
34
  },
35
- "psr-4": {
36
- "Braintree\\": "lib/Braintree"
37
- }
38
- },
39
- "notification-url": "https://packagist.org/downloads/",
40
- "license": [
41
- "MIT"
42
- ],
43
- "authors": [
44
- {
45
- "name": "Braintree",
46
- "homepage": "https://www.braintreepayments.com"
47
- }
48
- ],
49
- "description": "Braintree PHP Client Library"
50
- },
51
- {
52
- "name": "skyverge/wc-plugin-framework",
53
- "version": "5.10.5",
54
- "version_normalized": "5.10.5.0",
55
- "source": {
56
- "type": "git",
57
- "url": "https://github.com/skyverge/wc-plugin-framework.git",
58
- "reference": "fffd186167f39f85b48d20a47cdd10bdc59780a4"
59
- },
60
- "dist": {
61
- "type": "zip",
62
- "url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/fffd186167f39f85b48d20a47cdd10bdc59780a4",
63
- "reference": "fffd186167f39f85b48d20a47cdd10bdc59780a4",
64
- "shasum": ""
65
- },
66
- "require-dev": {
67
- "codeception/module-asserts": "^1.3",
68
- "codeception/module-db": "^1.0",
69
- "codeception/module-phpbrowser": "^1.0",
70
- "lucatume/wp-browser": "3.0.5",
71
- "phpcompatibility/php-compatibility": "9.3.5"
 
 
 
72
  },
73
- "time": "2021-03-04T14:25:29+00:00",
74
- "type": "library",
75
- "installation-source": "dist",
76
- "description": "The official SkyVerge WooCommerce plugin framework",
77
- "support": {
78
- "source": "https://github.com/skyverge/wc-plugin-framework/tree/5.10.5",
79
- "issues": "https://github.com/skyverge/wc-plugin-framework/issues"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
- }
82
- ]
 
 
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "braintree/braintree_php",
5
+ "version": "3.34.0",
6
+ "version_normalized": "3.34.0.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/braintree/braintree_php.git",
10
+ "reference": "fd55c466d0d0088c67705d7ba0b3876d9767bfda"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/braintree/braintree_php/zipball/fd55c466d0d0088c67705d7ba0b3876d9767bfda",
15
+ "reference": "fd55c466d0d0088c67705d7ba0b3876d9767bfda",
16
+ "shasum": ""
17
+ },
18
+ "require": {
19
+ "ext-curl": "*",
20
+ "ext-dom": "*",
21
+ "ext-hash": "*",
22
+ "ext-openssl": "*",
23
+ "ext-xmlwriter": "*",
24
+ "php": ">=5.4.0"
25
+ },
26
+ "require-dev": {
27
+ "phpunit/phpunit": "3.7.*"
28
+ },
29
+ "time": "2018-05-21T18:14:47+00:00",
30
+ "type": "library",
31
+ "installation-source": "dist",
32
+ "autoload": {
33
+ "psr-0": {
34
+ "Braintree": "lib/"
35
+ },
36
+ "psr-4": {
37
+ "Braintree\\": "lib/Braintree"
38
+ }
39
+ },
40
+ "notification-url": "https://packagist.org/downloads/",
41
+ "license": [
42
+ "MIT"
43
+ ],
44
+ "authors": [
45
+ {
46
+ "name": "Braintree",
47
+ "homepage": "https://www.braintreepayments.com"
48
+ }
49
+ ],
50
+ "description": "Braintree PHP Client Library",
51
+ "install-path": "../braintree/braintree_php"
52
  },
53
+ {
54
+ "name": "skyverge/wc-plugin-framework",
55
+ "version": "5.10.7",
56
+ "version_normalized": "5.10.7.0",
57
+ "source": {
58
+ "type": "git",
59
+ "url": "https://github.com/skyverge/wc-plugin-framework.git",
60
+ "reference": "3a2c8cb4af31bd2c5e1af38647c249c37575db2c"
61
+ },
62
+ "dist": {
63
+ "type": "zip",
64
+ "url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/3a2c8cb4af31bd2c5e1af38647c249c37575db2c",
65
+ "reference": "3a2c8cb4af31bd2c5e1af38647c249c37575db2c",
66
+ "shasum": ""
67
+ },
68
+ "require-dev": {
69
+ "codeception/module-asserts": "^1.3",
70
+ "codeception/module-db": "^1.0",
71
+ "codeception/module-phpbrowser": "^1.0",
72
+ "lucatume/wp-browser": "3.0.5",
73
+ "phpcompatibility/php-compatibility": "9.3.5"
74
+ },
75
+ "time": "2021-04-15T18:24:53+00:00",
76
+ "type": "library",
77
+ "installation-source": "dist",
78
+ "description": "The official SkyVerge WooCommerce plugin framework",
79
+ "support": {
80
+ "source": "https://github.com/skyverge/wc-plugin-framework/tree/5.10.7",
81
+ "issues": "https://github.com/skyverge/wc-plugin-framework/issues"
82
+ },
83
+ "install-path": "../skyverge/wc-plugin-framework"
84
  }
85
+ ],
86
+ "dev": false,
87
+ "dev-package-names": []
88
+ }
vendor/composer/installed.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array (
2
+ 'root' =>
3
+ array (
4
+ 'pretty_version' => 'dev-master',
5
+ 'version' => 'dev-master',
6
+ 'aliases' =>
7
+ array (
8
+ ),
9
+ 'reference' => 'c770b327db8c2b591fb06344209ad9c3cc5f3ade',
10
+ 'name' => '__root__',
11
+ ),
12
+ 'versions' =>
13
+ array (
14
+ '__root__' =>
15
+ array (
16
+ 'pretty_version' => 'dev-master',
17
+ 'version' => 'dev-master',
18
+ 'aliases' =>
19
+ array (
20
+ ),
21
+ 'reference' => 'c770b327db8c2b591fb06344209ad9c3cc5f3ade',
22
+ ),
23
+ 'braintree/braintree_php' =>
24
+ array (
25
+ 'pretty_version' => '3.34.0',
26
+ 'version' => '3.34.0.0',
27
+ 'aliases' =>
28
+ array (
29
+ ),
30
+ 'reference' => 'fd55c466d0d0088c67705d7ba0b3876d9767bfda',
31
+ ),
32
+ 'skyverge/wc-plugin-framework' =>
33
+ array (
34
+ 'pretty_version' => '5.10.7',
35
+ 'version' => '5.10.7.0',
36
+ 'aliases' =>
37
+ array (
38
+ ),
39
+ 'reference' => '3a2c8cb4af31bd2c5e1af38647c249c37575db2c',
40
+ ),
41
+ ),
42
+ );
vendor/composer/platform_check.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // platform_check.php @generated by Composer
4
+
5
+ $issues = array();
6
+
7
+ if (!(PHP_VERSION_ID >= 50400)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
9
+ }
10
+
11
+ if ($issues) {
12
+ if (!headers_sent()) {
13
+ header('HTTP/1.1 500 Internal Server Error');
14
+ }
15
+ if (!ini_get('display_errors')) {
16
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18
+ } elseif (!headers_sent()) {
19
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
20
+ }
21
+ }
22
+ trigger_error(
23
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
24
+ E_USER_ERROR
25
+ );
26
+ }
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Addresses\\Address' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Addresses\\Address' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Addresses\\Customer_Address' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Addresses\\Customer_Address' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Country_Helper' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Country_Helper' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php CHANGED
@@ -22,14 +22,14 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Handlers;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Handlers\\Script_Handler' ) ) :
33
 
34
 
35
  /**
@@ -79,7 +79,7 @@ abstract class Script_Handler {
79
  */
80
  protected function get_js_handler_class_name() {
81
 
82
- return sprintf( '%s_v5_10_5', $this->js_handler_base_class_name );
83
  }
84
 
85
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Plugin_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Handlers\\Script_Handler' ) ) :
33
 
34
 
35
  /**
79
  */
80
  protected function get_js_handler_class_name() {
81
 
82
+ return sprintf( '%s_v5_10_7', $this->js_handler_base_class_name );
83
  }
84
 
85
 
vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php CHANGED
@@ -22,16 +22,16 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Plugin;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin\Notes_Helper;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
29
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin;
30
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin_Compatibility;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Plugin\\Lifecycle' ) ) :
35
 
36
 
37
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Plugin;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Admin\Notes_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Plugin;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Plugin;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Plugin_Compatibility;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Plugin\\Lifecycle' ) ) :
35
 
36
 
37
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Abstract_Settings' ) ) :
32
 
33
  /**
34
  * The base settings handler.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Settings_API\\Abstract_Settings' ) ) :
32
 
33
  /**
34
  * The base settings handler.
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Control' ) ) :
32
 
33
  /**
34
  * The base control object.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Settings_API\\Control' ) ) :
32
 
33
  /**
34
  * The base control object.
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Setting' ) ) :
32
 
33
  /**
34
  * The base setting object.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Settings_API\\Setting' ) ) :
32
 
33
  /**
34
  * The base setting object.
vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php CHANGED
@@ -21,13 +21,13 @@
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin;
25
 
26
  use Automattic\WooCommerce\Admin\Notes as WooCommerce_Admin_Notes;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Admin\\Notes_Helper' ) ) :
31
 
32
  /**
33
  * Helper class for WooCommerce enhanced admin notes.
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Admin;
25
 
26
  use Automattic\WooCommerce\Admin\Notes as WooCommerce_Admin_Notes;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Admin\\Notes_Helper' ) ) :
31
 
32
  /**
33
  * Helper class for WooCommerce enhanced admin notes.
vendor/skyverge/wc-plugin-framework/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php CHANGED
@@ -21,13 +21,13 @@
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Admin\\Setup_Wizard' ) ) :
31
 
32
 
33
  /**
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Admin\\Setup_Wizard' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_JSON_Request' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_JSON_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_JSON_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_JSON_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_XML_Request' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_XML_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_XML_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_XML_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Base' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_Base' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Exception' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_Exception' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Request' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  *** SkyVerge WooCommerce Plugin Framework Changelog ***
2
 
 
 
 
 
 
 
3
  2021.03.04 - version 5.10.5
4
  * Tweak - Add a class representation for Braintree PayPal tokens
5
 
1
  *** SkyVerge WooCommerce Plugin Framework Changelog ***
2
 
3
+ 2021.04.15 - version 5.10.7
4
+ * Fix - Prevent fatal errors by loading External_Checkout extensions in the wp_loaded action rather than on init
5
+
6
+ 2021.03.12 - version 5.10.6
7
+ * Feature - Add a helper method to determine whether the new WC navigation feature is enabled
8
+
9
  2021.03.04 - version 5.10.5
10
  * Tweak - Add a class representation for Braintree PayPal tokens
11
 
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Admin_Notice_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Admin_Notice_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php CHANGED
@@ -22,13 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
-
27
- use Automattic\WooCommerce\Admin\Loader;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Helper' ) ) :
32
 
33
 
34
  /**
@@ -975,7 +973,25 @@ class SV_WC_Helper {
975
  */
976
  public static function is_enhanced_admin_screen() {
977
 
978
- return is_admin() && SV_WC_Plugin_Compatibility::is_enhanced_admin_available() && ( Loader::is_admin_page() || Loader::is_embed_page() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
979
  }
980
 
981
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
 
 
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Helper' ) ) :
30
 
31
 
32
  /**
973
  */
974
  public static function is_enhanced_admin_screen() {
975
 
976
+ return is_admin() && SV_WC_Plugin_Compatibility::is_enhanced_admin_available() && ( \Automattic\WooCommerce\Admin\Loader::is_admin_page() || \Automattic\WooCommerce\Admin\Loader::is_embed_page() );
977
+ }
978
+
979
+
980
+ /**
981
+ * Determines whether the new WooCommerce enhanced navigation is supported and enabled.
982
+ *
983
+ * @since 5.10.6
984
+ *
985
+ * @return bool
986
+ */
987
+ public static function is_wc_navigation_enabled() {
988
+
989
+ return
990
+ is_callable( [ \Automattic\WooCommerce\Admin\Features\Navigation\Screen::class, 'register_post_type' ] ) &&
991
+ is_callable( [ \Automattic\WooCommerce\Admin\Features\Navigation\Menu::class, 'add_plugin_item' ] ) &&
992
+ is_callable( [ \Automattic\WooCommerce\Admin\Features\Navigation\Menu::class, 'add_plugin_category' ] ) &&
993
+ is_callable( [ \Automattic\WooCommerce\Admin\Features\Features::class, 'is_enabled' ] ) &&
994
+ \Automattic\WooCommerce\Admin\Features\Features::is_enabled( 'navigation' );
995
  }
996
 
997
 
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Hook_Deprecator' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Hook_Deprecator' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Compatibility' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Plugin_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Dependencies' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Plugin_Dependencies' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Exception' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Plugin_Exception' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin' ) ) :
30
 
31
 
32
  /**
@@ -43,7 +43,7 @@ abstract class SV_WC_Plugin {
43
 
44
 
45
  /** Plugin Framework Version */
46
- const VERSION = '5.10.5';
47
 
48
  /** @var object single instance of plugin */
49
  protected static $instance;
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Plugin' ) ) :
30
 
31
 
32
  /**
43
 
44
 
45
  /** Plugin Framework Version */
46
+ const VERSION = '5.10.7';
47
 
48
  /** @var object single instance of plugin */
49
  protected static $instance;
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Admin_Message_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WP_Admin_Message_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Data_Compatibility' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Data_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  use DateTimeZone;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_DateTime' ) ) :
32
 
33
 
34
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  use DateTimeZone;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_DateTime' ) ) :
32
 
33
 
34
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Order_Compatibility' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Order_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Product_Compatibility' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Product_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po CHANGED
@@ -2021,7 +2021,7 @@ msgctxt "enhanced select"
2021
  msgid "Searching&hellip;"
2022
  msgstr ""
2023
 
2024
- #: class-sv-wc-helper.php:410
2025
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
2026
  msgid "and"
2027
  msgstr ""
2021
  msgid "Searching&hellip;"
2022
  msgstr ""
2023
 
2024
+ #: class-sv-wc-helper.php:408
2025
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
2026
  msgid "and"
2027
  msgstr ""
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Plugin Framework 5.10.5\n"
6
  "Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
7
  "POT-Creation-Date: 2015-07-22 12:09:16+00:00\n"
8
  "MIME-Version: 1.0\n"
@@ -1912,7 +1912,7 @@ msgctxt "enhanced select"
1912
  msgid "Searching&hellip;"
1913
  msgstr ""
1914
 
1915
- #: class-sv-wc-helper.php:410
1916
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
1917
  msgid "and"
1918
  msgstr ""
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Plugin Framework 5.10.7\n"
6
  "Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
7
  "POT-Creation-Date: 2015-07-22 12:09:16+00:00\n"
8
  "MIME-Version: 1.0\n"
1912
  msgid "Searching&hellip;"
1913
  msgstr ""
1914
 
1915
+ #: class-sv-wc-helper.php:408
1916
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
1917
  msgid "and"
1918
  msgstr ""
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php CHANGED
@@ -22,9 +22,9 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php CHANGED
@@ -22,10 +22,10 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php CHANGED
@@ -23,16 +23,16 @@
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout;
27
 
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Handlers\Script_Handler;
29
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
30
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway;
31
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Frontend' ) ) :
36
 
37
 
38
  /**
@@ -322,7 +322,7 @@ abstract class Frontend extends Script_Handler {
322
  */
323
  public function enqueue_scripts() {
324
 
325
- wp_enqueue_style( 'sv-wc-external-checkout-v5_10_5', $this->get_handler()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-external-checkout.css', array(), $this->get_handler()->get_plugin()->get_version() ); // TODO: min
326
  }
327
 
328
 
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Handlers\Script_Handler;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Helper;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway;
31
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\External_Checkout\\Frontend' ) ) :
36
 
37
 
38
  /**
322
  */
323
  public function enqueue_scripts() {
324
 
325
+ wp_enqueue_style( 'sv-wc-external-checkout-v5_10_7', $this->get_handler()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-external-checkout.css', array(), $this->get_handler()->get_plugin()->get_version() ); // TODO: min
326
  }
327
 
328
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php CHANGED
@@ -22,14 +22,14 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) :
33
 
34
 
35
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) :
33
 
34
 
35
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) :
32
 
33
 
34
  /**
@@ -36,7 +36,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment
36
  *
37
  * @since 5.10.0
38
  */
39
- class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Admin {
40
 
41
 
42
  /** @var Google_Pay the Google Pay handler instance */
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) :
32
 
33
 
34
  /**
36
  *
37
  * @since 5.10.0
38
  */
39
+ class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Admin {
40
 
41
 
42
  /** @var Google_Pay the Google Pay handler instance */
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php CHANGED
@@ -22,14 +22,14 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) :
33
 
34
 
35
  /**
@@ -37,7 +37,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment
37
  *
38
  * @since 5.10.0
39
  */
40
- class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Frontend {
41
 
42
 
43
  /** @var string JS handler base class name, without the FW version */
@@ -94,7 +94,7 @@ class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gat
94
  parent::enqueue_scripts();
95
 
96
  wp_enqueue_script( 'google-pay-js-library', 'https://pay.google.com/gp/p/js/pay.js', array(), null, true );
97
- wp_enqueue_script( 'sv-wc-google-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $this->get_plugin()->get_version(), true );
98
  }
99
 
100
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Exception;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) :
33
 
34
 
35
  /**
37
  *
38
  * @since 5.10.0
39
  */
40
+ class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Frontend {
41
 
42
 
43
  /** @var string JS handler base class name, without the FW version */
94
  parent::enqueue_scripts();
95
 
96
  wp_enqueue_script( 'google-pay-js-library', 'https://pay.google.com/gp/p/js/pay.js', array(), null, true );
97
+ wp_enqueue_script( 'sv-wc-google-pay-v5_10_7', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $this->get_plugin()->get_version(), true );
98
  }
99
 
100
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php CHANGED
@@ -22,17 +22,17 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Orders;
29
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
30
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Helper;
31
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) :
36
 
37
 
38
  /**
@@ -675,7 +675,7 @@ class Google_Pay extends External_Checkout {
675
 
676
  $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : [];
677
 
678
- $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
679
 
680
  $valid_networks = [
681
  SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'AMEX',
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\External_Checkout;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Orders;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Exception;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Helper;
31
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) :
36
 
37
 
38
  /**
675
 
676
  $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : [];
677
 
678
+ $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
679
 
680
  $valid_networks = [
681
  SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'AMEX',
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Orders.php CHANGED
@@ -22,9 +22,9 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) :
30
 
31
 
32
  /**
@@ -57,7 +57,7 @@ class SV_WC_Payment_Gateway_Apple_Pay_API extends SV_WC_API_Base {
57
  $this->set_request_content_type_header( 'application/json' );
58
  $this->set_request_accept_header( 'application/json' );
59
 
60
- $this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' );
61
  }
62
 
63
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) :
30
 
31
 
32
  /**
57
  $this->set_request_content_type_header( 'application/json' );
58
  $this->set_request_accept_header( 'application/json' );
59
 
60
+ $this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' );
61
  }
62
 
63
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Admin;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) :
32
 
33
 
34
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Admin;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) :
32
 
33
 
34
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) :
30
 
31
 
32
  /**
@@ -34,7 +34,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_P
34
  *
35
  * @since 4.7.0
36
  */
37
- class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Frontend {
38
 
39
 
40
  /** @var string JS handler base class name, without the FW version */
@@ -108,9 +108,9 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\Plu
108
 
109
  parent::enqueue_scripts();
110
 
111
- wp_enqueue_style( 'sv-wc-apple-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', array(), $this->get_plugin()->get_version() ); // TODO: min
112
 
113
- wp_enqueue_script( 'sv-wc-apple-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', array( 'jquery' ), $this->get_plugin()->get_version(), true );
114
  }
115
 
116
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) :
30
 
31
 
32
  /**
34
  *
35
  * @since 4.7.0
36
  */
37
+ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Frontend {
38
 
39
 
40
  /** @var string JS handler base class name, without the FW version */
108
 
109
  parent::enqueue_scripts();
110
 
111
+ wp_enqueue_style( 'sv-wc-apple-pay-v5_10_7', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', array(), $this->get_plugin()->get_version() ); // TODO: min
112
 
113
+ wp_enqueue_script( 'sv-wc-apple-pay-v5_10_7', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', array( 'jquery' ), $this->get_plugin()->get_version(), true );
114
  }
115
 
116
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Orders;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay' ) ) :
32
 
33
 
34
  /**
@@ -940,7 +940,7 @@ class SV_WC_Payment_Gateway_Apple_Pay extends Payment_Gateway\External_Checkout\
940
 
941
  $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : array();
942
 
943
- $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
944
 
945
  $valid_networks = array(
946
  SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'amex',
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Orders;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Apple_Pay' ) ) :
32
 
33
 
34
  /**
940
 
941
  $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : array();
942
 
943
+ $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
944
 
945
  $valid_networks = array(
946
  SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'amex',
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as FrameworkBase;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as FrameworkBase;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as FrameworkBase;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as FrameworkBase;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php CHANGED
@@ -22,13 +22,13 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Capture' ) ) :
32
 
33
 
34
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\Handlers\\Capture' ) ) :
32
 
33
 
34
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php CHANGED
@@ -21,13 +21,13 @@
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Admin\\Setup_Wizard' ) ) :
31
 
32
 
33
  /**
21
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
22
  */
23
 
24
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\Admin\\Setup_Wizard' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_Order' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Admin_Order' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_Payment_Token_Editor' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Admin_Payment_Token_Editor' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Response_Message_Helper' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Response_Message_Helper' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Authorization_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Authorization_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Create_Payment_Token_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Create_Payment_Token_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Customer_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Customer_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Get_Tokenized_Payment_Methods_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_API_Get_Tokenized_Payment_Methods_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_Credit_Card_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Payment_Notification_Credit_Card_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_eCheck_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Payment_Notification_eCheck_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Payment_Notification_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Notification_Tokenization_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Payment_Notification_Tokenization_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Request' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Response' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_API' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js CHANGED
@@ -1,4 +1,4 @@
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"L57g":[function(require,module,exports) {
2
- function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Apple_Pay_Handler_v5_10_5=function(){function i(t){e(this,i),this.init_product_page=this.init_product_page.bind(this),this.init_cart_page=this.init_cart_page.bind(this),this.init_checkout_page=this.init_checkout_page.bind(this),this.on_validate_merchant=this.on_validate_merchant.bind(this),this.validate_merchant=this.validate_merchant.bind(this),this.on_payment_method_selected=this.on_payment_method_selected.bind(this),this.on_shipping_contact_selected=this.on_shipping_contact_selected.bind(this),this.on_shipping_method_selected=this.on_shipping_method_selected.bind(this),this.on_payment_authorized=this.on_payment_authorized.bind(this),this.process_authorization=this.process_authorization.bind(this),this.on_cancel_payment=this.on_cancel_payment.bind(this),this.reset_payment_request=this.reset_payment_request.bind(this),this.get_payment_request=this.get_payment_request.bind(this),this.gateway_id=t.gateway_id,this.gateway_slug=t.gateway_slug,this.merchant_id=t.merchant_id,this.ajax_url=t.ajax_url,this.validate_nonce=t.validate_nonce,this.recalculate_totals_nonce=t.recalculate_totals_nonce,this.process_nonce=t.process_nonce,this.payment_request=t.payment_request,this.generic_error=t.generic_error,this.wrapper=".sv-wc-external-checkout",this.container=".buttons-container",this.button=".sv-wc-apple-pay-button"}return n(i,[{key:"is_available",value:function(){return!!window.ApplePaySession&&ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then(function(e){return e})}},{key:"init",value:function(){var e=this;if(1===t(this.container).children().length&&t(this.wrapper).hide(),this.is_available()&&(t("form.cart").length?this.init_product_page():t("form.woocommerce-cart-form").length?this.init_cart_page():t("form.woocommerce-checkout").length&&this.init_checkout_page(),this.ui_element))return this.payment_request&&(t(this.button).show(),t(this.wrapper).show()),t(document.body).on("click",".sv-wc-apple-pay-button",function(t){var n;t.preventDefault(),e.block_ui();try{return e.session=e.get_new_session(e.payment_request),e.session.onvalidatemerchant=function(t){return e.on_validate_merchant(t)},e.session.onpaymentmethodselected=function(t){return e.on_payment_method_selected(t)},e.session.onshippingcontactselected=function(t){return e.on_shipping_contact_selected(t)},e.session.onshippingmethodselected=function(t){return e.on_shipping_method_selected(t)},e.session.onpaymentauthorized=function(t){return e.on_payment_authorized(t)},e.session.oncancel=function(t){return e.on_cancel_payment(t)},e.session.begin()}catch(i){return n=i,e.fail_payment(n)}})}},{key:"init_product_page",value:function(){return this.ui_element=t("form.cart")}},{key:"init_cart_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){return e.reset_payment_request()})}},{key:"init_checkout_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-checkout"),t(document.body).on("updated_checkout",function(){return e.reset_payment_request()})}},{key:"get_new_session",value:function(e){return new ApplePaySession(this.get_sdk_version(),e)}},{key:"get_sdk_version",value:function(){return 2}},{key:"on_validate_merchant",value:function(e){var t=this;return this.validate_merchant(e.validationURL).then(function(e){return e=JSON.parse(e),t.session.completeMerchantValidation(e)},function(e){return t.session.abort(),t.fail_payment("Merchant could no be validated. "+e.message)})}},{key:"validate_merchant",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_validate_merchant"),nonce:n.validate_nonce,merchant_id:n.merchant_id,url:e},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_payment_method_selected",value:function(e){var n=this;return new Promise(function(e,i){var a;return a={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce},t.post(n.ajax_url,a,function(t){return t.success?(a=t.data,e(n.session.completePaymentMethodSelection(a.total,a.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+t.data.message),i(n.session.completePaymentMethodSelection(n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_contact_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,contact:e.shippingContact},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,o.shipping_methods,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+e.data.message),a(n.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_method_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,method:e.shippingMethod.identifier},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping method. "+e.data.message),a(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_payment_authorized",value:function(e){var t=this;return this.process_authorization(e.payment).then(function(e){return t.set_payment_status(!0),t.complete_purchase(e)},function(e){return t.set_payment_status(!1),t.fail_payment("Payment could no be processed. "+e.message)})}},{key:"process_authorization",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_process_payment"),nonce:n.process_nonce,payment:JSON.stringify(e)},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_cancel_payment",value:function(e){return this.unblock_ui()}},{key:"complete_purchase",value:function(e){return window.location=e.redirect}},{key:"fail_payment",value:function(e){return console.error("[Apple Pay] "+e),this.unblock_ui(),this.render_errors([this.generic_error])}},{key:"set_payment_status",value:function(e){var t;return t=e?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE,this.session.completePayment(t)}},{key:"reset_payment_request",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.block_ui(),this.get_payment_request(n).then(function(n){return t(e.button).show(),t(e.wrapper).show(),e.payment_request=JSON.parse(n),e.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),t(e.button).hide(),1===t(e.container).children().length&&t(e.wrapper).hide(),e.unblock_ui()})}},{key:"get_payment_request",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},t.extend(e,o),t.post(n.ajax_url,e,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.ui_element.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.ui_element.offset().top-100},1e3)}},{key:"block_ui",value:function(){return this.ui_element.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.ui_element.unblock()}}]),i}(),t(document.body).trigger("sv_wc_apple_pay_handler_v5_10_5_loaded")})}).call(this);
3
  },{}]},{},["L57g"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-apple-pay.js.map
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"L57g":[function(require,module,exports) {
2
+ function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Apple_Pay_Handler_v5_10_7=function(){function i(t){e(this,i),this.init_product_page=this.init_product_page.bind(this),this.init_cart_page=this.init_cart_page.bind(this),this.init_checkout_page=this.init_checkout_page.bind(this),this.on_validate_merchant=this.on_validate_merchant.bind(this),this.validate_merchant=this.validate_merchant.bind(this),this.on_payment_method_selected=this.on_payment_method_selected.bind(this),this.on_shipping_contact_selected=this.on_shipping_contact_selected.bind(this),this.on_shipping_method_selected=this.on_shipping_method_selected.bind(this),this.on_payment_authorized=this.on_payment_authorized.bind(this),this.process_authorization=this.process_authorization.bind(this),this.on_cancel_payment=this.on_cancel_payment.bind(this),this.reset_payment_request=this.reset_payment_request.bind(this),this.get_payment_request=this.get_payment_request.bind(this),this.gateway_id=t.gateway_id,this.gateway_slug=t.gateway_slug,this.merchant_id=t.merchant_id,this.ajax_url=t.ajax_url,this.validate_nonce=t.validate_nonce,this.recalculate_totals_nonce=t.recalculate_totals_nonce,this.process_nonce=t.process_nonce,this.payment_request=t.payment_request,this.generic_error=t.generic_error,this.wrapper=".sv-wc-external-checkout",this.container=".buttons-container",this.button=".sv-wc-apple-pay-button"}return n(i,[{key:"is_available",value:function(){return!!window.ApplePaySession&&ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then(function(e){return e})}},{key:"init",value:function(){var e=this;if(1===t(this.container).children().length&&t(this.wrapper).hide(),this.is_available()&&(t("form.cart").length?this.init_product_page():t("form.woocommerce-cart-form").length?this.init_cart_page():t("form.woocommerce-checkout").length&&this.init_checkout_page(),this.ui_element))return this.payment_request&&(t(this.button).show(),t(this.wrapper).show()),t(document.body).on("click",".sv-wc-apple-pay-button",function(t){var n;t.preventDefault(),e.block_ui();try{return e.session=e.get_new_session(e.payment_request),e.session.onvalidatemerchant=function(t){return e.on_validate_merchant(t)},e.session.onpaymentmethodselected=function(t){return e.on_payment_method_selected(t)},e.session.onshippingcontactselected=function(t){return e.on_shipping_contact_selected(t)},e.session.onshippingmethodselected=function(t){return e.on_shipping_method_selected(t)},e.session.onpaymentauthorized=function(t){return e.on_payment_authorized(t)},e.session.oncancel=function(t){return e.on_cancel_payment(t)},e.session.begin()}catch(i){return n=i,e.fail_payment(n)}})}},{key:"init_product_page",value:function(){return this.ui_element=t("form.cart")}},{key:"init_cart_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){return e.reset_payment_request()})}},{key:"init_checkout_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-checkout"),t(document.body).on("updated_checkout",function(){return e.reset_payment_request()})}},{key:"get_new_session",value:function(e){return new ApplePaySession(this.get_sdk_version(),e)}},{key:"get_sdk_version",value:function(){return 2}},{key:"on_validate_merchant",value:function(e){var t=this;return this.validate_merchant(e.validationURL).then(function(e){return e=JSON.parse(e),t.session.completeMerchantValidation(e)},function(e){return t.session.abort(),t.fail_payment("Merchant could no be validated. "+e.message)})}},{key:"validate_merchant",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_validate_merchant"),nonce:n.validate_nonce,merchant_id:n.merchant_id,url:e},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_payment_method_selected",value:function(e){var n=this;return new Promise(function(e,i){var a;return a={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce},t.post(n.ajax_url,a,function(t){return t.success?(a=t.data,e(n.session.completePaymentMethodSelection(a.total,a.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+t.data.message),i(n.session.completePaymentMethodSelection(n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_contact_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,contact:e.shippingContact},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,o.shipping_methods,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+e.data.message),a(n.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_method_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,method:e.shippingMethod.identifier},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping method. "+e.data.message),a(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_payment_authorized",value:function(e){var t=this;return this.process_authorization(e.payment).then(function(e){return t.set_payment_status(!0),t.complete_purchase(e)},function(e){return t.set_payment_status(!1),t.fail_payment("Payment could no be processed. "+e.message)})}},{key:"process_authorization",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_process_payment"),nonce:n.process_nonce,payment:JSON.stringify(e)},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_cancel_payment",value:function(e){return this.unblock_ui()}},{key:"complete_purchase",value:function(e){return window.location=e.redirect}},{key:"fail_payment",value:function(e){return console.error("[Apple Pay] "+e),this.unblock_ui(),this.render_errors([this.generic_error])}},{key:"set_payment_status",value:function(e){var t;return t=e?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE,this.session.completePayment(t)}},{key:"reset_payment_request",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.block_ui(),this.get_payment_request(n).then(function(n){return t(e.button).show(),t(e.wrapper).show(),e.payment_request=JSON.parse(n),e.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),t(e.button).hide(),1===t(e.container).children().length&&t(e.wrapper).hide(),e.unblock_ui()})}},{key:"get_payment_request",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},t.extend(e,o),t.post(n.ajax_url,e,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.ui_element.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.ui_element.offset().top-100},1e3)}},{key:"block_ui",value:function(){return this.ui_element.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.ui_element.unblock()}}]),i}(),t(document.body).trigger("sv_wc_apple_pay_handler_v5_10_7_loaded")})}).call(this);
3
  },{}]},{},["L57g"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-apple-pay.js.map
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["frontend/sv-wc-payment-gateway-apple-pay.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAEH,OAAO,SAAE,GAAF,aAibN,OA1aM,OAAO,gCAAP,WAMS,SAAA,EAAA,GAAD,EAAA,KAAA,GAoFb,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAQA,KAAA,eAAA,KAAA,eAAA,KAAA,MAaA,KAAA,mBAAA,KAAA,mBAAA,KAAA,MAiCA,KAAA,qBAAA,KAAA,qBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAqBA,KAAA,2BAAA,KAAA,2BAAA,KAAA,MA4BA,KAAA,6BAAA,KAAA,6BAAA,KAAA,MA6BA,KAAA,4BAAA,KAAA,4BAAA,KAAA,MA6BA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAkBA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MA2CA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,oBAAA,KAAA,oBAAA,KAAA,MAlXE,KAAA,WAA2B,EAAK,WAChC,KAAA,aAA2B,EAAK,aAChC,KAAA,YAA2B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AkD,EAAS,SAEzE,EAAG,EAAC,QAAS,OAE2B,IAArC,EAAG,EAAC,WAAY,WAAW,QAC7B,EAAG,EAAC,SAAU,OAEf,EAAK,iBApXF,CAAA,IAAA,sBA0XkB,MAAA,SAAA,GAAF,IAAA,EAAA,KAAY,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1D,IAAA,EAOG,OAPA,EAAY,CACM,OAAA,MAAA,OAAA,EAAC,WAAlB,mCAGD,EAAE,OAAO,EAAM,GAGf,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,QACX,EAAQ,EAAS,MAEjB,EAAO,EAAS,YAxYd,CAAA,IAAA,gBA8YY,MAAA,SAAA,GAYhB,OATA,EAAG,4CAA6C,SAG/C,KAAA,WAAW,QAAQ,qCAAuC,EAAO,KAAM,aAAgB,cAGvF,KAAA,WAAW,YAAa,cAAe,UAGxC,EAAG,cAAe,QAAS,CAAE,UAAW,KAAC,WAAW,SAAS,IAAM,KAAO,OA1ZtE,CAAA,IAAA,WAgaK,MAAA,WAAG,OAAA,KAAC,WAAW,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QAhanF,CAAA,IAAA,aAsaO,MAAA,WAAG,OAAA,KAAC,WAAW,cAtatB,EAAA,GA0aN,EAAG,SAAS,MAAO,QAAS,8CAnb1B,KAAA","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\n\njQuery ( $ ) ->\n\n\t\"use strict\"\n\n\t# The WooCommerce Apple Pay handler base class.\n\t#\n\t# @since 4.7.0\n\tclass window.SV_WC_Apple_Pay_Handler_v5_10_5\n\n\n\t\t# Constructs the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tconstructor: (args) ->\n\n\t\t\t@gateway_id = args.gateway_id\n\t\t\t@gateway_slug = args.gateway_slug\n\t\t\t@merchant_id = args.merchant_id\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@validate_nonce = args.validate_nonce\n\t\t\t@recalculate_totals_nonce = args.recalculate_totals_nonce\n\t\t\t@process_nonce = args.process_nonce\n\t\t\t@payment_request = args.payment_request\n\t\t\t@generic_error = args.generic_error\n\n\t\t\t@wrapper = '.sv-wc-external-checkout'\n\t\t\t@container = '.buttons-container'\n\t\t\t@button = '.sv-wc-apple-pay-button'\n\n\n\t\t# Determines if Apple Pay is available.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return bool\n\t\tis_available: ->\n\n\t\t\treturn false unless window.ApplePaySession\n\n\t\t\tApplePaySession.canMakePaymentsWithActiveCard( @merchant_id ).then ( canMakePayments ) =>\n\n\t\t\t\treturn canMakePayments\n\n\n\t\t# Initializes the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tinit: ->\n\n\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\tif $( @container ).children().length is 1\n\t\t\t\t$( @wrapper ).hide()\n\n\t\t\treturn unless this.is_available()\n\n\t\t\t# initialize for the various pages\n\t\t\tif $( 'form.cart' ).length\n\t\t\t\tthis.init_product_page()\n\t\t\telse if $( 'form.woocommerce-cart-form' ).length\n\t\t\t\tthis.init_cart_page()\n\t\t\telse if $( 'form.woocommerce-checkout' ).length\n\t\t\t\tthis.init_checkout_page()\n\n\t\t\t# bail if no UI was initialized\n\t\t\treturn unless @ui_element\n\n\t\t\tif @payment_request\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t$( document.body ).on 'click', '.sv-wc-apple-pay-button', ( e ) =>\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\tthis.block_ui()\n\n\t\t\t\ttry\n\n\t\t\t\t\t@session = this.get_new_session( @payment_request )\n\n\t\t\t\t\t# set the payment card events\n\t\t\t\t\t@session.onvalidatemerchant = ( event ) => this.on_validate_merchant( event )\n\t\t\t\t\t@session.onpaymentmethodselected = ( event ) => this.on_payment_method_selected( event )\n\t\t\t\t\t@session.onshippingcontactselected = ( event ) => this.on_shipping_contact_selected( event )\n\t\t\t\t\t@session.onshippingmethodselected = ( event ) => this.on_shipping_method_selected( event )\n\t\t\t\t\t@session.onpaymentauthorized = ( event ) => this.on_payment_authorized( event )\n\t\t\t\t\t@session.oncancel = ( event ) => this.on_cancel_payment( event )\n\n\t\t\t\t\t@session.begin()\n\n\t\t\t\tcatch error\n\n\t\t\t\t\tthis.fail_payment( error )\n\n\n\t\t# Initializes the product page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_product_page: =>\n\n\t\t\t@ui_element = $( 'form.cart' )\n\n\n\t\t# Initializes the cart page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_cart_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' )\n\n\t\t\t# re-init if the cart totals are updated\n\t\t\t$( document.body ).on 'updated_cart_totals', =>\n\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Initializes the checkout page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_checkout_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-checkout' )\n\n\t\t\t$( document.body ).on 'updated_checkout', =>\n\n\t\t\t\t# re-init if the checkout is updated\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Gets a new Apple Pay session.\n\t\t#\n\t\t# @since 5.6.0\n\t\t#\n\t\t# @param [Object] payment_request payment request object\n\t\t# @return ApplePaySession\n\t\tget_new_session: ( payment_request ) ->\n\n\t\t\treturn new ApplePaySession( this.get_sdk_version(), payment_request )\n\n\n\t\t# Gets the Apple SDK version to use.\n\t\t#\n\t\t# @since 5.6.0\n\t\t# @return int\n\t\tget_sdk_version: ->\n\n\t\t\treturn 2\n\n\n\t\t# The callback for after the merchant data is validated.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_validate_merchant: ( event ) =>\n\n\t\t\tthis.validate_merchant( event.validationURL ).then ( merchant_session ) =>\n\n\t\t\t\tmerchant_session = JSON.parse( merchant_session )\n\n\t\t\t\t@session.completeMerchantValidation( merchant_session )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\t@session.abort()\n\n\t\t\t\tthis.fail_payment 'Merchant could no be validated. ' + response.message\n\n\n\t\t# Validates the merchant data.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return object\n\t\tvalidate_merchant: ( url ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_validate_merchant\",\n\t\t\t\t'nonce': @validate_nonce,\n\t\t\t\t'merchant_id': @merchant_id,\n\t\t\t\t'url': url\n\t\t\t}\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Fires after a payment method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completePaymentMethodSelection( data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completePaymentMethodSelection( @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping contact has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_contact_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'contact': event.shippingContact\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingContactSelection( ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingContactSelection( ApplePaySession.STATUS_FAILURE, [], @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'method': event.shippingMethod.identifier\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingMethodSelection( ApplePaySession.STATUS_SUCCESS, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping method. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingMethodSelection( ApplePaySession.STATUS_FAILURE, @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# The callback for after the payment data is authorized.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_authorized: ( event ) =>\n\n\t\t\tthis.process_authorization( event.payment ).then ( response ) =>\n\n\t\t\t\tthis.set_payment_status( true )\n\n\t\t\t\tthis.complete_purchase( response )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tthis.set_payment_status( false )\n\n\t\t\t\tthis.fail_payment 'Payment could no be processed. ' + response.message\n\n\n\t\t# Processes the transaction data.\n\t\t#\n\t\t# @since 4.7.0\n\t\tprocess_authorization: ( payment ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\taction: \"wc_#{ @gateway_id }_apple_pay_process_payment\",\n\t\t\t\tnonce: @process_nonce,\n\t\t\t\tpayment: JSON.stringify( payment )\n\t\t\t}\n\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# The callback for when the payment card is cancelled/dismissed.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_cancel_payment: ( event ) =>\n\n\t\t\tthis.unblock_ui()\n\n\n\t\t# Completes the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tcomplete_purchase: ( response ) ->\n\n\t\t\twindow.location = response.redirect\n\n\n\t\t# Fails the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tfail_payment: ( error ) ->\n\n\t\t\tconsole.error '[Apple Pay] ' + error\n\n\t\t\tthis.unblock_ui()\n\n\t\t\tthis.render_errors( [ @generic_error ] )\n\n\n\t\t# Sets the Apple Pay payment status depending on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tset_payment_status: ( success ) ->\n\n\t\t\tif success\n\t\t\t\tstatus = ApplePaySession.STATUS_SUCCESS\n\t\t\telse\n\t\t\t\tstatus = ApplePaySession.STATUS_FAILURE\n\n\t\t\t@session.completePayment( status )\n\n\n\t\t# Resets the payment request via AJAX.\n\t\t#\n\t\t# Extending handlers can call this on change events to refresh the data.\n\t\t#\n\t\t# @since 4.7.0\n\t\treset_payment_request: ( data = {} ) =>\n\n\t\t\tthis.block_ui()\n\n\t\t\tthis.get_payment_request( data ).then ( response ) =>\n\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t\t@payment_request = JSON.parse( response )\n\n\t\t\t\tthis.unblock_ui()\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tconsole.error '[Apple Pay] Could not build payment request. ' + response.message\n\n\t\t\t\t$( @button ).hide()\n\t\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\t\tif $( @container ).children().length is 1\n\t\t\t\t\t$( @wrapper ).hide()\n\n\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Gets the payment request via AJAX.\n\t\t#\n\t\t# @since 4.7.0\n\t\tget_payment_request: ( data ) => new Promise ( resolve, reject ) =>\n\n\t\t\tbase_data = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_get_payment_request\"\n\t\t\t}\n\n\t\t\t$.extend data, base_data\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Renders any new errors and bring them into the viewport.\n\t\t#\n\t\t# @since 4.7.0\n\t\trender_errors: ( errors ) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@ui_element.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@ui_element.removeClass( 'processing' ).unblock()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @ui_element.offset().top - 100 }, 1000 )\n\n\n\t\t# Blocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tblock_ui: -> @ui_element.block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tunblock_ui: -> @ui_element.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_10_5_loaded' )\n"]}
1
+ {"version":3,"sources":["frontend/sv-wc-payment-gateway-apple-pay.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAEH,OAAO,SAAE,GAAF,aAibN,OA1aM,OAAO,gCAAP,WAMS,SAAA,EAAA,GAAD,EAAA,KAAA,GAoFb,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAQA,KAAA,eAAA,KAAA,eAAA,KAAA,MAaA,KAAA,mBAAA,KAAA,mBAAA,KAAA,MAiCA,KAAA,qBAAA,KAAA,qBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAqBA,KAAA,2BAAA,KAAA,2BAAA,KAAA,MA4BA,KAAA,6BAAA,KAAA,6BAAA,KAAA,MA6BA,KAAA,4BAAA,KAAA,4BAAA,KAAA,MA6BA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAkBA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MA2CA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,oBAAA,KAAA,oBAAA,KAAA,MA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,KAAK,MAAO,GAE/B,EAAK,cAEJ,SAAE,GASH,OAPA,QAAQ,MAAM,gDAAkD,EAAS,SAEzE,EAAG,EAAC,QAAS,OAE2B,IAArC,EAAG,EAAC,WAAY,WAAW,QAC7B,EAAG,EAAC,SAAU,OAEf,EAAK,iBApXF,CAAA,IAAA,sBA0XkB,MAAA,SAAA,GAAF,IAAA,EAAA,KAAY,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1D,IAAA,EAOG,OAPA,EAAY,CACM,OAAA,MAAA,OAAA,EAAC,WAAlB,mCAGD,EAAE,OAAO,EAAM,GAGf,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,QACX,EAAQ,EAAS,MAEjB,EAAO,EAAS,YAxYd,CAAA,IAAA,gBA8YY,MAAA,SAAA,GAYhB,OATA,EAAG,4CAA6C,SAG/C,KAAA,WAAW,QAAQ,qCAAuC,EAAO,KAAM,aAAgB,cAGvF,KAAA,WAAW,YAAa,cAAe,UAGxC,EAAG,cAAe,QAAS,CAAE,UAAW,KAAC,WAAW,SAAS,IAAM,KAAO,OA1ZtE,CAAA,IAAA,WAgaK,MAAA,WAAG,OAAA,KAAC,WAAW,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QAhanF,CAAA,IAAA,aAsaO,MAAA,WAAG,OAAA,KAAC,WAAW,cAtatB,EAAA,GA0aN,EAAG,SAAS,MAAO,QAAS,8CAnb1B,KAAA","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\n\njQuery ( $ ) ->\n\n\t\"use strict\"\n\n\t# The WooCommerce Apple Pay handler base class.\n\t#\n\t# @since 4.7.0\n\tclass window.SV_WC_Apple_Pay_Handler_v5_10_7\n\n\n\t\t# Constructs the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tconstructor: (args) ->\n\n\t\t\t@gateway_id = args.gateway_id\n\t\t\t@gateway_slug = args.gateway_slug\n\t\t\t@merchant_id = args.merchant_id\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@validate_nonce = args.validate_nonce\n\t\t\t@recalculate_totals_nonce = args.recalculate_totals_nonce\n\t\t\t@process_nonce = args.process_nonce\n\t\t\t@payment_request = args.payment_request\n\t\t\t@generic_error = args.generic_error\n\n\t\t\t@wrapper = '.sv-wc-external-checkout'\n\t\t\t@container = '.buttons-container'\n\t\t\t@button = '.sv-wc-apple-pay-button'\n\n\n\t\t# Determines if Apple Pay is available.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return bool\n\t\tis_available: ->\n\n\t\t\treturn false unless window.ApplePaySession\n\n\t\t\tApplePaySession.canMakePaymentsWithActiveCard( @merchant_id ).then ( canMakePayments ) =>\n\n\t\t\t\treturn canMakePayments\n\n\n\t\t# Initializes the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tinit: ->\n\n\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\tif $( @container ).children().length is 1\n\t\t\t\t$( @wrapper ).hide()\n\n\t\t\treturn unless this.is_available()\n\n\t\t\t# initialize for the various pages\n\t\t\tif $( 'form.cart' ).length\n\t\t\t\tthis.init_product_page()\n\t\t\telse if $( 'form.woocommerce-cart-form' ).length\n\t\t\t\tthis.init_cart_page()\n\t\t\telse if $( 'form.woocommerce-checkout' ).length\n\t\t\t\tthis.init_checkout_page()\n\n\t\t\t# bail if no UI was initialized\n\t\t\treturn unless @ui_element\n\n\t\t\tif @payment_request\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t$( document.body ).on 'click', '.sv-wc-apple-pay-button', ( e ) =>\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\tthis.block_ui()\n\n\t\t\t\ttry\n\n\t\t\t\t\t@session = this.get_new_session( @payment_request )\n\n\t\t\t\t\t# set the payment card events\n\t\t\t\t\t@session.onvalidatemerchant = ( event ) => this.on_validate_merchant( event )\n\t\t\t\t\t@session.onpaymentmethodselected = ( event ) => this.on_payment_method_selected( event )\n\t\t\t\t\t@session.onshippingcontactselected = ( event ) => this.on_shipping_contact_selected( event )\n\t\t\t\t\t@session.onshippingmethodselected = ( event ) => this.on_shipping_method_selected( event )\n\t\t\t\t\t@session.onpaymentauthorized = ( event ) => this.on_payment_authorized( event )\n\t\t\t\t\t@session.oncancel = ( event ) => this.on_cancel_payment( event )\n\n\t\t\t\t\t@session.begin()\n\n\t\t\t\tcatch error\n\n\t\t\t\t\tthis.fail_payment( error )\n\n\n\t\t# Initializes the product page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_product_page: =>\n\n\t\t\t@ui_element = $( 'form.cart' )\n\n\n\t\t# Initializes the cart page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_cart_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' )\n\n\t\t\t# re-init if the cart totals are updated\n\t\t\t$( document.body ).on 'updated_cart_totals', =>\n\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Initializes the checkout page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_checkout_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-checkout' )\n\n\t\t\t$( document.body ).on 'updated_checkout', =>\n\n\t\t\t\t# re-init if the checkout is updated\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Gets a new Apple Pay session.\n\t\t#\n\t\t# @since 5.6.0\n\t\t#\n\t\t# @param [Object] payment_request payment request object\n\t\t# @return ApplePaySession\n\t\tget_new_session: ( payment_request ) ->\n\n\t\t\treturn new ApplePaySession( this.get_sdk_version(), payment_request )\n\n\n\t\t# Gets the Apple SDK version to use.\n\t\t#\n\t\t# @since 5.6.0\n\t\t# @return int\n\t\tget_sdk_version: ->\n\n\t\t\treturn 2\n\n\n\t\t# The callback for after the merchant data is validated.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_validate_merchant: ( event ) =>\n\n\t\t\tthis.validate_merchant( event.validationURL ).then ( merchant_session ) =>\n\n\t\t\t\tmerchant_session = JSON.parse( merchant_session )\n\n\t\t\t\t@session.completeMerchantValidation( merchant_session )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\t@session.abort()\n\n\t\t\t\tthis.fail_payment 'Merchant could no be validated. ' + response.message\n\n\n\t\t# Validates the merchant data.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return object\n\t\tvalidate_merchant: ( url ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_validate_merchant\",\n\t\t\t\t'nonce': @validate_nonce,\n\t\t\t\t'merchant_id': @merchant_id,\n\t\t\t\t'url': url\n\t\t\t}\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Fires after a payment method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completePaymentMethodSelection( data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completePaymentMethodSelection( @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping contact has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_contact_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'contact': event.shippingContact\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingContactSelection( ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingContactSelection( ApplePaySession.STATUS_FAILURE, [], @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'method': event.shippingMethod.identifier\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingMethodSelection( ApplePaySession.STATUS_SUCCESS, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping method. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingMethodSelection( ApplePaySession.STATUS_FAILURE, @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# The callback for after the payment data is authorized.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_authorized: ( event ) =>\n\n\t\t\tthis.process_authorization( event.payment ).then ( response ) =>\n\n\t\t\t\tthis.set_payment_status( true )\n\n\t\t\t\tthis.complete_purchase( response )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tthis.set_payment_status( false )\n\n\t\t\t\tthis.fail_payment 'Payment could no be processed. ' + response.message\n\n\n\t\t# Processes the transaction data.\n\t\t#\n\t\t# @since 4.7.0\n\t\tprocess_authorization: ( payment ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\taction: \"wc_#{ @gateway_id }_apple_pay_process_payment\",\n\t\t\t\tnonce: @process_nonce,\n\t\t\t\tpayment: JSON.stringify( payment )\n\t\t\t}\n\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# The callback for when the payment card is cancelled/dismissed.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_cancel_payment: ( event ) =>\n\n\t\t\tthis.unblock_ui()\n\n\n\t\t# Completes the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tcomplete_purchase: ( response ) ->\n\n\t\t\twindow.location = response.redirect\n\n\n\t\t# Fails the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tfail_payment: ( error ) ->\n\n\t\t\tconsole.error '[Apple Pay] ' + error\n\n\t\t\tthis.unblock_ui()\n\n\t\t\tthis.render_errors( [ @generic_error ] )\n\n\n\t\t# Sets the Apple Pay payment status depending on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tset_payment_status: ( success ) ->\n\n\t\t\tif success\n\t\t\t\tstatus = ApplePaySession.STATUS_SUCCESS\n\t\t\telse\n\t\t\t\tstatus = ApplePaySession.STATUS_FAILURE\n\n\t\t\t@session.completePayment( status )\n\n\n\t\t# Resets the payment request via AJAX.\n\t\t#\n\t\t# Extending handlers can call this on change events to refresh the data.\n\t\t#\n\t\t# @since 4.7.0\n\t\treset_payment_request: ( data = {} ) =>\n\n\t\t\tthis.block_ui()\n\n\t\t\tthis.get_payment_request( data ).then ( response ) =>\n\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t\t@payment_request = JSON.parse( response )\n\n\t\t\t\tthis.unblock_ui()\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tconsole.error '[Apple Pay] Could not build payment request. ' + response.message\n\n\t\t\t\t$( @button ).hide()\n\t\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\t\tif $( @container ).children().length is 1\n\t\t\t\t\t$( @wrapper ).hide()\n\n\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Gets the payment request via AJAX.\n\t\t#\n\t\t# @since 4.7.0\n\t\tget_payment_request: ( data ) => new Promise ( resolve, reject ) =>\n\n\t\t\tbase_data = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_get_payment_request\"\n\t\t\t}\n\n\t\t\t$.extend data, base_data\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Renders any new errors and bring them into the viewport.\n\t\t#\n\t\t# @since 4.7.0\n\t\trender_errors: ( errors ) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@ui_element.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@ui_element.removeClass( 'processing' ).unblock()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @ui_element.offset().top - 100 }, 1000 )\n\n\n\t\t# Blocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tblock_ui: -> @ui_element.block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tunblock_ui: -> @ui_element.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_10_7_loaded' )\n"]}
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js CHANGED
@@ -1,4 +1,4 @@
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"O8A1":[function(require,module,exports) {
2
- function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}jQuery(function(t){"use strict";window.SV_WC_Google_Pay_Handler_v5_10_5=function(){function n(t){e(this,n);var a=t.plugin_id,o=t.merchant_id,i=t.merchant_name,r=t.gateway_id,s=(t.gateway_id_dasherized,t.ajax_url),c=t.recalculate_totals_nonce,l=t.process_nonce,u=t.button_style,d=t.card_types,h=t.available_countries,m=t.currency_code,y=t.needs_shipping,g=t.generic_error;this.gatewayID=r,this.merchantID=o,this.merchantName=i,this.ajaxURL=s,this.recalculateTotalsNonce=c,this.processNonce=l,this.buttonStyle=u,this.availableCountries=h,this.currencyCode=m,this.needsShipping=y,this.genericError=g,t.product_id&&(this.productID=t.product_id);var p=d;this.baseRequest={apiVersion:2,apiVersionMinor:0};var f={type:"PAYMENT_GATEWAY",parameters:{gateway:a,gatewayMerchantId:this.merchantID}};this.baseCardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:p,billingAddressRequired:!0,billingAddressParameters:{format:"FULL",phoneNumberRequired:!0}}},this.cardPaymentMethod=Object.assign({},this.baseCardPaymentMethod,{tokenizationSpecification:f}),this.paymentsClient=null}return a(n,[{key:"getGoogleIsReadyToPayRequest",value:function(){return Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.baseCardPaymentMethod]})}},{key:"getGooglePaymentDataRequest",value:function(e){var t=this;return this.getGoogleTransactionInfo(function(a){var n=Object.assign({},t.baseRequest);n.allowedPaymentMethods=[t.cardPaymentMethod],n.transactionInfo=a,n.merchantInfo={merchantId:t.merchantID,merchantName:t.merchantName},n.emailRequired=!0,n.callbackIntents=["PAYMENT_AUTHORIZATION"],t.needsShipping&&(n.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"],n.shippingAddressRequired=!0,n.shippingAddressParameters=t.getGoogleShippingAddressParameters(),n.shippingOptionRequired=!0),e(n)})}},{key:"getGooglePaymentsClient",value:function(){var e=this;if(null===this.paymentsClient){var t={merchantInfo:{merchantName:this.merchantName,merchantId:this.merchantID},paymentDataCallbacks:{onPaymentAuthorized:function(t){return e.onPaymentAuthorized(t)}}};this.needsShipping&&(t.paymentDataCallbacks.onPaymentDataChanged=function(t){return e.onPaymentDataChanged(t)}),this.paymentsClient=new google.payments.api.PaymentsClient(t)}return this.paymentsClient}},{key:"onPaymentAuthorized",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{t.processPayment(e,a)}catch(o){n({transactionState:"ERROR",error:{intent:"PAYMENT_AUTHORIZATION",message:"Payment could not be processed",reason:"PAYMENT_DATA_INVALID"}})}t.unblockUI()})}},{key:"onPaymentDataChanged",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{var o=e.shippingAddress,i=e.shippingOptionData,r="";"SHIPPING_OPTION"==e.callbackTrigger&&(r=i.id),t.getUpdatedTotals(o,r,function(e){0==e.newShippingOptionParameters.shippingOptions.length&&(e={error:t.getGoogleUnserviceableAddressError()}),a(e)})}catch(s){t.failPayment("Could not load updated totals or process payment data request update. "+s)}t.unblockUI()})}},{key:"getGoogleTransactionInfo",value:function(e){var a=this,n={action:"wc_".concat(this.gatewayID,"_google_pay_get_transaction_info")};this.productID&&(n.productID=this.productID),t.post(this.ajaxURL,n,function(t){t.success?e(JSON.parse(t.data)):a.failPayment("Could not build transaction info. "+t.data.message)})}},{key:"getUpdatedTotals",value:function(e,a,n){var o=this,i={action:"wc_".concat(this.gatewayID,"_google_pay_recalculate_totals"),nonce:this.recalculateTotalsNonce,shippingAddress:e,shippingMethod:a};this.productID&&(i.productID=this.productID),t.post(this.ajaxURL,i,function(e){e.success?n(JSON.parse(e.data)):o.failPayment("Could not recalculate totals. "+e.data.message)})}},{key:"getGoogleShippingAddressParameters",value:function(){return{allowedCountryCodes:this.availableCountries}}},{key:"getGoogleUnserviceableAddressError",value:function(){return{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:"Cannot ship to the selected address",intent:"SHIPPING_ADDRESS"}}},{key:"addGooglePayButton",value:function(){var e=this,t=this.getGooglePaymentsClient().createButton({onClick:function(t){return e.onGooglePaymentButtonClicked(t)},buttonColor:this.buttonStyle,buttonSizeMode:"fill"});document.getElementById("sv-wc-google-pay-button-container").appendChild(t)}},{key:"prefetchGooglePaymentData",value:function(){var e=this;this.getGooglePaymentDataRequest(function(t){t.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:e.currencyCode},e.getGooglePaymentsClient().prefetchPaymentData(t)})}},{key:"processPayment",value:function(e,a){var n=this,o={action:"wc_".concat(this.gatewayID,"_google_pay_process_payment"),nonce:this.processNonce,paymentData:JSON.stringify(e)};return this.productID&&!this.needsShipping&&(o.productID=this.productID),t.post(this.ajaxURL,o,function(e){e.success?(a({transactionState:"SUCCESS"}),window.location=e.data.redirect):(a({transactionState:"ERROR",error:{intent:"SHIPPING_ADDRESS",message:"Invalid data",reason:"PAYMENT_DATA_INVALID"}}),n.failPayment("Payment could not be processed. "+e.data.message))})}},{key:"onGooglePaymentButtonClicked",value:function(e){var t=this;e.preventDefault(),this.blockUI(),this.getGooglePaymentDataRequest(function(e){var a=t.getGooglePaymentsClient();try{a.loadPaymentData(e)}catch(n){t.failPayment("Could not load payment data. "+n)}t.unblockUI()})}},{key:"init",value:function(){if(t("form.cart").length)this.initProductPage();else if(t("form.woocommerce-cart-form").length)this.initCartPage();else{if(!t("form.woocommerce-checkout").length)return;this.initCheckoutPage()}this.initGooglePay()}},{key:"initGooglePay",value:function(){var e=this;this.getGooglePaymentsClient().isReadyToPay(this.getGoogleIsReadyToPayRequest()).then(function(t){t.result&&(e.addGooglePayButton(),e.prefetchGooglePaymentData())}).catch(function(t){e.failPayment("Google Pay is not ready. "+t)})}},{key:"initProductPage",value:function(){this.uiElement=t("form.cart")}},{key:"initCartPage",value:function(){var e=this;this.uiElement=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){e.initGooglePay()})}},{key:"initCheckoutPage",value:function(){this.uiElement=t("form.woocommerce-checkout")}},{key:"failPayment",value:function(e){console.error("[Google Pay] "+e),this.unblockUI(),this.renderErrors([this.genericError])}},{key:"renderErrors",value:function(e){t(".woocommerce-error, .woocommerce-message").remove(),this.uiElement.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.uiElement.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.uiElement.offset().top-100},1e3)}},{key:"blockUI",value:function(){this.uiElement.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblockUI",value:function(){this.uiElement.unblock()}}]),n}(),t(document.body).trigger("sv_wc_google_pay_handler_v5_10_5_loaded")});
3
  },{}]},{},["O8A1"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-google-pay.js.map
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"O8A1":[function(require,module,exports) {
2
+ function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}jQuery(function(t){"use strict";window.SV_WC_Google_Pay_Handler_v5_10_7=function(){function n(t){e(this,n);var a=t.plugin_id,o=t.merchant_id,i=t.merchant_name,r=t.gateway_id,s=(t.gateway_id_dasherized,t.ajax_url),c=t.recalculate_totals_nonce,l=t.process_nonce,u=t.button_style,d=t.card_types,h=t.available_countries,m=t.currency_code,y=t.needs_shipping,g=t.generic_error;this.gatewayID=r,this.merchantID=o,this.merchantName=i,this.ajaxURL=s,this.recalculateTotalsNonce=c,this.processNonce=l,this.buttonStyle=u,this.availableCountries=h,this.currencyCode=m,this.needsShipping=y,this.genericError=g,t.product_id&&(this.productID=t.product_id);var p=d;this.baseRequest={apiVersion:2,apiVersionMinor:0};var f={type:"PAYMENT_GATEWAY",parameters:{gateway:a,gatewayMerchantId:this.merchantID}};this.baseCardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:p,billingAddressRequired:!0,billingAddressParameters:{format:"FULL",phoneNumberRequired:!0}}},this.cardPaymentMethod=Object.assign({},this.baseCardPaymentMethod,{tokenizationSpecification:f}),this.paymentsClient=null}return a(n,[{key:"getGoogleIsReadyToPayRequest",value:function(){return Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.baseCardPaymentMethod]})}},{key:"getGooglePaymentDataRequest",value:function(e){var t=this;return this.getGoogleTransactionInfo(function(a){var n=Object.assign({},t.baseRequest);n.allowedPaymentMethods=[t.cardPaymentMethod],n.transactionInfo=a,n.merchantInfo={merchantId:t.merchantID,merchantName:t.merchantName},n.emailRequired=!0,n.callbackIntents=["PAYMENT_AUTHORIZATION"],t.needsShipping&&(n.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"],n.shippingAddressRequired=!0,n.shippingAddressParameters=t.getGoogleShippingAddressParameters(),n.shippingOptionRequired=!0),e(n)})}},{key:"getGooglePaymentsClient",value:function(){var e=this;if(null===this.paymentsClient){var t={merchantInfo:{merchantName:this.merchantName,merchantId:this.merchantID},paymentDataCallbacks:{onPaymentAuthorized:function(t){return e.onPaymentAuthorized(t)}}};this.needsShipping&&(t.paymentDataCallbacks.onPaymentDataChanged=function(t){return e.onPaymentDataChanged(t)}),this.paymentsClient=new google.payments.api.PaymentsClient(t)}return this.paymentsClient}},{key:"onPaymentAuthorized",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{t.processPayment(e,a)}catch(o){n({transactionState:"ERROR",error:{intent:"PAYMENT_AUTHORIZATION",message:"Payment could not be processed",reason:"PAYMENT_DATA_INVALID"}})}t.unblockUI()})}},{key:"onPaymentDataChanged",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{var o=e.shippingAddress,i=e.shippingOptionData,r="";"SHIPPING_OPTION"==e.callbackTrigger&&(r=i.id),t.getUpdatedTotals(o,r,function(e){0==e.newShippingOptionParameters.shippingOptions.length&&(e={error:t.getGoogleUnserviceableAddressError()}),a(e)})}catch(s){t.failPayment("Could not load updated totals or process payment data request update. "+s)}t.unblockUI()})}},{key:"getGoogleTransactionInfo",value:function(e){var a=this,n={action:"wc_".concat(this.gatewayID,"_google_pay_get_transaction_info")};this.productID&&(n.productID=this.productID),t.post(this.ajaxURL,n,function(t){t.success?e(JSON.parse(t.data)):a.failPayment("Could not build transaction info. "+t.data.message)})}},{key:"getUpdatedTotals",value:function(e,a,n){var o=this,i={action:"wc_".concat(this.gatewayID,"_google_pay_recalculate_totals"),nonce:this.recalculateTotalsNonce,shippingAddress:e,shippingMethod:a};this.productID&&(i.productID=this.productID),t.post(this.ajaxURL,i,function(e){e.success?n(JSON.parse(e.data)):o.failPayment("Could not recalculate totals. "+e.data.message)})}},{key:"getGoogleShippingAddressParameters",value:function(){return{allowedCountryCodes:this.availableCountries}}},{key:"getGoogleUnserviceableAddressError",value:function(){return{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:"Cannot ship to the selected address",intent:"SHIPPING_ADDRESS"}}},{key:"addGooglePayButton",value:function(){var e=this,t=this.getGooglePaymentsClient().createButton({onClick:function(t){return e.onGooglePaymentButtonClicked(t)},buttonColor:this.buttonStyle,buttonSizeMode:"fill"});document.getElementById("sv-wc-google-pay-button-container").appendChild(t)}},{key:"prefetchGooglePaymentData",value:function(){var e=this;this.getGooglePaymentDataRequest(function(t){t.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:e.currencyCode},e.getGooglePaymentsClient().prefetchPaymentData(t)})}},{key:"processPayment",value:function(e,a){var n=this,o={action:"wc_".concat(this.gatewayID,"_google_pay_process_payment"),nonce:this.processNonce,paymentData:JSON.stringify(e)};return this.productID&&!this.needsShipping&&(o.productID=this.productID),t.post(this.ajaxURL,o,function(e){e.success?(a({transactionState:"SUCCESS"}),window.location=e.data.redirect):(a({transactionState:"ERROR",error:{intent:"SHIPPING_ADDRESS",message:"Invalid data",reason:"PAYMENT_DATA_INVALID"}}),n.failPayment("Payment could not be processed. "+e.data.message))})}},{key:"onGooglePaymentButtonClicked",value:function(e){var t=this;e.preventDefault(),this.blockUI(),this.getGooglePaymentDataRequest(function(e){var a=t.getGooglePaymentsClient();try{a.loadPaymentData(e)}catch(n){t.failPayment("Could not load payment data. "+n)}t.unblockUI()})}},{key:"init",value:function(){if(t("form.cart").length)this.initProductPage();else if(t("form.woocommerce-cart-form").length)this.initCartPage();else{if(!t("form.woocommerce-checkout").length)return;this.initCheckoutPage()}this.initGooglePay()}},{key:"initGooglePay",value:function(){var e=this;this.getGooglePaymentsClient().isReadyToPay(this.getGoogleIsReadyToPayRequest()).then(function(t){t.result&&(e.addGooglePayButton(),e.prefetchGooglePaymentData())}).catch(function(t){e.failPayment("Google Pay is not ready. "+t)})}},{key:"initProductPage",value:function(){this.uiElement=t("form.cart")}},{key:"initCartPage",value:function(){var e=this;this.uiElement=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){e.initGooglePay()})}},{key:"initCheckoutPage",value:function(){this.uiElement=t("form.woocommerce-checkout")}},{key:"failPayment",value:function(e){console.error("[Google Pay] "+e),this.unblockUI(),this.renderErrors([this.genericError])}},{key:"renderErrors",value:function(e){t(".woocommerce-error, .woocommerce-message").remove(),this.uiElement.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.uiElement.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.uiElement.offset().top-100},1e3)}},{key:"blockUI",value:function(){this.uiElement.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblockUI",value:function(){this.uiElement.unblock()}}]),n}(),t(document.body).trigger("sv_wc_google_pay_handler_v5_10_7_loaded")});
3
  },{}]},{},["O8A1"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-google-pay.js.map
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_10_5","params","plugin_id","merchant_id","merchant_name","gateway_id","ajax_url","gateway_id_dasherized","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","merchantID","merchantName","ajaxURL","recalculateTotalsNonce","processNonce","buttonStyle","availableCountries","currencyCode","needsShipping","genericError","product_id","productID","allowedCardNetworks","baseRequest","apiVersion","apiVersionMinor","allowedCardAuthMethods","tokenizationSpecification","type","parameters","baseCardPaymentMethod","allowedAuthMethods","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","cardPaymentMethod","Object","assign","paymentsClient","allowedPaymentMethods","resolve","getGoogleTransactionInfo","transactionInfo","paymentDataRequest","merchantInfo","merchantId","emailRequired","callbackIntents","shippingAddressRequired","shippingAddressParameters","getGoogleShippingAddressParameters","shippingOptionRequired","args","paymentDataCallbacks","onPaymentAuthorized","paymentData","onPaymentDataChanged","google","payments","api","PaymentsClient","blockUI","Promise","reject","processPayment","err","transactionState","error","intent","message","reason","unblockUI","intermediatePaymentData","shippingAddress","shippingOptionData","chosenShippingMethod","callbackTrigger","id","getUpdatedTotals","paymentDataRequestUpdate","newShippingOptionParameters","shippingOptions","length","getGoogleUnserviceableAddressError","failPayment","data","action","post","response","success","JSON","parse","shippingMethod","allowedCountryCodes","button","getGooglePaymentsClient","createButton","onClick","event","onGooglePaymentButtonClicked","buttonColor","buttonSizeMode","document","getElementById","appendChild","getGooglePaymentDataRequest","totalPriceStatus","prefetchPaymentData","nonce","stringify","location","redirect","preventDefault","loadPaymentData","initProductPage","initCartPage","initCheckoutPage","initGooglePay","isReadyToPay","getGoogleIsReadyToPayRequest","then","result","addGooglePayButton","prefetchGooglePaymentData","catch","uiElement","parents","body","on","console","renderErrors","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger"],"mappings":";AAGA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,EAAAA,OAAQ,SAAUC,GAEjB,aASAC,OAAOC,iCAAP,WAwBcC,SAAAA,EAAAA,GAAS,EAAA,KAAA,GAGpBC,IAAAA,EAcGD,EAdHC,UACAC,EAaGF,EAbHE,YACAC,EAYGH,EAZHG,cACAC,EAWGJ,EAXHI,WAEAC,GASGL,EAVHM,sBAUGN,EATHK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,KAAKtB,0BACbuB,aAAc,KAAKC,gCAChCC,KAAM,SAAEhC,GACHA,EAASiC,SACb,EAAKC,qBAEL,EAAKC,+BAGNC,MAAO,SAAE3D,GACT,EAAKmB,YAAa,4BAA8BnB,OAzgBpD,CAAA,IAAA,kBAghBmB,MAAA,WACZ4D,KAAAA,UAAYvI,EAAG,eAjhBtB,CAAA,IAAA,eAuhBgB,MAAA,WAAA,IAAA,EAAA,KACTuI,KAAAA,UAAYvI,EAAG,8BAA+BwI,QAAS,mBAG5DxI,EAAGgH,SAASyB,MAAOC,GAAI,sBAAuB,WAC7C,EAAKX,oBA5hBR,CAAA,IAAA,mBAmiBoB,MAAA,WACbQ,KAAAA,UAAYvI,EAAG,+BApiBtB,CAAA,IAAA,cA0iBc6E,MAAAA,SAAAA,GAEZ8D,QAAQ9D,MAAO,gBAAkBA,GAE5BI,KAAAA,YAEA2D,KAAAA,aAAc,CAAE,KAAKhH,iBAhjB5B,CAAA,IAAA,eAsjBeiH,MAAAA,SAAAA,GAGb7I,EAAG,4CAA6C8I,SAG3CP,KAAAA,UAAUQ,QAAS,qCAAuCF,EAAOG,KAAM,aAAgB,cAGvFT,KAAAA,UAAUU,YAAa,cAAeC,UAG3ClJ,EAAG,cAAemJ,QAAS,CAAEC,UAAW,KAAKb,UAAUc,SAASC,IAAM,KAAO,OAlkB/E,CAAA,IAAA,UAwkBW,MAAA,WACJf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBa,MAAA,WACNnB,KAAAA,UAAUW,cAhlBjB,EAAA,GAolBAlJ,EAAGgH,SAASyB,MAAOkB,QAAS","file":"sv-wc-payment-gateway-google-pay.js","sourceRoot":"../js","sourcesContent":["/**\n * Version 5.10.5\n */\njQuery( function( $ ) {\n\n\t\"use strict\"\n\n\t/**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_10_5} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_10_5 = class SV_WC_Google_Pay_Handler_v5_10_5 {\n\n\t\t/**\n\t\t * Handler constructor.\n\t\t *\n\t\t * @since 5.10.0\n\t\t *\n\t\t * @param {Object} params The plugin ID\n\t\t * @param {string} params.plugin_id The plugin ID\n\t\t * @param {string} params.merchant_id The merchant ID\n\t\t * @param {string} params.merchant_name The site name\n\t\t * @param {string} params.gateway_id The gateway ID\n\t\t * @param {string} params.gateway_id_dasherized The gateway ID dasherized\n\t\t * @param {string} params.ajax_url The AJAX URL\n\t\t * @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action\n\t\t * @param {string} params.process_nonce Nonce for the process AJAX action\n\t\t * @param {string} params.button_style The button style\n\t\t * @param {string[]} params.card_types The supported card types\n\t\t * @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for\n\t\t * @param {string[]} params.currency_code WC configured currency\n\t\t * @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping\n\t\t * @param {string} params.generic_error The generic error message\n\t\t * @param {string} params.product_id The product ID if we are on a Product page\n\t\t */\n\t\tconstructor( params ) {\n\n\t\t\tlet {\n\t\t\t\tplugin_id,\n\t\t\t\tmerchant_id,\n\t\t\t\tmerchant_name,\n\t\t\t\tgateway_id,\n\t\t\t\tgateway_id_dasherized,\n\t\t\t\tajax_url,\n\t\t\t\trecalculate_totals_nonce,\n\t\t\t\tprocess_nonce,\n\t\t\t\tbutton_style,\n\t\t\t\tcard_types,\n\t\t\t\tavailable_countries,\n\t\t\t\tcurrency_code,\n\t\t\t\tneeds_shipping,\n\t\t\t\tgeneric_error\n\t\t\t} = params;\n\n\t\t\tthis.gatewayID = gateway_id;\n\t\t\tthis.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\n\t\t\tthis.ajaxURL = ajax_url;\n\t\t\tthis.recalculateTotalsNonce = recalculate_totals_nonce;\n\t\t\tthis.processNonce = process_nonce;\n\t\t\tthis.buttonStyle = button_style;\n\t\t\tthis.availableCountries = available_countries;\n\t\t\tthis.currencyCode = currency_code;\n\t\t\tthis.needsShipping = needs_shipping;\n\t\t\tthis.genericError = generic_error;\n\n\t\t\tif ( params.product_id ) {\n\t\t\t\tthis.productID = params.product_id;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tconst allowedCardNetworks = card_types;\n\n\t\t\t/**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */\n\t\t\tthis.baseRequest = {\n\t\t\t\tapiVersion: 2,\n\t\t\t\tapiVersionMinor: 0\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */\n\t\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\n\t\t\t/**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */\n\t\t\tconst tokenizationSpecification = {\n\t\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\t\tparameters: {\n\t\t\t\t\t'gateway': plugin_id,\n\t\t\t\t\t'gatewayMerchantId': this.merchantID\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.baseCardPaymentMethod = {\n\t\t\t\ttype: 'CARD',\n\t\t\t\tparameters: {\n\t\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\t\tbillingAddressRequired: true,\n\t\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\t\tformat: 'FULL',\n\t\t\t\t\t\tphoneNumberRequired: true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.cardPaymentMethod = Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseCardPaymentMethod,\n\t\t\t\t{\n\t\t\t\t\ttokenizationSpecification: tokenizationSpecification\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */\n\t\t\tthis.paymentsClient = null;\n\t\t}\n\n\t\t/**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */\n\t\tgetGoogleIsReadyToPayRequest() {\n\n\t\t\treturn Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseRequest,\n\t\t\t\t{\n\t\t\t\t\tallowedPaymentMethods: [ this.baseCardPaymentMethod ]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */\n\t\tgetGooglePaymentDataRequest( resolve ) {\n\n\t\t\treturn this.getGoogleTransactionInfo( ( transactionInfo ) => {\n\n\t\t\t\tconst paymentDataRequest = Object.assign( {}, this.baseRequest );\n\t\t\t\tpaymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];\n\t\t\t\tpaymentDataRequest.transactionInfo = transactionInfo;\n\t\t\t\tpaymentDataRequest.merchantInfo = {\n\t\t\t\t\tmerchantId: this.merchantID,\n\t\t\t\t\tmerchantName: this.merchantName\n\t\t\t\t};\n\n\t\t\t\tpaymentDataRequest.emailRequired = true;\n\t\t\t\tpaymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\tpaymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];\n\t\t\t\t\tpaymentDataRequest.shippingAddressRequired = true;\n\t\t\t\t\tpaymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();\n\t\t\t\t\tpaymentDataRequest.shippingOptionRequired = true;\n\t\t\t\t}\n\n\t\t\t\tresolve( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */\n\t\tgetGooglePaymentsClient() {\n\t\t\tif ( this.paymentsClient === null ) {\n\t\t\t\tlet args = {\n\t\t\t\t\tmerchantInfo: {\n\t\t\t\t\t\tmerchantName: this.merchantName,\n\t\t\t\t\t\tmerchantId: this.merchantID\n\t\t\t\t\t},\n\t\t\t\t\tpaymentDataCallbacks: {\n\t\t\t\t\t\tonPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\targs.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );\n\t\t\t\t}\n\n\t\t\t\tthis.paymentsClient = new google.payments.api.PaymentsClient( args );\n\t\t\t}\n\t\t\treturn this.paymentsClient;\n\t\t}\n\n\t\t/**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */\n\t\tonPaymentAuthorized( paymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise( (resolve, reject) => {\n\n\t\t\t\t// handle the response\n\t\t\t\ttry {\n\t\t\t\t\tthis.processPayment( paymentData, resolve );\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\treject( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'PAYMENT_AUTHORIZATION',\n\t\t\t\t\t\t\tmessage: 'Payment could not be processed',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */\n\t\tonPaymentDataChanged( intermediatePaymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise(( resolve, reject ) => {\n\n\t\t\t\ttry {\n\t\t\t\t\tlet shippingAddress = intermediatePaymentData.shippingAddress;\n\t\t\t\t\tlet shippingOptionData = intermediatePaymentData.shippingOptionData;\n\t\t\t\t\tlet chosenShippingMethod = '';\n\n\t\t\t\t\tif ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {\n\t\t\t\t\t\tchosenShippingMethod = shippingOptionData.id;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {\n\n\t\t\t\t\t\tif ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {\n\t\t\t\t\t\t\tpaymentDataRequestUpdate = {\n\t\t\t\t\t\t\t\terror: this.getGoogleUnserviceableAddressError()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( paymentDataRequestUpdate );\n\t\t\t\t\t} );\n\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load updated totals or process payment data request update. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleTransactionInfo( resolve ) {\n\n\t\t\t// get transaction info from cart\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_get_transaction_info`,\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not build transaction info. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tgetUpdatedTotals( shippingAddress, shippingMethod, resolve ) {\n\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_recalculate_totals`,\n\t\t\t\t'nonce': this.recalculateTotalsNonce,\n\t\t\t\tshippingAddress,\n\t\t\t\tshippingMethod\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not recalculate totals. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleShippingAddressParameters() {\n\n\t\t\treturn {\n\t\t\t\tallowedCountryCodes: this.availableCountries\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */\n\t\tgetGoogleUnserviceableAddressError() {\n\t\t\treturn {\n\t\t\t\treason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n\t\t\t\tmessage: 'Cannot ship to the selected address',\n\t\t\t\tintent: 'SHIPPING_ADDRESS'\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */\n\t\taddGooglePayButton() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tconst button = paymentsClient.createButton( {\n\t\t\t\tonClick: ( event ) => this.onGooglePaymentButtonClicked( event ),\n\t\t\t\tbuttonColor: this.buttonStyle,\n\t\t\t\tbuttonSizeMode: 'fill'\n\t\t\t} );\n\t\t\tdocument.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );\n\t\t}\n\n\t\t/**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */\n\t\tprefetchGooglePaymentData() {\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\t// transactionInfo must be set but does not affect cache\n\t\t\t\tpaymentDataRequest.transactionInfo = {\n\t\t\t\t\ttotalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n\t\t\t\t\tcurrencyCode: this.currencyCode\n\t\t\t\t};\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\tpaymentsClient.prefetchPaymentData( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tprocessPayment( paymentData, resolve ) {\n\n\t\t\t// pass payment token to your gateway to process payment\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_process_payment`,\n\t\t\t\tnonce: this.processNonce,\n\t\t\t\tpaymentData: JSON.stringify( paymentData ),\n\t\t\t}\n\n\t\t\tif ( this.productID && ! this.needsShipping ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\treturn $.post( this.ajaxURL, data, ( response ) => {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'SUCCESS'\n\t\t\t\t\t} );\n\t\t\t\t\twindow.location = response.data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'SHIPPING_ADDRESS',\n\t\t\t\t\t\t\tmessage: 'Invalid data',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tthis.failPayment( 'Payment could not be processed. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */\n\t\tonGooglePaymentButtonClicked( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.blockUI();\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\ttry {\n\t\t\t\t\tpaymentsClient.loadPaymentData( paymentDataRequest );\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load payment data. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */\n\t\tinit() {\n\n\t\t\t// initialize for the various pages\n\t\t\tif ( $( 'form.cart' ).length ) {\n\t\t\t\tthis.initProductPage();\n\t\t\t} else if ( $( 'form.woocommerce-cart-form' ).length ) {\n\t\t\t\tthis.initCartPage();\n\t\t\t} else if ( $( 'form.woocommerce-checkout' ).length) {\n\t\t\t\tthis.initCheckoutPage()\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.initGooglePay();\n\t\t}\n\n\t\t/**\n\t\t * Initializes Google Pay.\n\t\t */\n\t\tinitGooglePay() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tpaymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( response.result ) {\n\t\t\t\t\t\tthis.addGooglePayButton();\n\t\t\t\t\t\t// prefetch payment data to improve performance\n\t\t\t\t\t\tthis.prefetchGooglePaymentData();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tthis.failPayment( 'Google Pay is not ready. ' + err );\n\t\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the product page.\n\t\t */\n\t\tinitProductPage() {\n\t\t\tthis.uiElement = $( 'form.cart' );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the cart page.\n\t\t */\n\t\tinitCartPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );\n\n\t\t\t// re-init if the cart totals are updated\n\t\t\t$( document.body ).on( 'updated_cart_totals', () => {\n\t\t\t\tthis.initGooglePay();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the checkout page.\n\t\t */\n\t\tinitCheckoutPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-checkout' );\n\t\t}\n\n\t\t/**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */\n\t\tfailPayment( error ) {\n\n\t\t\tconsole.error( '[Google Pay] ' + error );\n\n\t\t\tthis.unblockUI();\n\n\t\t\tthis.renderErrors( [ this.genericError ] );\n\t\t}\n\n\t\t/**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */\n\t\trenderErrors( errors ) {\n\n\t\t\t// hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove();\n\n\t\t\t// add errors\n\t\t\tthis.uiElement.prepend( '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>' );\n\n\t\t\t// unblock UI\n\t\t\tthis.uiElement.removeClass( 'processing' ).unblock();\n\n\t\t\t// scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );\n\t\t}\n\n\t\t/**\n\t\t * Blocks the payment form UI.\n\t\t */\n\t\tblockUI() {\n\t\t\tthis.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );\n\t\t}\n\n\t\t/**\n\t\t * Unblocks the payment form UI.\n\t\t */\n\t\tunblockUI() {\n\t\t\tthis.uiElement.unblock();\n\t\t}\n\t}\n\n\t$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_5_loaded' );\n\n} );\n"]}
1
+ {"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_10_7","params","plugin_id","merchant_id","merchant_name","gateway_id","ajax_url","gateway_id_dasherized","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","merchantID","merchantName","ajaxURL","recalculateTotalsNonce","processNonce","buttonStyle","availableCountries","currencyCode","needsShipping","genericError","product_id","productID","allowedCardNetworks","baseRequest","apiVersion","apiVersionMinor","allowedCardAuthMethods","tokenizationSpecification","type","parameters","baseCardPaymentMethod","allowedAuthMethods","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","cardPaymentMethod","Object","assign","paymentsClient","allowedPaymentMethods","resolve","getGoogleTransactionInfo","transactionInfo","paymentDataRequest","merchantInfo","merchantId","emailRequired","callbackIntents","shippingAddressRequired","shippingAddressParameters","getGoogleShippingAddressParameters","shippingOptionRequired","args","paymentDataCallbacks","onPaymentAuthorized","paymentData","onPaymentDataChanged","google","payments","api","PaymentsClient","blockUI","Promise","reject","processPayment","err","transactionState","error","intent","message","reason","unblockUI","intermediatePaymentData","shippingAddress","shippingOptionData","chosenShippingMethod","callbackTrigger","id","getUpdatedTotals","paymentDataRequestUpdate","newShippingOptionParameters","shippingOptions","length","getGoogleUnserviceableAddressError","failPayment","data","action","post","response","success","JSON","parse","shippingMethod","allowedCountryCodes","button","getGooglePaymentsClient","createButton","onClick","event","onGooglePaymentButtonClicked","buttonColor","buttonSizeMode","document","getElementById","appendChild","getGooglePaymentDataRequest","totalPriceStatus","prefetchPaymentData","nonce","stringify","location","redirect","preventDefault","loadPaymentData","initProductPage","initCartPage","initCheckoutPage","initGooglePay","isReadyToPay","getGoogleIsReadyToPayRequest","then","result","addGooglePayButton","prefetchGooglePaymentData","catch","uiElement","parents","body","on","console","renderErrors","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger"],"mappings":";AAAA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA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Uc,SAASC,IAAM,KAAO,OAlkB/E,CAAA,IAAA,UAwkBW,MAAA,WACJf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBa,MAAA,WACNnB,KAAAA,UAAUW,cAhlBjB,EAAA,GAolBAlJ,EAAGgH,SAASyB,MAAOkB,QAAS","file":"sv-wc-payment-gateway-google-pay.js","sourceRoot":"../js","sourcesContent":["jQuery( function( $ ) {\n\n\t\"use strict\"\n\n\t/**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_10_7} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_10_7 = class SV_WC_Google_Pay_Handler_v5_10_7 {\n\n\t\t/**\n\t\t * Handler constructor.\n\t\t *\n\t\t * @since 5.10.0\n\t\t *\n\t\t * @param {Object} params The plugin ID\n\t\t * @param {string} params.plugin_id The plugin ID\n\t\t * @param {string} params.merchant_id The merchant ID\n\t\t * @param {string} params.merchant_name The site name\n\t\t * @param {string} params.gateway_id The gateway ID\n\t\t * @param {string} params.gateway_id_dasherized The gateway ID dasherized\n\t\t * @param {string} params.ajax_url The AJAX URL\n\t\t * @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action\n\t\t * @param {string} params.process_nonce Nonce for the process AJAX action\n\t\t * @param {string} params.button_style The button style\n\t\t * @param {string[]} params.card_types The supported card types\n\t\t * @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for\n\t\t * @param {string[]} params.currency_code WC configured currency\n\t\t * @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping\n\t\t * @param {string} params.generic_error The generic error message\n\t\t * @param {string} params.product_id The product ID if we are on a Product page\n\t\t */\n\t\tconstructor( params ) {\n\n\t\t\tlet {\n\t\t\t\tplugin_id,\n\t\t\t\tmerchant_id,\n\t\t\t\tmerchant_name,\n\t\t\t\tgateway_id,\n\t\t\t\tgateway_id_dasherized,\n\t\t\t\tajax_url,\n\t\t\t\trecalculate_totals_nonce,\n\t\t\t\tprocess_nonce,\n\t\t\t\tbutton_style,\n\t\t\t\tcard_types,\n\t\t\t\tavailable_countries,\n\t\t\t\tcurrency_code,\n\t\t\t\tneeds_shipping,\n\t\t\t\tgeneric_error\n\t\t\t} = params;\n\n\t\t\tthis.gatewayID = gateway_id;\n\t\t\tthis.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\n\t\t\tthis.ajaxURL = ajax_url;\n\t\t\tthis.recalculateTotalsNonce = recalculate_totals_nonce;\n\t\t\tthis.processNonce = process_nonce;\n\t\t\tthis.buttonStyle = button_style;\n\t\t\tthis.availableCountries = available_countries;\n\t\t\tthis.currencyCode = currency_code;\n\t\t\tthis.needsShipping = needs_shipping;\n\t\t\tthis.genericError = generic_error;\n\n\t\t\tif ( params.product_id ) {\n\t\t\t\tthis.productID = params.product_id;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tconst allowedCardNetworks = card_types;\n\n\t\t\t/**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */\n\t\t\tthis.baseRequest = {\n\t\t\t\tapiVersion: 2,\n\t\t\t\tapiVersionMinor: 0\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */\n\t\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\n\t\t\t/**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */\n\t\t\tconst tokenizationSpecification = {\n\t\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\t\tparameters: {\n\t\t\t\t\t'gateway': plugin_id,\n\t\t\t\t\t'gatewayMerchantId': this.merchantID\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.baseCardPaymentMethod = {\n\t\t\t\ttype: 'CARD',\n\t\t\t\tparameters: {\n\t\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\t\tbillingAddressRequired: true,\n\t\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\t\tformat: 'FULL',\n\t\t\t\t\t\tphoneNumberRequired: true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.cardPaymentMethod = Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseCardPaymentMethod,\n\t\t\t\t{\n\t\t\t\t\ttokenizationSpecification: tokenizationSpecification\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */\n\t\t\tthis.paymentsClient = null;\n\t\t}\n\n\t\t/**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */\n\t\tgetGoogleIsReadyToPayRequest() {\n\n\t\t\treturn Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseRequest,\n\t\t\t\t{\n\t\t\t\t\tallowedPaymentMethods: [ this.baseCardPaymentMethod ]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */\n\t\tgetGooglePaymentDataRequest( resolve ) {\n\n\t\t\treturn this.getGoogleTransactionInfo( ( transactionInfo ) => {\n\n\t\t\t\tconst paymentDataRequest = Object.assign( {}, this.baseRequest );\n\t\t\t\tpaymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];\n\t\t\t\tpaymentDataRequest.transactionInfo = transactionInfo;\n\t\t\t\tpaymentDataRequest.merchantInfo = {\n\t\t\t\t\tmerchantId: this.merchantID,\n\t\t\t\t\tmerchantName: this.merchantName\n\t\t\t\t};\n\n\t\t\t\tpaymentDataRequest.emailRequired = true;\n\t\t\t\tpaymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\tpaymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];\n\t\t\t\t\tpaymentDataRequest.shippingAddressRequired = true;\n\t\t\t\t\tpaymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();\n\t\t\t\t\tpaymentDataRequest.shippingOptionRequired = true;\n\t\t\t\t}\n\n\t\t\t\tresolve( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */\n\t\tgetGooglePaymentsClient() {\n\t\t\tif ( this.paymentsClient === null ) {\n\t\t\t\tlet args = {\n\t\t\t\t\tmerchantInfo: {\n\t\t\t\t\t\tmerchantName: this.merchantName,\n\t\t\t\t\t\tmerchantId: this.merchantID\n\t\t\t\t\t},\n\t\t\t\t\tpaymentDataCallbacks: {\n\t\t\t\t\t\tonPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\targs.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );\n\t\t\t\t}\n\n\t\t\t\tthis.paymentsClient = new google.payments.api.PaymentsClient( args );\n\t\t\t}\n\t\t\treturn this.paymentsClient;\n\t\t}\n\n\t\t/**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */\n\t\tonPaymentAuthorized( paymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise( (resolve, reject) => {\n\n\t\t\t\t// handle the response\n\t\t\t\ttry {\n\t\t\t\t\tthis.processPayment( paymentData, resolve );\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\treject( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'PAYMENT_AUTHORIZATION',\n\t\t\t\t\t\t\tmessage: 'Payment could not be processed',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */\n\t\tonPaymentDataChanged( intermediatePaymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise(( resolve, reject ) => {\n\n\t\t\t\ttry {\n\t\t\t\t\tlet shippingAddress = intermediatePaymentData.shippingAddress;\n\t\t\t\t\tlet shippingOptionData = intermediatePaymentData.shippingOptionData;\n\t\t\t\t\tlet chosenShippingMethod = '';\n\n\t\t\t\t\tif ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {\n\t\t\t\t\t\tchosenShippingMethod = shippingOptionData.id;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {\n\n\t\t\t\t\t\tif ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {\n\t\t\t\t\t\t\tpaymentDataRequestUpdate = {\n\t\t\t\t\t\t\t\terror: this.getGoogleUnserviceableAddressError()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( paymentDataRequestUpdate );\n\t\t\t\t\t} );\n\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load updated totals or process payment data request update. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleTransactionInfo( resolve ) {\n\n\t\t\t// get transaction info from cart\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_get_transaction_info`,\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not build transaction info. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tgetUpdatedTotals( shippingAddress, shippingMethod, resolve ) {\n\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_recalculate_totals`,\n\t\t\t\t'nonce': this.recalculateTotalsNonce,\n\t\t\t\tshippingAddress,\n\t\t\t\tshippingMethod\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not recalculate totals. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleShippingAddressParameters() {\n\n\t\t\treturn {\n\t\t\t\tallowedCountryCodes: this.availableCountries\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */\n\t\tgetGoogleUnserviceableAddressError() {\n\t\t\treturn {\n\t\t\t\treason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n\t\t\t\tmessage: 'Cannot ship to the selected address',\n\t\t\t\tintent: 'SHIPPING_ADDRESS'\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */\n\t\taddGooglePayButton() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tconst button = paymentsClient.createButton( {\n\t\t\t\tonClick: ( event ) => this.onGooglePaymentButtonClicked( event ),\n\t\t\t\tbuttonColor: this.buttonStyle,\n\t\t\t\tbuttonSizeMode: 'fill'\n\t\t\t} );\n\t\t\tdocument.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );\n\t\t}\n\n\t\t/**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */\n\t\tprefetchGooglePaymentData() {\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\t// transactionInfo must be set but does not affect cache\n\t\t\t\tpaymentDataRequest.transactionInfo = {\n\t\t\t\t\ttotalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n\t\t\t\t\tcurrencyCode: this.currencyCode\n\t\t\t\t};\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\tpaymentsClient.prefetchPaymentData( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tprocessPayment( paymentData, resolve ) {\n\n\t\t\t// pass payment token to your gateway to process payment\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_process_payment`,\n\t\t\t\tnonce: this.processNonce,\n\t\t\t\tpaymentData: JSON.stringify( paymentData ),\n\t\t\t}\n\n\t\t\tif ( this.productID && ! this.needsShipping ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\treturn $.post( this.ajaxURL, data, ( response ) => {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'SUCCESS'\n\t\t\t\t\t} );\n\t\t\t\t\twindow.location = response.data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'SHIPPING_ADDRESS',\n\t\t\t\t\t\t\tmessage: 'Invalid data',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tthis.failPayment( 'Payment could not be processed. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */\n\t\tonGooglePaymentButtonClicked( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.blockUI();\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\ttry {\n\t\t\t\t\tpaymentsClient.loadPaymentData( paymentDataRequest );\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load payment data. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */\n\t\tinit() {\n\n\t\t\t// initialize for the various pages\n\t\t\tif ( $( 'form.cart' ).length ) {\n\t\t\t\tthis.initProductPage();\n\t\t\t} else if ( $( 'form.woocommerce-cart-form' ).length ) {\n\t\t\t\tthis.initCartPage();\n\t\t\t} else if ( $( 'form.woocommerce-checkout' ).length) {\n\t\t\t\tthis.initCheckoutPage()\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.initGooglePay();\n\t\t}\n\n\t\t/**\n\t\t * Initializes Google Pay.\n\t\t */\n\t\tinitGooglePay() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tpaymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( response.result ) {\n\t\t\t\t\t\tthis.addGooglePayButton();\n\t\t\t\t\t\t// prefetch payment data to improve performance\n\t\t\t\t\t\tthis.prefetchGooglePaymentData();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tthis.failPayment( 'Google Pay is not ready. ' + err );\n\t\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the product page.\n\t\t */\n\t\tinitProductPage() {\n\t\t\tthis.uiElement = $( 'form.cart' );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the cart page.\n\t\t */\n\t\tinitCartPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );\n\n\t\t\t// re-init if the cart totals are updated\n\t\t\t$( document.body ).on( 'updated_cart_totals', () => {\n\t\t\t\tthis.initGooglePay();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the checkout page.\n\t\t */\n\t\tinitCheckoutPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-checkout' );\n\t\t}\n\n\t\t/**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */\n\t\tfailPayment( error ) {\n\n\t\t\tconsole.error( '[Google Pay] ' + error );\n\n\t\t\tthis.unblockUI();\n\n\t\t\tthis.renderErrors( [ this.genericError ] );\n\t\t}\n\n\t\t/**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */\n\t\trenderErrors( errors ) {\n\n\t\t\t// hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove();\n\n\t\t\t// add errors\n\t\t\tthis.uiElement.prepend( '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>' );\n\n\t\t\t// unblock UI\n\t\t\tthis.uiElement.removeClass( 'processing' ).unblock();\n\n\t\t\t// scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );\n\t\t}\n\n\t\t/**\n\t\t * Blocks the payment form UI.\n\t\t */\n\t\tblockUI() {\n\t\t\tthis.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );\n\t\t}\n\n\t\t/**\n\t\t * Unblocks the payment form UI.\n\t\t */\n\t\tunblockUI() {\n\t\t\tthis.uiElement.unblock();\n\t\t}\n\t}\n\n\t$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_7_loaded' );\n\n} );\n"]}
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js CHANGED
@@ -1,4 +1,4 @@
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"nDDW":[function(require,module,exports) {
2
- function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Payment_Methods_Handler_v5_10_5=function(){function i(n){var o=this;e(this,i),this.replace_method_column=this.replace_method_column.bind(this),this.remove_duplicate_default_marks=this.remove_duplicate_default_marks.bind(this),this.edit_method=this.edit_method.bind(this),this.save_method=this.save_method.bind(this),this.cancel_edit=this.cancel_edit.bind(this),this.id=n.id,this.slug=n.slug,this.i18n=n.i18n,this.ajax_url=n.ajax_url,this.ajax_nonce=n.ajax_nonce,this.replace_method_column(),this.remove_duplicate_default_marks(),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.edit",function(e){return o.edit_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.save",function(e){return o.save_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .cancel-edit",function(e){return o.cancel_edit(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.delete",function(e){if(0!==t(e.currentTarget).parents("tr").find("input[name=plugin-id][value=".concat(o.slug,"]")).length)return t(e.currentTarget).hasClass("disabled")||!confirm(o.i18n.delete_ays)?e.preventDefault():void 0}),t('.button[href*="add-payment-method"]').click(function(e){if(t(this).hasClass("disabled"))return e.preventDefault()})}return n(i,[{key:"replace_method_column",value:function(){var e=this;return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(n,i){var o;if(0!==t(i).find("input[name=plugin-id][value=".concat(e.slug,"]")).length)return t(i).find("th.woocommerce-PaymentMethod--title").remove(),(o=t(i).find("td.woocommerce-PaymentMethod--title")).children().length>0&&t(i).find("td.woocommerce-PaymentMethod--method").html(o.html()),t(i).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(e,n){return t(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").hide(),i.find("div.edit").show(),i.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(e){var n,i,o,a=this;if(e.preventDefault(),n=t(e.currentTarget),0!==(o=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),o.next(".error").remove(),i={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:o.find("input[name=token-id]").val(),data:o.find("input[name]").serialize()},t.post(this.ajax_url,i).done(function(e){return e.success?(null!=e.data.title&&o.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.nonce&&(a.ajax_nonce=e.data.nonce),n.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(a.i18n.edit_button).addClass("button"),a.disable_editing_ui()):a.display_error(o,e.data)}).fail(function(e,t,n){return a.display_error(o,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").show(),i.find("div.edit").hide(),i.removeClass("editing"),n.removeClass("cancel-edit").addClass("edit").text(this.i18n.edit_button).addClass("button"),this.disable_editing_ui()}},{key:"enable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").addClass("editing"),t('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),t('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),o||(o=this.i18n.save_error),i=t(".woocommerce-MyAccount-paymentMethods thead tr th").length,t('<tr class="error"><td colspan="'+i+'">'+o+"</td></tr>").insertAfter(e).find("td").delay(8e3).slideUp(200)}}]),i}(),t(document.body).trigger("sv_wc_payment_methods_handler_v5_10_5_loaded")})}).call(this);
3
  },{}]},{},["nDDW"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-my-payment-methods.js.map
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"nDDW":[function(require,module,exports) {
2
+ function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Payment_Methods_Handler_v5_10_7=function(){function i(n){var o=this;e(this,i),this.replace_method_column=this.replace_method_column.bind(this),this.remove_duplicate_default_marks=this.remove_duplicate_default_marks.bind(this),this.edit_method=this.edit_method.bind(this),this.save_method=this.save_method.bind(this),this.cancel_edit=this.cancel_edit.bind(this),this.id=n.id,this.slug=n.slug,this.i18n=n.i18n,this.ajax_url=n.ajax_url,this.ajax_nonce=n.ajax_nonce,this.replace_method_column(),this.remove_duplicate_default_marks(),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.edit",function(e){return o.edit_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.save",function(e){return o.save_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .cancel-edit",function(e){return o.cancel_edit(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.delete",function(e){if(0!==t(e.currentTarget).parents("tr").find("input[name=plugin-id][value=".concat(o.slug,"]")).length)return t(e.currentTarget).hasClass("disabled")||!confirm(o.i18n.delete_ays)?e.preventDefault():void 0}),t('.button[href*="add-payment-method"]').click(function(e){if(t(this).hasClass("disabled"))return e.preventDefault()})}return n(i,[{key:"replace_method_column",value:function(){var e=this;return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(n,i){var o;if(0!==t(i).find("input[name=plugin-id][value=".concat(e.slug,"]")).length)return t(i).find("th.woocommerce-PaymentMethod--title").remove(),(o=t(i).find("td.woocommerce-PaymentMethod--title")).children().length>0&&t(i).find("td.woocommerce-PaymentMethod--method").html(o.html()),t(i).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(e,n){return t(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").hide(),i.find("div.edit").show(),i.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(e){var n,i,o,a=this;if(e.preventDefault(),n=t(e.currentTarget),0!==(o=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),o.next(".error").remove(),i={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:o.find("input[name=token-id]").val(),data:o.find("input[name]").serialize()},t.post(this.ajax_url,i).done(function(e){return e.success?(null!=e.data.title&&o.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.nonce&&(a.ajax_nonce=e.data.nonce),n.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(a.i18n.edit_button).addClass("button"),a.disable_editing_ui()):a.display_error(o,e.data)}).fail(function(e,t,n){return a.display_error(o,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").show(),i.find("div.edit").hide(),i.removeClass("editing"),n.removeClass("cancel-edit").addClass("edit").text(this.i18n.edit_button).addClass("button"),this.disable_editing_ui()}},{key:"enable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").addClass("editing"),t('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),t('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),o||(o=this.i18n.save_error),i=t(".woocommerce-MyAccount-paymentMethods thead tr th").length,t('<tr class="error"><td colspan="'+i+'">'+o+"</td></tr>").insertAfter(e).find("td").delay(8e3).slideUp(200)}}]),i}(),t(document.body).trigger("sv_wc_payment_methods_handler_v5_10_7_loaded")})}).call(this);
3
  },{}]},{},["nDDW"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-my-payment-methods.js.map
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WACH,OAAO,SAAE,GAAF,aAsQN,OAhQM,OAAO,sCAAP,WAaU,SAAA,EAAA,GAAF,IAAA,EAAA,KAAA,EAAA,KAAA,GA8Cb,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,+BAAA,KAAA,+BAAA,KAAA,MAYA,KAAA,YAAA,KAAA,YAAA,KAAA,MA0BA,KAAA,YAAA,KAAA,YAAA,KAAA,MAqDA,KAAA,YAAA,KAAA,YAAA,KAAA,MAnKE,KAAA,GAAa,EAAK,GAClB,KAAA,KAAa,EAAK,KAClB,KAAA,KAAa,EAAK,KAClB,KAAA,SAAa,EAAK,SACl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AAO,YAAa,eAAgB,SAAU,QAAS,KAAM,KAAC,KAAK,aAAc,SAAU,UAE3F,KAAK,uBApMD,CAAA,IAAA,oBA6Mc,MAAA,WAMlB,OAHA,EAAG,yCAA0C,SAAU,WAGvD,EAAG,uCAAwC,SAAU,cAnNjD,CAAA,IAAA,qBAyNe,MAAA,WAMnB,OAHA,EAAG,yCAA0C,YAAa,WAG1D,EAAG,uCAAwC,YAAa,cA/NpD,CAAA,IAAA,WAqOK,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QArOpI,CAAA,IAAA,aA2OO,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,YA3OvE,CAAA,IAAA,gBAqPY,MAAA,SAAA,EAAK,GAAO,IAE/B,EAF+B,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAOtC,OALA,QAAQ,MAAO,GAEmB,IAAlC,EAAU,KAAC,KAAK,YAChB,EAAU,EAAG,qDAAsD,OAEnE,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,YAAa,GAAM,KAAM,MAAO,MAAO,KAAO,QAAS,SA5PpI,EAAA,GAgQN,EAAG,SAAS,MAAO,QAAS,oDAvQ1B,KAAA","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\t# The My Payment Methods handler.\n\t#\n\t# @since 5.1.0\n\tclass window.SV_WC_Payment_Methods_Handler_v5_10_5\n\n\n\t\t# Constructs the class.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] args, with the properties:\n\t\t# id: [String] plugin ID\n\t\t# slug: [String] plugin slug or dasherized ID\n\t\t# i18n: [Object] localized text strings\n\t\t# ajax_url: [String] URL for AJAX requests\n\t\t# ajax_nonce: [String] nonce for AJAX requests\n\t\tconstructor: ( args ) ->\n\n\t\t\t@id = args.id\n\t\t\t@slug = args.slug\n\t\t\t@i18n = args.i18n\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@ajax_nonce = args.ajax_nonce\n\n\t\t\t# replace the \"Method\" column content for FW tokens\n\t\t\tthis.replace_method_column()\n\n\t\t\t# remove duplicate \"Default\" marks\n\t\t\tthis.remove_duplicate_default_marks()\n\n\t\t\t# handle the edit action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.edit\", ( event ) => this.edit_method( event ) )\n\n\t\t\t# handle the save action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.save\", ( event ) => this.save_method( event ) )\n\n\t\t\t# handle the cancel action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .cancel-edit\", ( event ) => this.cancel_edit( event ) )\n\n\t\t\t# handle the delete action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.delete\", ( event ) =>\n\n\t\t\t\tbutton = $( event.currentTarget )\n\t\t\t\trow = button.parents( 'tr' )\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\tif $( event.currentTarget ).hasClass( 'disabled' ) or not confirm( @i18n.delete_ays )\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t)\n\n\t\t\t# don't follow the Add Payment Method button URL if it's disabled\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).click ( event ) ->\n\t\t\t\tevent.preventDefault() if $( this ).hasClass( 'disabled' )\n\n\n\t\t# Replace Method column content with Title column content, for FW tokens.\n\t\t#\n\t\t# @since 5.8.0\n\t\treplace_method_column: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif $( element ).find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\t# delete the Title header\n\t\t\t\t$( element ).find( 'th.woocommerce-PaymentMethod--title' ).remove()\n\n\t\t\t\ttitleColumn = $( element ).find( 'td.woocommerce-PaymentMethod--title' )\n\n\t\t\t\t# Title column is not empty, this is a FW token\n\t\t\t\tif ( titleColumn.children().length > 0 )\n\n\t\t\t\t\t# replace Method column\n\t\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--method' ).html( titleColumn.html() )\n\n\t\t\t\t# delete Title column\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--title' ).remove()\n\n\n\t\t# Removes duplicate \"Default\" marks.\n\t\t#\n\t\t# They are already hidden using CSS, but should also be removed for accessibility.\n\t\t#\n\t\t# @since 5.8.0\n\t\tremove_duplicate_default_marks: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--default' ).find( 'mark.default:not(:first-child)' ).remove()\n\n\n\t\t# Edits a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tedit_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).hide()\n\t\t\trow.find( 'div.edit' ).show()\n\t\t\trow.addClass( 'editing' )\n\n\t\t\t# change the Edit button to \"Cancel\"\n\t\t\tbutton.text( @i18n.cancel_button ).removeClass( 'edit' ).addClass( 'cancel-edit' ).removeClass( 'button' )\n\n\t\t\tthis.enable_editing_ui()\n\n\n\t\t# Saves a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tsave_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\tthis.block_ui()\n\n\t\t\t# remove any previous errors\n\t\t\trow.next( '.error' ).remove()\n\n\t\t\tdata =\n\t\t\t\taction: \"wc_#{@id}_save_payment_method\"\n\t\t\t\tnonce: @ajax_nonce\n\t\t\t\ttoken_id: row.find( 'input[name=token-id]' ).val()\n\t\t\t\tdata: row.find( 'input[name]' ).serialize()\n\n\t\t\t$.post( @ajax_url, data )\n\n\t\t\t\t.done ( response ) =>\n\n\t\t\t\t\treturn this.display_error( row, response.data ) unless response.success\n\n\t\t\t\t\tif response.data.title?\n\t\t\t\t\t\trow.find('.woocommerce-PaymentMethod--method').html( response.data.title )\n\n\t\t\t\t\tif response.data.nonce?\n\t\t\t\t\t\t@ajax_nonce = response.data.nonce\n\n\t\t\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\t\t\tbutton.siblings( '.cancel-edit' ).removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\t\t\tthis.disable_editing_ui()\n\n\t\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\t\tthis.display_error( row, error )\n\n\t\t\t\t.always =>\n\n\t\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Cancels/stop editing a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tcancel_edit: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).show()\n\t\t\trow.find( 'div.edit' ).hide()\n\t\t\trow.removeClass( 'editing' )\n\n\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\tbutton.removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\tthis.disable_editing_ui()\n\n\n\t\t# Sets the page UI to the \"editing\" state.\n\t\t#\n\t\t# This brings proper focus to the method being edited and prevents\n\t\t# other available buttons/actions until the editing is finished or cancelled.\n\t\t#\n\t\t# @since 5.1.1\n\t\tenable_editing_ui: ->\n\n\t\t\t# set the methods table as 'editing'\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).addClass( 'editing' )\n\n\t\t\t# disable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).addClass( 'disabled' )\n\n\n\t\t# Sets the page UI back to the default state.\n\t\t#\n\t\t# @since 5.1.1\n\t\tdisable_editing_ui: ->\n\n\t\t\t# removes the methods table's \"editing\" status\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).removeClass( 'editing' )\n\n\t\t\t# re-enable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).removeClass( 'disabled' )\n\n\n\t\t# Blocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tunblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).unblock()\n\n\n\t\t# Displays an error message to the user.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] row payment method table row\n\t\t# @param [String] error raw error message\n\t\t# @param [String] message user error message\n\t\tdisplay_error: ( row, error, message = '' ) ->\n\n\t\t\tconsole.error( error )\n\n\t\t\tmessage = @i18n.save_error unless message\n\t\t\tcolumns = $( \".woocommerce-MyAccount-paymentMethods thead tr th\" ).length\n\n\t\t\t$( '<tr class=\"error\"><td colspan=\"' + columns + '\">' + message + '</td></tr>' ).insertAfter( row ).find( 'td' ).delay( 8000 ).slideUp( 200 )\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_10_5_loaded' )\n"]}
1
+ {"version":3,"sources":["frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WACH,OAAO,SAAE,GAAF,aAsQN,OAhQM,OAAO,sCAAP,WAaU,SAAA,EAAA,GAAF,IAAA,EAAA,KAAA,EAAA,KAAA,GA8Cb,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,+BAAA,KAAA,+BAAA,KAAA,MAYA,KAAA,YAAA,KAAA,YAAA,KAAA,MA0BA,KAAA,YAAA,KAAA,YAAA,KAAA,MAqDA,KAAA,YAAA,KAAA,YAAA,KAAA,MAnKE,KAAA,GAAa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,OAUvD,OAPA,EAAI,KAAM,YAAa,OACvB,EAAI,KAAM,YAAa,OACvB,EAAI,YAAa,WAGjB,EAAO,YAAa,eAAgB,SAAU,QAAS,KAAM,KAAC,KAAK,aAAc,SAAU,UAE3F,KAAK,uBApMD,CAAA,IAAA,oBA6Mc,MAAA,WAMlB,OAHA,EAAG,yCAA0C,SAAU,WAGvD,EAAG,uCAAwC,SAAU,cAnNjD,CAAA,IAAA,qBAyNe,MAAA,WAMnB,OAHA,EAAG,yCAA0C,YAAa,WAG1D,EAAG,uCAAwC,YAAa,cA/NpD,CAAA,IAAA,WAqOK,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QArOpI,CAAA,IAAA,aA2OO,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,YA3OvE,CAAA,IAAA,gBAqPY,MAAA,SAAA,EAAK,GAAO,IAE/B,EAF+B,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAOtC,OALA,QAAQ,MAAO,GAEmB,IAAlC,EAAU,KAAC,KAAK,YAChB,EAAU,EAAG,qDAAsD,OAEnE,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,YAAa,GAAM,KAAM,MAAO,MAAO,KAAO,QAAS,SA5PpI,EAAA,GAgQN,EAAG,SAAS,MAAO,QAAS,oDAvQ1B,KAAA","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\t# The My Payment Methods handler.\n\t#\n\t# @since 5.1.0\n\tclass window.SV_WC_Payment_Methods_Handler_v5_10_7\n\n\n\t\t# Constructs the class.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] args, with the properties:\n\t\t# id: [String] plugin ID\n\t\t# slug: [String] plugin slug or dasherized ID\n\t\t# i18n: [Object] localized text strings\n\t\t# ajax_url: [String] URL for AJAX requests\n\t\t# ajax_nonce: [String] nonce for AJAX requests\n\t\tconstructor: ( args ) ->\n\n\t\t\t@id = args.id\n\t\t\t@slug = args.slug\n\t\t\t@i18n = args.i18n\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@ajax_nonce = args.ajax_nonce\n\n\t\t\t# replace the \"Method\" column content for FW tokens\n\t\t\tthis.replace_method_column()\n\n\t\t\t# remove duplicate \"Default\" marks\n\t\t\tthis.remove_duplicate_default_marks()\n\n\t\t\t# handle the edit action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.edit\", ( event ) => this.edit_method( event ) )\n\n\t\t\t# handle the save action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.save\", ( event ) => this.save_method( event ) )\n\n\t\t\t# handle the cancel action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .cancel-edit\", ( event ) => this.cancel_edit( event ) )\n\n\t\t\t# handle the delete action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.delete\", ( event ) =>\n\n\t\t\t\tbutton = $( event.currentTarget )\n\t\t\t\trow = button.parents( 'tr' )\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\tif $( event.currentTarget ).hasClass( 'disabled' ) or not confirm( @i18n.delete_ays )\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t)\n\n\t\t\t# don't follow the Add Payment Method button URL if it's disabled\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).click ( event ) ->\n\t\t\t\tevent.preventDefault() if $( this ).hasClass( 'disabled' )\n\n\n\t\t# Replace Method column content with Title column content, for FW tokens.\n\t\t#\n\t\t# @since 5.8.0\n\t\treplace_method_column: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif $( element ).find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\t# delete the Title header\n\t\t\t\t$( element ).find( 'th.woocommerce-PaymentMethod--title' ).remove()\n\n\t\t\t\ttitleColumn = $( element ).find( 'td.woocommerce-PaymentMethod--title' )\n\n\t\t\t\t# Title column is not empty, this is a FW token\n\t\t\t\tif ( titleColumn.children().length > 0 )\n\n\t\t\t\t\t# replace Method column\n\t\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--method' ).html( titleColumn.html() )\n\n\t\t\t\t# delete Title column\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--title' ).remove()\n\n\n\t\t# Removes duplicate \"Default\" marks.\n\t\t#\n\t\t# They are already hidden using CSS, but should also be removed for accessibility.\n\t\t#\n\t\t# @since 5.8.0\n\t\tremove_duplicate_default_marks: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--default' ).find( 'mark.default:not(:first-child)' ).remove()\n\n\n\t\t# Edits a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tedit_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).hide()\n\t\t\trow.find( 'div.edit' ).show()\n\t\t\trow.addClass( 'editing' )\n\n\t\t\t# change the Edit button to \"Cancel\"\n\t\t\tbutton.text( @i18n.cancel_button ).removeClass( 'edit' ).addClass( 'cancel-edit' ).removeClass( 'button' )\n\n\t\t\tthis.enable_editing_ui()\n\n\n\t\t# Saves a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tsave_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\tthis.block_ui()\n\n\t\t\t# remove any previous errors\n\t\t\trow.next( '.error' ).remove()\n\n\t\t\tdata =\n\t\t\t\taction: \"wc_#{@id}_save_payment_method\"\n\t\t\t\tnonce: @ajax_nonce\n\t\t\t\ttoken_id: row.find( 'input[name=token-id]' ).val()\n\t\t\t\tdata: row.find( 'input[name]' ).serialize()\n\n\t\t\t$.post( @ajax_url, data )\n\n\t\t\t\t.done ( response ) =>\n\n\t\t\t\t\treturn this.display_error( row, response.data ) unless response.success\n\n\t\t\t\t\tif response.data.title?\n\t\t\t\t\t\trow.find('.woocommerce-PaymentMethod--method').html( response.data.title )\n\n\t\t\t\t\tif response.data.nonce?\n\t\t\t\t\t\t@ajax_nonce = response.data.nonce\n\n\t\t\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\t\t\tbutton.siblings( '.cancel-edit' ).removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\t\t\tthis.disable_editing_ui()\n\n\t\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\t\tthis.display_error( row, error )\n\n\t\t\t\t.always =>\n\n\t\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Cancels/stop editing a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tcancel_edit: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).show()\n\t\t\trow.find( 'div.edit' ).hide()\n\t\t\trow.removeClass( 'editing' )\n\n\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\tbutton.removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\tthis.disable_editing_ui()\n\n\n\t\t# Sets the page UI to the \"editing\" state.\n\t\t#\n\t\t# This brings proper focus to the method being edited and prevents\n\t\t# other available buttons/actions until the editing is finished or cancelled.\n\t\t#\n\t\t# @since 5.1.1\n\t\tenable_editing_ui: ->\n\n\t\t\t# set the methods table as 'editing'\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).addClass( 'editing' )\n\n\t\t\t# disable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).addClass( 'disabled' )\n\n\n\t\t# Sets the page UI back to the default state.\n\t\t#\n\t\t# @since 5.1.1\n\t\tdisable_editing_ui: ->\n\n\t\t\t# removes the methods table's \"editing\" status\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).removeClass( 'editing' )\n\n\t\t\t# re-enable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).removeClass( 'disabled' )\n\n\n\t\t# Blocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tunblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).unblock()\n\n\n\t\t# Displays an error message to the user.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] row payment method table row\n\t\t# @param [String] error raw error message\n\t\t# @param [String] message user error message\n\t\tdisplay_error: ( row, error, message = '' ) ->\n\n\t\t\tconsole.error( error )\n\n\t\t\tmessage = @i18n.save_error unless message\n\t\t\tcolumns = $( \".woocommerce-MyAccount-paymentMethods thead tr th\" ).length\n\n\t\t\t$( '<tr class=\"error\"><td colspan=\"' + columns + '\">' + message + '</td></tr>' ).insertAfter( row ).find( 'td' ).delay( 8000 ).slideUp( 200 )\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_10_7_loaded' )\n"]}
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js CHANGED
@@ -1,4 +1,4 @@
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"JA8d":[function(require,module,exports) {
2
- function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}(function(){var t=[].indexOf;jQuery(function(n){"use strict";return window.SV_WC_Payment_Form_Handler_v5_10_5=function(){function r(t){var a=this;if(e(this,r),this.id=t.id,this.id_dasherized=t.id_dasherized,this.plugin_id=t.plugin_id,this.type=t.type,this.csc_required=t.csc_required,this.csc_required_for_tokens=t.csc_required_for_tokens,this.enabled_card_types=t.enabled_card_types,n("form.checkout").length)this.form=n("form.checkout"),this.handle_checkout_page();else if(n("form#order_review").length)this.form=n("form#order_review"),this.handle_pay_page();else{if(!n("form#add_payment_method").length)return void console.log("No payment form found!");this.form=n("form#add_payment_method"),this.handle_add_payment_method_page()}this.params=window.sv_wc_payment_gateway_payment_form_params,"echeck"===this.type&&this.form.on("click",".js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check",function(){return a.handle_sample_check_hint()}),n(document).trigger("sv_wc_payment_form_handler_init",{id:this.id,instance:this})}return a(r,[{key:"handle_checkout_page",value:function(){var e=this;return"credit-card"===this.type&&n(document.body).on("updated_checkout",function(){return e.format_credit_card_inputs()}),n(document.body).on("updated_checkout",function(){return e.set_payment_fields()}),n(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),this.form.on("checkout_place_order_".concat(this.id),function(){return e.validate_payment_data()})}},{key:"handle_pay_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.handle_saved_payment_methods(),this.form.submit(function(){if(n("#order_review input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.form.submit(function(){if(n("#add_payment_method input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"set_payment_fields",value:function(){return this.payment_fields=n(".payment_method_".concat(this.id)),this.payment_fields.find(".validate-required .input-text").each(function(e,t){return!n(t).val()&&n(t).trigger("input")})}},{key:"validate_payment_data",value:function(){var e,t;return!this.form.is(".processing")&&(this.saved_payment_method_selected=this.payment_fields.find(".js-sv-wc-payment-gateway-payment-token:checked").val(),t="credit-card"===this.type?this.validate_card_data():this.validate_account_data(),e=!1!==n(document.body).triggerHandler("sv_wc_payment_form_valid_payment_data",{payment_form:this,passed_validation:t}),t&&e)}},{key:"format_credit_card_inputs",value:function(){var e,t,a,r=this;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number").payment("formatCardNumber"),a=n(".js-sv-wc-payment-gateway-credit-card-form-expiry").payment("formatCardExpiry"),t=n(".js-sv-wc-payment-gateway-credit-card-form-csc").payment("formatCardCVC"),e.val()&&e.val().length>0&&e.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return r.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.push(this.params.cvv_missing))),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),r=n.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||(t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)return e.removeClass("form-row-first").addClass("form-row-last"),t.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_10_5_loaded")})}).call(this);
3
  },{}]},{},["JA8d"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"JA8d":[function(require,module,exports) {
2
+ function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}(function(){var t=[].indexOf;jQuery(function(n){"use strict";return window.SV_WC_Payment_Form_Handler_v5_10_7=function(){function r(t){var a=this;if(e(this,r),this.id=t.id,this.id_dasherized=t.id_dasherized,this.plugin_id=t.plugin_id,this.type=t.type,this.csc_required=t.csc_required,this.csc_required_for_tokens=t.csc_required_for_tokens,this.enabled_card_types=t.enabled_card_types,n("form.checkout").length)this.form=n("form.checkout"),this.handle_checkout_page();else if(n("form#order_review").length)this.form=n("form#order_review"),this.handle_pay_page();else{if(!n("form#add_payment_method").length)return void console.log("No payment form found!");this.form=n("form#add_payment_method"),this.handle_add_payment_method_page()}this.params=window.sv_wc_payment_gateway_payment_form_params,"echeck"===this.type&&this.form.on("click",".js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check",function(){return a.handle_sample_check_hint()}),n(document).trigger("sv_wc_payment_form_handler_init",{id:this.id,instance:this})}return a(r,[{key:"handle_checkout_page",value:function(){var e=this;return"credit-card"===this.type&&n(document.body).on("updated_checkout",function(){return e.format_credit_card_inputs()}),n(document.body).on("updated_checkout",function(){return e.set_payment_fields()}),n(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),this.form.on("checkout_place_order_".concat(this.id),function(){return e.validate_payment_data()})}},{key:"handle_pay_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.handle_saved_payment_methods(),this.form.submit(function(){if(n("#order_review input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.form.submit(function(){if(n("#add_payment_method input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"set_payment_fields",value:function(){return this.payment_fields=n(".payment_method_".concat(this.id)),this.payment_fields.find(".validate-required .input-text").each(function(e,t){return!n(t).val()&&n(t).trigger("input")})}},{key:"validate_payment_data",value:function(){var e,t;return!this.form.is(".processing")&&(this.saved_payment_method_selected=this.payment_fields.find(".js-sv-wc-payment-gateway-payment-token:checked").val(),t="credit-card"===this.type?this.validate_card_data():this.validate_account_data(),e=!1!==n(document.body).triggerHandler("sv_wc_payment_form_valid_payment_data",{payment_form:this,passed_validation:t}),t&&e)}},{key:"format_credit_card_inputs",value:function(){var e,t,a,r=this;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number").payment("formatCardNumber"),a=n(".js-sv-wc-payment-gateway-credit-card-form-expiry").payment("formatCardExpiry"),t=n(".js-sv-wc-payment-gateway-credit-card-form-csc").payment("formatCardCVC"),e.val()&&e.val().length>0&&e.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return r.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.push(this.params.cvv_missing))),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),r=n.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||(t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)return e.removeClass("form-row-first").addClass("form-row-last"),t.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_10_7_loaded")})}).call(this);
3
  },{}]},{},["JA8d"], null)
4
  //# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["frontend/sv-wc-payment-gateway-payment-form.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAA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mB,eAAA,OAAA,KAAC,cAApB,mBAAqD,OAAO,WAIxD,GAFiC,EAAmB,eAAA,OAAA,EAAnB,2BAA4D,OAQ5F,GAHH,EAA8B,QAAS,KAGpC,EAEF,OADA,EAAW,YAAa,iBAAkB,SAAU,kBACpD,EAA8B,MAAO,QAOnC,GAHH,EAA8B,UAAW,KAGtC,EAEF,OADA,EAAW,YAAa,kBAAmB,SAAU,iBACrD,EAA8B,KAAM,qDAAsD,QAAS,aAAc,MAAO,KAC1H,SAID,EAAG,uBAAwB,OAAO,WACrC,IAAA,EAEO,OAFH,EAAc,EAAmB,eAAA,OAAA,EAAnB,6BAA8D,QAAS,cAElF,EAAG,MAAO,GAAI,aAChB,EAAY,YACZ,EAAY,OAAO,SAEnB,EAAY,OACZ,EAAY,OAAO,WAEsB,EAAG,uBAAwB,GAAI,YAA1E,OAAA,EAAG,uBAAwB,WA5VvB,CAAA,IAAA,2BAkWqB,MAAA,WAE5B,IAAA,EAEM,OAFH,EAAgB,KAAC,eAAe,KAAM,uDAErB,GAAI,YAAkB,EAAc,UAAe,EAAc,cAtW9E,CAAA,IAAA,WA6WK,MAAA,WAAG,OAAA,KAAC,KAAK,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,QA7W5E,CAAA,IAAA,aAmXO,MAAA,WAAG,OAAA,KAAC,KAAK,cAnXhB,EAAA,GAuXN,EAAG,SAAS,MAAO,QAAS,iDA5X1B,KAAA","file":"sv-wc-payment-gateway-payment-form.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0-beta\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\n\tclass window.SV_WC_Payment_Form_Handler_v5_10_5\n\n\n\t\t# Public: Instantiate Payment Form Handler\n\t\t#\n\t\t# args - object with properties:\n\t\t# id - gateway ID\n\t\t# id_dasherized - gateway ID dasherized\n\t\t# plugin_id - plugin ID\n\t\t# type - gateway type, either `credit-card` or `echeck`\n\t\t# csc_required - true if the gateway requires the CSC field to be displayed\n\t\t#\n\t\t# Returns SV_WC_Payment_Form_Handler_v5_10_5 instance\n\t\tconstructor: (args) ->\n\n\t\t\t@id = args.id\n\t\t\t@id_dasherized = args.id_dasherized\n\t\t\t@plugin_id = args.plugin_id\n\t\t\t@type = args.type\n\t\t\t@csc_required = args.csc_required\n\t\t\t@csc_required_for_tokens = args.csc_required_for_tokens\n\t\t\t@enabled_card_types = args.enabled_card_types\n\n\t\t\t# which payment form?\n\t\t\tif $( 'form.checkout' ).length\n\t\t\t\t@form = $( 'form.checkout' )\n\t\t\t\tthis.handle_checkout_page()\n\n\t\t\telse if $( 'form#order_review' ).length\n\t\t\t\t@form = $( 'form#order_review' )\n\t\t\t\tthis.handle_pay_page()\n\n\t\t\telse if $( 'form#add_payment_method' ).length\n\t\t\t\t@form = $( 'form#add_payment_method' )\n\t\t\t\tthis.handle_add_payment_method_page()\n\n\t\t\telse\n\t\t\t\tconsole.log( 'No payment form found!' )\n\t\t\t\treturn\n\n\t\t\t# localized error messages\n\t\t\t@params = window[ \"sv_wc_payment_gateway_payment_form_params\" ]\n\n\t\t\t# handle sample check image hint\n\t\t\t@form.on( 'click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', => this.handle_sample_check_hint() ) if @type is 'echeck'\n\n\t\t\t$( document ).trigger( 'sv_wc_payment_form_handler_init', { id: @id, instance: @ } )\n\n\n\t\t# Public: Handle required actions on the checkout page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_checkout_page: ->\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\t$( document.body ).on( 'updated_checkout', => this.format_credit_card_inputs() ) if @type is 'credit-card'\n\n\t\t\t# updated payment fields jQuery object on each checkout update (prevents stale data)\n\t\t\t$( document.body ).on( 'updated_checkout', => this.set_payment_fields() )\n\n\t\t\t# handle saved payment methods\n\t\t\t# note on the checkout page, this is bound to `updated_checkout` so it\n\t\t\t# fires even when other parts of the checkout are changed\n\t\t\t$( document.body ).on( 'updated_checkout', => this.handle_saved_payment_methods() )\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.on( \"checkout_place_order_#{ @id }\", => this.validate_payment_data() )\n\n\n\t\t# Public: Handle required actions on the Order > Pay page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_pay_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# handle saved payment methods\n\t\t\tthis.handle_saved_payment_methods()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#order_review input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Handle required actions on the Add Payment Method page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_add_payment_method_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#add_payment_method input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Set payment fields class variable, this is done\n\t\t# during the updated_checkout event as otherwise the reference to\n\t\t# the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n\t\t#\n\t\t# This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n\t\t#\n\t\t# Returns nothing.\n\t\tset_payment_fields: ->\n\n\t\t\t@payment_fields = $( \".payment_method_#{ @id }\" )\n\n\t\t\t$required_fields = @payment_fields.find( '.validate-required .input-text' )\n\n\t\t\t$required_fields.each( ( i, input ) =>\n\n\t\t\t\t# if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n\t\t\t\tif $( input ).val()\n\t\t\t\t\treturn false\n\n\t\t\t\t# otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n\t\t\t\t$( input ).trigger( 'input' )\n\t\t\t)\n\n\n\t\t# Public: Validate Payment data when order is placed\n\t\t#\n\t\t# Returns boolean, true if payment data is valid, false otherwise\n\t\tvalidate_payment_data: ->\n\n\t\t\t# bail when already processing\n\t\t\treturn false if @form.is( '.processing' )\n\n\t\t\t@saved_payment_method_selected = @payment_fields.find( '.js-sv-wc-payment-gateway-payment-token:checked' ).val()\n\n\t\t\t# perform internal validations (all fields present & valid, etc)\n\t\t\tvalid = if @type is 'credit-card' then this.validate_card_data() else this.validate_account_data()\n\n\t\t\t# let gateways perform their own validation prior to form submission\n\t\t\thandler = $( document.body ).triggerHandler( 'sv_wc_payment_form_valid_payment_data', { payment_form: this, passed_validation: valid } ) isnt false\n\n\t\t\treturn valid && handler\n\n\n\t\t# Public: format card data using jQuery.Payment\n\t\t#\n\t\t# Returns nothing.\n\t\tformat_credit_card_inputs: ->\n\t\t\t$card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n\t\t\t$expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n\t\t\t$csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n\n\t\t\t# trigger a 'change' event for non empty fields only\n\t\t\t$card_number.trigger( 'change') if $card_number.val() && $card_number.val().length > 0\n\t\t\t$expiry.trigger( 'change') if $expiry.val() && $expiry.val().length > 0\n\t\t\t$csc.trigger( 'change') if $csc.val() && $csc.val().length > 0\n\n\t\t\t# perform inline validation on credit card inputs\n\t\t\t$( '.js-sv-wc-payment-gateway-credit-card-form-input' ).on( 'change paste keyup', => this.do_inline_credit_card_validation() )\n\n\n\t\t# Public: perform inline validation on credit card fields\n\t\t#\n\t\t# Returns nothing.\n\t\tdo_inline_credit_card_validation: ->\n\n\t\t\t$card_number = $( '.js-sv-wc-payment-gateway-credit-card-form-account-number' )\n\t\t\t$expiry = $( '.js-sv-wc-payment-gateway-credit-card-form-expiry' )\n\t\t\t$csc = $( '.js-sv-wc-payment-gateway-credit-card-form-csc' )\n\n\t\t\t$card_type = $.payment.cardType( $card_number.val() )\n\n\t\t\tif $card_type not in @enabled_card_types\n\t\t\t\t$card_number.addClass( 'invalid-card-type' )\n\t\t\telse\n\t\t\t\t$card_number.removeClass( 'invalid-card-type' )\n\n\t\t\tif $.payment.validateCardExpiry( $expiry.payment( 'cardExpiryVal' ) )\n\t\t\t\t$expiry.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$expiry.removeClass( 'identified' )\n\n\t\t\tif $.payment.validateCardCVC( $csc.val() )\n\t\t\t\t$csc.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$csc.removeClass( 'identified' )\n\n\n\t\t# Public: Perform validation on the credit card info entered\n\t\t#\n\t\t# Return boolean, true if credit card info is valid, false otherwise\n\t\tvalidate_card_data: ->\n\n\t\t\terrors = []\n\n\t\t\tcsc = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).val()\n\n\t\t\t# always validate the CSC if present\n\t\t\tif csc?\n\n\t\t\t\tif csc\n\t\t\t\t\terrors.push( @params.cvv_digits_invalid ) if /\\D/.test( csc )\n\t\t\t\t\terrors.push( @params.cvv_length_invalid ) if csc.length < 3 || csc.length > 4\n\t\t\t\telse if @csc_required\n\t\t\t\t\tif not @saved_payment_method_selected or @csc_required_for_tokens\n\t\t\t\t\t\terrors.push( @params.cvv_missing )\n\n\t\t\t# Only validate the other CC fields if necessary\n\t\t\tif not @saved_payment_method_selected\n\n\t\t\t\taccount_number = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val()\n\t\t\t\texpiry = $.payment.cardExpiryVal( @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).val() )\n\n\t\t\t\t# replace any dashes or spaces in the card number\n\t\t\t\taccount_number = account_number.replace( /-|\\s/g, '' )\n\n\t\t\t\t# validate card number\n\t\t\t\tif not account_number\n\t\t\t\t\terrors.push( @params.card_number_missing )\n\t\t\t\telse\n\t\t\t\t\terrors.push( @params.card_number_length_invalid ) if account_number.length < 12 || account_number.length > 19\n\t\t\t\t\terrors.push( @params.card_number_digits_invalid ) if /\\D/.test( account_number )\n\t\t\t\t\terrors.push( @params.card_number_invalid ) unless $.payment.validateCardNumber( account_number ) # performs luhn check\n\n\t\t\t\t# validate expiration date\n\t\t\t\terrors.push( @params.card_exp_date_invalid ) unless $.payment.validateCardExpiry( expiry ) # validates future date\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Perform validation on the eCheck info entered\n\t\t#\n\t\t# Return boolean, true if eCheck info is valid, false otherwise\n\t\tvalidate_account_data: ->\n\n\t\t\treturn true if @saved_payment_method_selected\n\n\t\t\terrors = []\n\n\t\t\trouting_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val()\n\t\t\taccount_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val()\n\n\t\t\t# validate routing number\n\t\t\tif not routing_number\n\t\t\t\terrors.push( @params.routing_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.routing_number_length_invalid ) if 9 != routing_number.length\n\t\t\t\terrors.push( @params.routing_number_digits_invalid ) if /\\D/.test( routing_number )\n\n\t\t\t# validate account number\n\t\t\tif not account_number\n\t\t\t\terrors.push( @params.account_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.account_number_length_invalid ) if account_number.length < 3 || account_number.length > 17\n\t\t\t\terrors.push( @params.account_number_invalid ) if /\\D/.test( account_number )\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Render any new errors and bring them into the viewport\n\t\t#\n\t\t# Returns nothing.\n\t\trender_errors: (errors) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@form.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@form.removeClass( 'processing' ).unblock()\n\t\t\t@form.find( '.input-text, select' ).blur()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @form.offset().top - 100 }, 1000 )\n\n\n\t\t# Public: Handle associated actions for saved payment methods\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_saved_payment_methods: ->\n\n\t\t\t# make available inside change events\n\t\t\tid_dasherized = @id_dasherized\n\n\t\t\tcsc_required = @csc_required\n\t\t\tcsc_required_for_tokens = @csc_required_for_tokens\n\n\t\t\t$new_payment_method_selection = $( \"div.js-wc-#{ id_dasherized }-new-payment-method-form\" )\n\t\t\t$csc_field = $new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).closest( '.form-row' )\n\n\t\t\t# show/hide the saved payment methods when a saved payment method is de-selected/selected\n\t\t\t$( \"input.js-wc-#{ @id_dasherized }-payment-token\" ).change ->\n\n\t\t\t\ttokenized_payment_method_selected = $( \"input.js-wc-#{ id_dasherized }-payment-token:checked\" ).val()\n\n\t\t\t\tif tokenized_payment_method_selected\n\n\t\t\t\t\t# using an existing tokenized payment method, hide the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideUp( 200 )\n\n\t\t\t\t\t# move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-last' ).addClass( 'form-row-first' )\n\t\t\t\t\t\t$new_payment_method_selection.after( $csc_field )\n\n\t\t\t\telse\n\t\t\t\t\t# use new payment method, display the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideDown( 200 )\n\n\t\t\t\t\t# move the CSC field back into its regular spot\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-first' ).addClass( 'form-row-last' )\n\t\t\t\t\t\t$new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).closest( '.form-row' ).after( $csc_field )\n\t\t\t.change()\n\n\t\t\t# display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n\t\t\t# but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n\t\t\t$( 'input#createaccount' ).change ->\n\t\t\t\t$parent_row = $( \"input.js-wc-#{ id_dasherized }-tokenize-payment-method\" ).closest( 'p.form-row' )\n\n\t\t\t\tif $( this ).is( ':checked' )\n\t\t\t\t\t$parent_row.slideDown()\n\t\t\t\t\t$parent_row.next().show()\n\t\t\t\telse\n\t\t\t\t\t$parent_row.hide()\n\t\t\t\t\t$parent_row.next().hide()\n\n\t\t\t$( 'input#createaccount' ).change() unless $( 'input#createaccount' ).is( ':checked' )\n\n\n\t\t# Public: Handle showing/hiding the sample check image\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_sample_check_hint: ->\n\n\t\t\t$sample_check = @payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-sample-check' )\n\n\t\t\tif $sample_check.is( \":visible\" ) then $sample_check.slideUp() else $sample_check.slideDown()\n\n\n\n\t\t# Blocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tblock_ui: -> @form.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tunblock_ui: -> @form.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( \"sv_wc_payment_form_handler_v5_10_5_loaded\" )\n"]}
1
+ {"version":3,"sources":["frontend/sv-wc-payment-gateway-payment-form.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAAA,IAAA,EAAA,GAAA,QACH,OAAO,SAAE,GACR,aA0XA,OAvXM,OAAO,mCAAP,WAaS,SAAA,EAAA,GAAD,IAAA,EAAA,KAWT,GAXS,EAAA,KAAA,GAEX,KAAA,GAA0B,EAAK,GAC/B,KAAA,cAA0B,EAAK,cAC/B,KAAA,UAA0B,EAAK,UAC/B,KAAA,KAA0B,EAAK,KAC/B,KAAA,aAA0B,EAAK,aAC/B,KAAA,wBAA0B,EAAK,wBAC/B,KAAA,mBAA0B,EAAK,mBAG7B,EAAG,iBAAkB,OACtB,KAAA,KAAO,EAAG,iBACN,KAAA,4BAED,GAAG,EAAG,qBAAsB,OAC/B,KAAA,KAAO,EAAG,qBACN,KAAA,sBAED,CAAA,IAAG,EAAG,2BAA4B,OAMtC,YADA,QAAQ,IAAK,0BAJZ,KAAA,KAAO,EAAG,2BACN,KAAA,iCAOL,KAAA,OAAS,OAAM,0CAG4J,WAAT,KAAC,MAAnK,KAAA,KAAK,GAAI,QAAS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ourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0-beta\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\n\tclass window.SV_WC_Payment_Form_Handler_v5_10_7\n\n\n\t\t# Public: Instantiate Payment Form Handler\n\t\t#\n\t\t# args - object with properties:\n\t\t# id - gateway ID\n\t\t# id_dasherized - gateway ID dasherized\n\t\t# plugin_id - plugin ID\n\t\t# type - gateway type, either `credit-card` or `echeck`\n\t\t# csc_required - true if the gateway requires the CSC field to be displayed\n\t\t#\n\t\t# Returns SV_WC_Payment_Form_Handler_v5_10_7 instance\n\t\tconstructor: (args) ->\n\n\t\t\t@id = args.id\n\t\t\t@id_dasherized = args.id_dasherized\n\t\t\t@plugin_id = args.plugin_id\n\t\t\t@type = args.type\n\t\t\t@csc_required = args.csc_required\n\t\t\t@csc_required_for_tokens = args.csc_required_for_tokens\n\t\t\t@enabled_card_types = args.enabled_card_types\n\n\t\t\t# which payment form?\n\t\t\tif $( 'form.checkout' ).length\n\t\t\t\t@form = $( 'form.checkout' )\n\t\t\t\tthis.handle_checkout_page()\n\n\t\t\telse if $( 'form#order_review' ).length\n\t\t\t\t@form = $( 'form#order_review' )\n\t\t\t\tthis.handle_pay_page()\n\n\t\t\telse if $( 'form#add_payment_method' ).length\n\t\t\t\t@form = $( 'form#add_payment_method' )\n\t\t\t\tthis.handle_add_payment_method_page()\n\n\t\t\telse\n\t\t\t\tconsole.log( 'No payment form found!' )\n\t\t\t\treturn\n\n\t\t\t# localized error messages\n\t\t\t@params = window[ \"sv_wc_payment_gateway_payment_form_params\" ]\n\n\t\t\t# handle sample check image hint\n\t\t\t@form.on( 'click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', => this.handle_sample_check_hint() ) if @type is 'echeck'\n\n\t\t\t$( document ).trigger( 'sv_wc_payment_form_handler_init', { id: @id, instance: @ } )\n\n\n\t\t# Public: Handle required actions on the checkout page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_checkout_page: ->\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\t$( document.body ).on( 'updated_checkout', => this.format_credit_card_inputs() ) if @type is 'credit-card'\n\n\t\t\t# updated payment fields jQuery object on each checkout update (prevents stale data)\n\t\t\t$( document.body ).on( 'updated_checkout', => this.set_payment_fields() )\n\n\t\t\t# handle saved payment methods\n\t\t\t# note on the checkout page, this is bound to `updated_checkout` so it\n\t\t\t# fires even when other parts of the checkout are changed\n\t\t\t$( document.body ).on( 'updated_checkout', => this.handle_saved_payment_methods() )\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.on( \"checkout_place_order_#{ @id }\", => this.validate_payment_data() )\n\n\n\t\t# Public: Handle required actions on the Order > Pay page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_pay_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# handle saved payment methods\n\t\t\tthis.handle_saved_payment_methods()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#order_review input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Handle required actions on the Add Payment Method page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_add_payment_method_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#add_payment_method input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Set payment fields class variable, this is done\n\t\t# during the updated_checkout event as otherwise the reference to\n\t\t# the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n\t\t#\n\t\t# This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n\t\t#\n\t\t# Returns nothing.\n\t\tset_payment_fields: ->\n\n\t\t\t@payment_fields = $( \".payment_method_#{ @id }\" )\n\n\t\t\t$required_fields = @payment_fields.find( '.validate-required .input-text' )\n\n\t\t\t$required_fields.each( ( i, input ) =>\n\n\t\t\t\t# if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n\t\t\t\tif $( input ).val()\n\t\t\t\t\treturn false\n\n\t\t\t\t# otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n\t\t\t\t$( input ).trigger( 'input' )\n\t\t\t)\n\n\n\t\t# Public: Validate Payment data when order is placed\n\t\t#\n\t\t# Returns boolean, true if payment data is valid, false otherwise\n\t\tvalidate_payment_data: ->\n\n\t\t\t# bail when already processing\n\t\t\treturn false if @form.is( '.processing' )\n\n\t\t\t@saved_payment_method_selected = @payment_fields.find( '.js-sv-wc-payment-gateway-payment-token:checked' ).val()\n\n\t\t\t# perform internal validations (all fields present & valid, etc)\n\t\t\tvalid = if @type is 'credit-card' then this.validate_card_data() else this.validate_account_data()\n\n\t\t\t# let gateways perform their own validation prior to form submission\n\t\t\thandler = $( document.body ).triggerHandler( 'sv_wc_payment_form_valid_payment_data', { payment_form: this, passed_validation: valid } ) isnt false\n\n\t\t\treturn valid && handler\n\n\n\t\t# Public: format card data using jQuery.Payment\n\t\t#\n\t\t# Returns nothing.\n\t\tformat_credit_card_inputs: ->\n\t\t\t$card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n\t\t\t$expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n\t\t\t$csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n\n\t\t\t# trigger a 'change' event for non empty fields only\n\t\t\t$card_number.trigger( 'change') if $card_number.val() && $card_number.val().length > 0\n\t\t\t$expiry.trigger( 'change') if $expiry.val() && $expiry.val().length > 0\n\t\t\t$csc.trigger( 'change') if $csc.val() && $csc.val().length > 0\n\n\t\t\t# perform inline validation on credit card inputs\n\t\t\t$( '.js-sv-wc-payment-gateway-credit-card-form-input' ).on( 'change paste keyup', => this.do_inline_credit_card_validation() )\n\n\n\t\t# Public: perform inline validation on credit card fields\n\t\t#\n\t\t# Returns nothing.\n\t\tdo_inline_credit_card_validation: ->\n\n\t\t\t$card_number = $( '.js-sv-wc-payment-gateway-credit-card-form-account-number' )\n\t\t\t$expiry = $( '.js-sv-wc-payment-gateway-credit-card-form-expiry' )\n\t\t\t$csc = $( '.js-sv-wc-payment-gateway-credit-card-form-csc' )\n\n\t\t\t$card_type = $.payment.cardType( $card_number.val() )\n\n\t\t\tif $card_type not in @enabled_card_types\n\t\t\t\t$card_number.addClass( 'invalid-card-type' )\n\t\t\telse\n\t\t\t\t$card_number.removeClass( 'invalid-card-type' )\n\n\t\t\tif $.payment.validateCardExpiry( $expiry.payment( 'cardExpiryVal' ) )\n\t\t\t\t$expiry.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$expiry.removeClass( 'identified' )\n\n\t\t\tif $.payment.validateCardCVC( $csc.val() )\n\t\t\t\t$csc.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$csc.removeClass( 'identified' )\n\n\n\t\t# Public: Perform validation on the credit card info entered\n\t\t#\n\t\t# Return boolean, true if credit card info is valid, false otherwise\n\t\tvalidate_card_data: ->\n\n\t\t\terrors = []\n\n\t\t\tcsc = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).val()\n\n\t\t\t# always validate the CSC if present\n\t\t\tif csc?\n\n\t\t\t\tif csc\n\t\t\t\t\terrors.push( @params.cvv_digits_invalid ) if /\\D/.test( csc )\n\t\t\t\t\terrors.push( @params.cvv_length_invalid ) if csc.length < 3 || csc.length > 4\n\t\t\t\telse if @csc_required\n\t\t\t\t\tif not @saved_payment_method_selected or @csc_required_for_tokens\n\t\t\t\t\t\terrors.push( @params.cvv_missing )\n\n\t\t\t# Only validate the other CC fields if necessary\n\t\t\tif not @saved_payment_method_selected\n\n\t\t\t\taccount_number = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val()\n\t\t\t\texpiry = $.payment.cardExpiryVal( @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).val() )\n\n\t\t\t\t# replace any dashes or spaces in the card number\n\t\t\t\taccount_number = account_number.replace( /-|\\s/g, '' )\n\n\t\t\t\t# validate card number\n\t\t\t\tif not account_number\n\t\t\t\t\terrors.push( @params.card_number_missing )\n\t\t\t\telse\n\t\t\t\t\terrors.push( @params.card_number_length_invalid ) if account_number.length < 12 || account_number.length > 19\n\t\t\t\t\terrors.push( @params.card_number_digits_invalid ) if /\\D/.test( account_number )\n\t\t\t\t\terrors.push( @params.card_number_invalid ) unless $.payment.validateCardNumber( account_number ) # performs luhn check\n\n\t\t\t\t# validate expiration date\n\t\t\t\terrors.push( @params.card_exp_date_invalid ) unless $.payment.validateCardExpiry( expiry ) # validates future date\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Perform validation on the eCheck info entered\n\t\t#\n\t\t# Return boolean, true if eCheck info is valid, false otherwise\n\t\tvalidate_account_data: ->\n\n\t\t\treturn true if @saved_payment_method_selected\n\n\t\t\terrors = []\n\n\t\t\trouting_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val()\n\t\t\taccount_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val()\n\n\t\t\t# validate routing number\n\t\t\tif not routing_number\n\t\t\t\terrors.push( @params.routing_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.routing_number_length_invalid ) if 9 != routing_number.length\n\t\t\t\terrors.push( @params.routing_number_digits_invalid ) if /\\D/.test( routing_number )\n\n\t\t\t# validate account number\n\t\t\tif not account_number\n\t\t\t\terrors.push( @params.account_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.account_number_length_invalid ) if account_number.length < 3 || account_number.length > 17\n\t\t\t\terrors.push( @params.account_number_invalid ) if /\\D/.test( account_number )\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Render any new errors and bring them into the viewport\n\t\t#\n\t\t# Returns nothing.\n\t\trender_errors: (errors) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@form.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@form.removeClass( 'processing' ).unblock()\n\t\t\t@form.find( '.input-text, select' ).blur()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @form.offset().top - 100 }, 1000 )\n\n\n\t\t# Public: Handle associated actions for saved payment methods\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_saved_payment_methods: ->\n\n\t\t\t# make available inside change events\n\t\t\tid_dasherized = @id_dasherized\n\n\t\t\tcsc_required = @csc_required\n\t\t\tcsc_required_for_tokens = @csc_required_for_tokens\n\n\t\t\t$new_payment_method_selection = $( \"div.js-wc-#{ id_dasherized }-new-payment-method-form\" )\n\t\t\t$csc_field = $new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).closest( '.form-row' )\n\n\t\t\t# show/hide the saved payment methods when a saved payment method is de-selected/selected\n\t\t\t$( \"input.js-wc-#{ @id_dasherized }-payment-token\" ).change ->\n\n\t\t\t\ttokenized_payment_method_selected = $( \"input.js-wc-#{ id_dasherized }-payment-token:checked\" ).val()\n\n\t\t\t\tif tokenized_payment_method_selected\n\n\t\t\t\t\t# using an existing tokenized payment method, hide the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideUp( 200 )\n\n\t\t\t\t\t# move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-last' ).addClass( 'form-row-first' )\n\t\t\t\t\t\t$new_payment_method_selection.after( $csc_field )\n\n\t\t\t\telse\n\t\t\t\t\t# use new payment method, display the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideDown( 200 )\n\n\t\t\t\t\t# move the CSC field back into its regular spot\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-first' ).addClass( 'form-row-last' )\n\t\t\t\t\t\t$new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).closest( '.form-row' ).after( $csc_field )\n\t\t\t.change()\n\n\t\t\t# display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n\t\t\t# but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n\t\t\t$( 'input#createaccount' ).change ->\n\t\t\t\t$parent_row = $( \"input.js-wc-#{ id_dasherized }-tokenize-payment-method\" ).closest( 'p.form-row' )\n\n\t\t\t\tif $( this ).is( ':checked' )\n\t\t\t\t\t$parent_row.slideDown()\n\t\t\t\t\t$parent_row.next().show()\n\t\t\t\telse\n\t\t\t\t\t$parent_row.hide()\n\t\t\t\t\t$parent_row.next().hide()\n\n\t\t\t$( 'input#createaccount' ).change() unless $( 'input#createaccount' ).is( ':checked' )\n\n\n\t\t# Public: Handle showing/hiding the sample check image\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_sample_check_hint: ->\n\n\t\t\t$sample_check = @payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-sample-check' )\n\n\t\t\tif $sample_check.is( \":visible\" ) then $sample_check.slideUp() else $sample_check.slideDown()\n\n\n\n\t\t# Blocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tblock_ui: -> @form.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tunblock_ui: -> @form.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( \"sv_wc_payment_form_handler_v5_10_7_loaded\" )\n"]}
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js CHANGED
@@ -7,9 +7,9 @@ jQuery( function( $ ) {
7
  *
8
  * @since 5.10.0
9
  *
10
- * @type {SV_WC_Google_Pay_Handler_v5_10_5} object
11
  */
12
- window.SV_WC_Google_Pay_Handler_v5_10_5 = class SV_WC_Google_Pay_Handler_v5_10_5 {
13
 
14
  /**
15
  * Handler constructor.
@@ -605,6 +605,6 @@ jQuery( function( $ ) {
605
  }
606
  }
607
 
608
- $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_5_loaded' );
609
 
610
  } );
7
  *
8
  * @since 5.10.0
9
  *
10
+ * @type {SV_WC_Google_Pay_Handler_v5_10_7} object
11
  */
12
+ window.SV_WC_Google_Pay_Handler_v5_10_7 = class SV_WC_Google_Pay_Handler_v5_10_7 {
13
 
14
  /**
15
  * Handler constructor.
605
  }
606
  }
607
 
608
+ $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_7_loaded' );
609
 
610
  } );
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Direct' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Direct' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Helper' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Hosted' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Hosted' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) :
30
 
31
 
32
  /**
@@ -169,9 +169,9 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
169
 
170
  wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), WC_VERSION, true );
171
 
172
- wp_enqueue_style( "$handle-v5_10_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array( 'dashicons' ), SV_WC_Plugin::VERSION );
173
 
174
- wp_enqueue_script( "$handle-v5_10_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::VERSION );
175
  }
176
 
177
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) :
30
 
31
 
32
  /**
169
 
170
  wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), WC_VERSION, true );
171
 
172
+ wp_enqueue_style( "$handle-v5_10_7", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array( 'dashicons' ), SV_WC_Plugin::VERSION );
173
 
174
+ wp_enqueue_script( "$handle-v5_10_7", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::VERSION );
175
  }
176
 
177
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Form' ) ) :
30
 
31
 
32
  /**
@@ -1064,7 +1064,7 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
1064
 
1065
  if ( is_array( $card_types ) && ! empty( $card_types ) ) {
1066
 
1067
- $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types );
1068
  }
1069
  }
1070
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Payment_Form' ) ) :
30
 
31
 
32
  /**
1064
 
1065
  if ( is_array( $card_types ) && ! empty( $card_types ) ) {
1066
 
1067
+ $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_10_7\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types );
1068
  }
1069
  }
1070
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php CHANGED
@@ -22,16 +22,16 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
28
  use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
29
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout;
30
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Plugin' ) ) :
35
 
36
 
37
  /**
@@ -188,10 +188,10 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
188
  add_action( 'init', array( $this, 'maybe_init_my_payment_methods' ) );
189
 
190
  // apple pay feature
191
- add_action( 'init', array( $this, 'maybe_init_apple_pay' ) );
192
 
193
  // Google Pay feature
194
- add_action( 'init', [ $this, 'maybe_init_google_pay' ] );
195
 
196
  // TODO: move these to Subscriptions integration
197
  if ( $this->is_subscriptions_active() ) {
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
28
  use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\External_Checkout;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Plugin' ) ) :
35
 
36
 
37
  /**
188
  add_action( 'init', array( $this, 'maybe_init_my_payment_methods' ) );
189
 
190
  // apple pay feature
191
+ add_action( 'wp_loaded', [ $this, 'maybe_init_apple_pay' ] );
192
 
193
  // Google Pay feature
194
+ add_action( 'wp_loaded', [ $this, 'maybe_init_google_pay' ] );
195
 
196
  // TODO: move these to Subscriptions integration
197
  if ( $this->is_subscriptions_active() ) {
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Privacy' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Privacy' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway' ) ) :
30
 
31
 
32
  /**
@@ -460,7 +460,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
460
  }
461
 
462
  $handle = 'sv-wc-payment-gateway-payment-form';
463
- $versioned_handle = $handle . '-v5_10_5';
464
 
465
  // Frontend JS
466
  wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-payment' ), SV_WC_Plugin::VERSION, true );
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway' ) ) :
30
 
31
 
32
  /**
460
  }
461
 
462
  $handle = 'sv-wc-payment-gateway-payment-form';
463
+ $versioned_handle = $handle . '-v5_10_7';
464
 
465
  // Frontend JS
466
  wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-payment' ), SV_WC_Plugin::VERSION, true );
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Exception' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Exception' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Integration' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Token' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Payment_Token' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) :
30
 
31
 
32
 
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) :
30
 
31
 
32
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php CHANGED
@@ -22,18 +22,18 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway;
26
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API as Plugin_REST_API;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\REST_API' ) ) :
31
 
32
 
33
  /**
34
  * The payment gateway plugin REST API handler class.
35
  *
36
- * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API
37
  *
38
  * @since 5.2.0
39
  */
@@ -45,7 +45,7 @@ class REST_API extends Plugin_REST_API {
45
  *
46
  * Plugins can override this to add their own data.
47
  *
48
- * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API::get_system_status_data()
49
  *
50
  * @since 5.2.0
51
  *
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\Payment_Gateway;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\REST_API as Plugin_REST_API;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment_Gateway\\REST_API' ) ) :
31
 
32
 
33
  /**
34
  * The payment gateway plugin REST API handler class.
35
  *
36
+ * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_7\REST_API
37
  *
38
  * @since 5.2.0
39
  */
45
  *
46
  * Plugins can override this to add their own data.
47
  *
48
+ * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_7\REST_API::get_system_status_data()
49
  *
50
  * @since 5.2.0
51
  *
vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/Controllers/Settings.php CHANGED
@@ -22,14 +22,14 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API\Controllers;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API\Abstract_Settings;
28
- use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API\Setting;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\REST_API\\Controllers\\Settings' ) ) :
33
 
34
  /**
35
  * The settings controller class.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7\REST_API\Controllers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Settings_API\Abstract_Settings;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_7\Settings_API\Setting;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\REST_API\\Controllers\\Settings' ) ) :
33
 
34
  /**
35
  * The settings controller class.
vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\REST_API' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\REST_API' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php CHANGED
@@ -23,11 +23,11 @@
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Async_Request' ) ) :
31
 
32
 
33
  /**
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WP_Async_Request' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php CHANGED
@@ -23,11 +23,11 @@
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Background_Job_Handler' ) ) :
31
 
32
 
33
  /**
23
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
24
  */
25
 
26
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WP_Background_Job_Handler' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php CHANGED
@@ -22,11 +22,11 @@
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
- namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
- if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Job_Batch_Handler' ) ) :
30
 
31
 
32
  /**
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
25
+ namespace SkyVerge\WooCommerce\PluginFramework\v5_10_7;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\SV_WP_Job_Batch_Handler' ) ) :
30
 
31
 
32
  /**
woocommerce-gateway-paypal-powered-by-braintree.php CHANGED
@@ -6,12 +6,12 @@
6
  * Description: Receive credit card or PayPal payments using Braintree for WooCommerce. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
7
  * Author: WooCommerce
8
  * Author URI: http://woocommerce.com/
9
- * Version: 2.5.0
10
  * Text Domain: woocommerce-gateway-paypal-powered-by-braintree
11
  * Domain Path: /i18n/languages/
12
  *
13
  * WC requires at least: 3.0.9
14
- * WC tested up to: 5.1.0
15
  *
16
  * Copyright (c) 2016-2020, Automattic, Inc.
17
  *
@@ -59,7 +59,7 @@ class WC_PayPal_Braintree_Loader {
59
  const MINIMUM_WC_VERSION = '3.5';
60
 
61
  /** SkyVerge plugin framework version used by this plugin */
62
- const FRAMEWORK_VERSION = '5.10.5';
63
 
64
  /** the plugin name, for displaying notices */
65
  const PLUGIN_NAME = 'Braintree for WooCommerce';
6
  * Description: Receive credit card or PayPal payments using Braintree for WooCommerce. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
7
  * Author: WooCommerce
8
  * Author URI: http://woocommerce.com/
9
+ * Version: 2.6.0
10
  * Text Domain: woocommerce-gateway-paypal-powered-by-braintree
11
  * Domain Path: /i18n/languages/
12
  *
13
  * WC requires at least: 3.0.9
14
+ * WC tested up to: 5.2.2
15
  *
16
  * Copyright (c) 2016-2020, Automattic, Inc.
17
  *
59
  const MINIMUM_WC_VERSION = '3.5';
60
 
61
  /** SkyVerge plugin framework version used by this plugin */
62
+ const FRAMEWORK_VERSION = '5.10.7';
63
 
64
  /** the plugin name, for displaying notices */
65
  const PLUGIN_NAME = 'Braintree for WooCommerce';