WooCommerce PayPal Powered by Braintree Payment Gateway - Version 2.6.3

Version Description

  • 2022-03-16 =
  • Fix - is_ajax deprecation message
  • Fix - URL for dynamic descriptors documentation in settings page
  • Fix - Don't show "- OR -" if Apple Pay enabled but not available in current browser
Download this release

Release Info

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

Code changes from version 2.6.2 to 2.6.3

Files changed (159) hide show
  1. assets/js/admin/wc-braintree.min.js +1 -1
  2. assets/js/frontend/wc-braintree-apple-pay.min.js +1 -1
  3. assets/js/frontend/wc-braintree-my-payment-methods.min.js +1 -1
  4. assets/js/frontend/wc-braintree.min.js +1 -1
  5. changelog.txt +5 -0
  6. class-wc-braintree.php +4 -4
  7. i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot +4 -4
  8. includes/PayPal/Buttons/Abstract_Button.php +1 -1
  9. includes/PayPal/Buttons/Cart.php +1 -1
  10. includes/PayPal/Buttons/Product.php +1 -1
  11. includes/api/class-wc-braintree-api-response-message-helper.php +1 -1
  12. includes/api/class-wc-braintree-api.php +1 -1
  13. includes/api/requests/abstract-wc-braintree-api-request.php +1 -1
  14. includes/api/requests/class-wc-braintree-api-customer-request.php +1 -1
  15. includes/api/requests/class-wc-braintree-api-transaction-request.php +1 -1
  16. includes/api/responses/abstract-wc-braintree-api-response.php +1 -1
  17. includes/api/responses/abstract-wc-braintree-api-transaction-response.php +1 -1
  18. includes/api/responses/abstract-wc-braintree-api-vault-response.php +1 -1
  19. includes/api/responses/class-wc-braintree-api-client-token-response.php +1 -1
  20. includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php +1 -1
  21. includes/api/responses/class-wc-braintree-api-customer-response.php +1 -1
  22. includes/api/responses/class-wc-braintree-api-merchant-configuration-response.php +1 -1
  23. includes/api/responses/class-wc-braintree-api-payment-method-response.php +1 -1
  24. includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php +1 -1
  25. includes/apple-pay/api/class-wc-braintree-apple-pay-api-payment-response.php +1 -1
  26. includes/apple-pay/class-wc-braintree-apple-pay-frontend.php +1 -1
  27. includes/apple-pay/class-wc-braintree-apple-pay.php +1 -1
  28. includes/class-wc-braintree-capture.php +1 -1
  29. includes/class-wc-braintree-frontend.php +1 -1
  30. includes/class-wc-braintree-lifecycle.php +1 -1
  31. includes/class-wc-braintree-my-payment-methods.php +1 -1
  32. includes/class-wc-braintree-payment-method-handler.php +1 -1
  33. includes/class-wc-braintree-payment-method.php +1 -1
  34. includes/class-wc-gateway-braintree-credit-card.php +1 -1
  35. includes/class-wc-gateway-braintree-paypal.php +2 -2
  36. includes/class-wc-gateway-braintree.php +2 -2
  37. includes/integrations/Pre_Orders.php +1 -1
  38. includes/integrations/Product_Addons.php +1 -1
  39. includes/payment-forms/abstract-wc-braintree-payment-form.php +1 -1
  40. includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php +2 -2
  41. includes/payment-forms/class-wc-braintree-paypal-payment-form.php +1 -1
  42. readme.txt +7 -2
  43. vendor/autoload.php +1 -1
  44. vendor/composer/ClassLoader.php +11 -102
  45. vendor/composer/InstalledVersions.php +6 -19
  46. vendor/composer/autoload_real.php +4 -4
  47. vendor/composer/autoload_static.php +5 -5
  48. vendor/composer/installed.json +7 -7
  49. vendor/composer/installed.php +5 -5
  50. vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php +3 -3
  51. vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php +3 -3
  52. vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php +3 -3
  53. vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php +6 -6
  54. vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php +8 -8
  55. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php +4 -4
  56. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php +4 -4
  57. vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php +4 -4
  58. vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php +3 -3
  59. vendor/skyverge/wc-plugin-framework/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php +4 -4
  60. vendor/skyverge/wc-plugin-framework/woocommerce/api/Abstract_Cacheable_API_Base.php +273 -0
  61. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php +3 -3
  62. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php +3 -3
  63. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php +3 -3
  64. vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php +3 -3
  65. vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php +50 -19
  66. vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php +3 -3
  67. vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php +3 -3
  68. vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php +3 -3
  69. vendor/skyverge/wc-plugin-framework/woocommerce/api/traits/Cacheable_Request_Trait.php +160 -0
  70. vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt +17 -0
  71. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php +3 -3
  72. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-framework-bootstrap.php +1 -1
  73. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php +55 -4
  74. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php +3 -3
  75. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php +3 -3
  76. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php +3 -3
  77. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php +3 -3
  78. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php +19 -82
  79. vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php +3 -3
  80. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php +3 -3
  81. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php +3 -3
  82. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php +3 -3
  83. vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php +3 -3
  84. vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po +29 -38
  85. vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot +32 -41
  86. vendor/skyverge/wc-plugin-framework/woocommerce/index.php +1 -1
  87. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php +3 -3
  88. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php +5 -5
  89. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php +9 -9
  90. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php +5 -5
  91. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php +5 -5
  92. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php +7 -7
  93. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php +9 -9
  94. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Orders.php +3 -3
  95. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php +3 -3
  96. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php +3 -3
  97. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php +4 -4
  98. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php +3 -3
  99. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php +4 -4
  100. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php +3 -3
  101. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php +6 -6
  102. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php +5 -5
  103. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php +4 -4
  104. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php +4 -4
  105. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php +4 -4
  106. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php +4 -4
  107. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php +3 -3
  108. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php +3 -3
  109. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php +3 -3
  110. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php +1 -1
  111. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-order-partial-capture.php +1 -1
  112. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php +1 -1
  113. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor.php +1 -1
  114. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-profile-field-customer-id.php +1 -1
  115. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-profile-section.php +1 -1
  116. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php +3 -3
  117. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php +3 -3
  118. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php +3 -3
  119. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php +3 -3
  120. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php +3 -3
  121. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php +3 -3
  122. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php +3 -3
  123. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php +3 -3
  124. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php +3 -3
  125. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php +3 -3
  126. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php +3 -3
  127. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php +3 -3
  128. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map +1 -1
  129. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js +1 -1
  130. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map +1 -1
  131. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js +1 -1
  132. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map +1 -1
  133. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js +1 -1
  134. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map +1 -1
  135. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js +1 -1
  136. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map +1 -1
  137. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/images/license.txt +1 -1
  138. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js +3 -3
  139. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +3 -3
  140. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php +3 -3
  141. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php +3 -3
  142. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php +5 -5
  143. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php +47 -8
  144. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php +6 -6
  145. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php +3 -3
  146. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +9 -9
  147. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php +3 -3
  148. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php +3 -3
  149. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php +3 -3
  150. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +3 -3
  151. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php +3 -3
  152. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php +3 -3
  153. vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php +6 -6
  154. vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/Controllers/Settings.php +5 -5
  155. vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php +3 -3
  156. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php +4 -4
  157. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php +4 -4
  158. vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php +3 -3
  159. woocommerce-gateway-paypal-powered-by-braintree.php +2 -2
assets/js/admin/wc-braintree.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";jQuery(document).ready(function(r){var _,n,p=wc_braintree_admin_params.button_sizes,l=!1,i=!1,c=!1,y=!1,s=r("#wc_braintree_paypal_pay_later_message_preview"),m=null,b=function(){return r("#woocommerce_braintree_paypal_pay_later_messaging_logo_type").val()};r("#woocommerce_braintree_paypal_enable_paypal_pay_later").on("change",function(){r(".pay-later-field").closest("tr").toggle(r(this).prop("checked")&&r(this).is(":visible"))}).change(),r("#woocommerce_braintree_paypal_pay_later_messaging_logo_type").on("change",function(){r("#woocommerce_braintree_paypal_pay_later_messaging_logo_position").closest("tr").toggle("primary"===b())}).change(),r("#woocommerce_braintree_paypal_button_color, #woocommerce_braintree_paypal_button_size, #woocommerce_braintree_paypal_button_shape, #woocommerce_braintree_paypal_enable_paypal_pay_later, #woocommerce_braintree_paypal_pay_later_messaging_text_color, #woocommerce_braintree_paypal_pay_later_messaging_logo_type, #woocommerce_braintree_paypal_pay_later_messaging_logo_position").on("change",function(){_&&_.close&&l&&_.close().then(function(){r("#wc_braintree_paypal_button_preview").empty()}),n&&n.close&&i&&n.close().then(function(){r("#wc_braintree_paypal_button_preview_paylater").empty()}),i=l=!1;var e=r("#woocommerce_braintree_paypal_button_color").val(),a=r("#woocommerce_braintree_paypal_button_size").val(),t=r("#woocommerce_braintree_paypal_button_shape").val(),o=r("#woocommerce_braintree_paypal_enable_paypal_pay_later").is(":checked"),t={env:"sandbox",style:{label:"pay",color:e,shape:t,layout:"vertical",tagline:!1},fundingSource:paypal.FUNDING.PAYPAL,client:{sandbox:"sandbox"},payment:function(e,a){return a.payment.create({payment:{transactions:[{amount:{total:"0.01",currency:"USD"}}]}})},onAuthorize:function(){}};"responsive"!==a&&(t.style.height=p[a].height),s.attr("data-pp-style-logo-type",b()),s.attr("data-pp-style-logo-position",r("#woocommerce_braintree_paypal_pay_later_messaging_logo_position").val()),s.attr("data-pp-style-text-color",r("#woocommerce_braintree_paypal_pay_later_messaging_text_color").val()),!m&&s.length&&(m=paypal.Messages({onRender:function(){s.attr("data-pp-amount",100)}})).render("#"+s.attr("id")).catch(function(e){return console.log(e)}),s.toggle(o),l||c||(c=!0,_=paypal.Buttons(t),"responsive"!==a?r("#wc_braintree_paypal_button_preview").width(p[a].width):r("#wc_braintree_paypal_button_preview").width("100%"),_.render("#wc_braintree_paypal_button_preview").then(function(){c=!(l=!0)})),!o||i||y||(y=!0,(t=t).fundingSource=paypal.FUNDING.PAYLATER,(n=paypal.Buttons(t)).isEligible()&&("responsive"!==a?r("#wc_braintree_paypal_button_preview_paylater").width(p[a].width):r("#wc_braintree_paypal_button_preview_paylater").width("100%"),n.render("#wc_braintree_paypal_button_preview_paylater").then(function(){y=!(i=!0)})))}).first().change()});
1
+ "use strict";jQuery(document).ready(function(r){function _(){return r("#woocommerce_braintree_paypal_pay_later_messaging_logo_type").val()}var n,p,l=wc_braintree_admin_params.button_sizes,i=!1,c=!1,y=!1,s=!1,m=r("#wc_braintree_paypal_pay_later_message_preview"),b=null;r("#woocommerce_braintree_paypal_enable_paypal_pay_later").on("change",function(){r(".pay-later-field").closest("tr").toggle(r(this).prop("checked")&&r(this).is(":visible"))}).change(),r("#woocommerce_braintree_paypal_pay_later_messaging_logo_type").on("change",function(){r("#woocommerce_braintree_paypal_pay_later_messaging_logo_position").closest("tr").toggle("primary"===_())}).change(),r("#woocommerce_braintree_paypal_button_color, #woocommerce_braintree_paypal_button_size, #woocommerce_braintree_paypal_button_shape, #woocommerce_braintree_paypal_enable_paypal_pay_later, #woocommerce_braintree_paypal_pay_later_messaging_text_color, #woocommerce_braintree_paypal_pay_later_messaging_logo_type, #woocommerce_braintree_paypal_pay_later_messaging_logo_position").on("change",function(){n&&n.close&&i&&n.close().then(function(){r("#wc_braintree_paypal_button_preview").empty()}),p&&p.close&&c&&p.close().then(function(){r("#wc_braintree_paypal_button_preview_paylater").empty()}),c=i=!1;var e=r("#woocommerce_braintree_paypal_button_color").val(),a=r("#woocommerce_braintree_paypal_button_size").val(),t=r("#woocommerce_braintree_paypal_button_shape").val(),o=r("#woocommerce_braintree_paypal_enable_paypal_pay_later").is(":checked"),e={env:"sandbox",style:{label:"pay",color:e,shape:t,layout:"vertical",tagline:!1},fundingSource:paypal.FUNDING.PAYPAL,client:{sandbox:"sandbox"},payment:function(e,a){return a.payment.create({payment:{transactions:[{amount:{total:"0.01",currency:"USD"}}]}})},onAuthorize:function(e,a){}};"responsive"!==a&&(e.style.height=l[a].height),m.attr("data-pp-style-logo-type",_()),m.attr("data-pp-style-logo-position",r("#woocommerce_braintree_paypal_pay_later_messaging_logo_position").val()),m.attr("data-pp-style-text-color",r("#woocommerce_braintree_paypal_pay_later_messaging_text_color").val()),!b&&m.length&&(b=paypal.Messages({onRender:function(){m.attr("data-pp-amount",100)}})).render("#"+m.attr("id")).catch(function(e){return console.log(e)}),m.toggle(o),i||y||(y=!0,n=paypal.Buttons(e),"responsive"!==a?r("#wc_braintree_paypal_button_preview").width(l[a].width):r("#wc_braintree_paypal_button_preview").width("100%"),n.render("#wc_braintree_paypal_button_preview").then(function(){y=!(i=!0)})),!o||c||s||(s=!0,(t=e).fundingSource=paypal.FUNDING.PAYLATER,(p=paypal.Buttons(t)).isEligible()&&("responsive"!==a?r("#wc_braintree_paypal_button_preview_paylater").width(l[a].width):r("#wc_braintree_paypal_button_preview_paylater").width("100%"),p.render("#wc_braintree_paypal_button_preview_paylater").then(function(){s=!(c=!0)})))}).first().change()});
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_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);
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}o=Object.getPrototypeOf(t);if(null!==o)return e(o,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_12),_createClass(o,[{key:"is_available",value:function(){return window.ApplePaySession&&ApplePaySession.canMakePayments()}},{key:"init",value:function(){if(this.is_available()||t(".sv-wc-external-checkout").hide(),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-my-payment-methods.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}}();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(){jQuery(document).ready(function(n){var a;function t(e){_classCallCheck(this,t);e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.save_method=e.save_method.bind(e),e}return a=window.WC_Braintree_My_Payment_Methods_Handler=(_inherits(t,SV_WC_Payment_Methods_Handler_v5_10_7),_createClass(t,[{key:"save_method",value:function(e){var t,r,o=this;if(!function(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}(this,a),e.preventDefault(),t=n(e.currentTarget),0!==(r=t.parents("tr")).find("input[name=plugin-id][value="+this.slug+"]").length)return this.block_ui(),r.next(".error").remove(),e={action:"wc_"+this.id+"_save_payment_method",nonce:this.ajax_nonce,token_id:r.find("input[name=token-id]").val(),data:r.find("input[name]").serialize()},n.post(this.ajax_url,e).done(function(e){return e.success?(null!=e.data.title&&r.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.expires&&r.find(".woocommerce-PaymentMethod--expires").html(e.data.expires),null!=e.data.nonce&&(o.ajax_nonce=e.data.nonce),t.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(o.i18n.edit_button).addClass("button"),o.disable_editing_ui()):o.display_error(r,e.data)}).fail(function(e,t,n){return o.display_error(r,n)}).always(function(){return o.unblock_ui()})}}]),t),n(document.body).trigger("wc_braintree_my_payment_methods_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}}();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(){jQuery(document).ready(function(n){var a;function t(e){_classCallCheck(this,t);e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.save_method=e.save_method.bind(e),e}return a=window.WC_Braintree_My_Payment_Methods_Handler=(_inherits(t,SV_WC_Payment_Methods_Handler_v5_10_12),_createClass(t,[{key:"save_method",value:function(e){var t,r,o=this;if(!(this instanceof a))throw new Error("Bound instance method accessed before binding");if(e.preventDefault(),t=n(e.currentTarget),0!==(r=t.parents("tr")).find("input[name=plugin-id][value="+this.slug+"]").length)return this.block_ui(),r.next(".error").remove(),e={action:"wc_"+this.id+"_save_payment_method",nonce:this.ajax_nonce,token_id:r.find("input[name=token-id]").val(),data:r.find("input[name]").serialize()},n.post(this.ajax_url,e).done(function(e){return e.success?(null!=e.data.title&&r.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.expires&&r.find(".woocommerce-PaymentMethod--expires").html(e.data.expires),null!=e.data.nonce&&(o.ajax_nonce=e.data.nonce),t.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(o.i18n.edit_button).addClass("button"),o.disable_editing_ui()):o.display_error(r,e.data)}).fail(function(e,t,n){return o.display_error(r,n)}).always(function(){return o.unblock_ui()})}}]),t),n(document.body).trigger("wc_braintree_my_payment_methods_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.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.set_device_data(),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:"set_device_data",value:function(){if(braintree&&braintree.dataCollector)return braintree.dataCollector.create({client:this.client}).then(function(e){if(e&&e.deviceData)return s("input[id*='wc_braintree_device_data']").val(e.deviceData)})}},{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()}},{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}}]),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}i=Object.getPrototypeOf(t);if(null!==i)return e(i,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,r,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 o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).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 n(e){_classCallCheck(this,n);var t=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).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 a(e){_classCallCheck(this,a);var t=_possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).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.set_device_data(),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:"set_device_data",value:function(){if(braintree&&braintree.dataCollector)return braintree.dataCollector.create({client:this.client}).then(function(e){if(e&&e.deviceData)return s("input[id*='wc_braintree_device_data']").val(e.deviceData)})}},{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(e){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){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]: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(o,WC_Braintree_Payment_Form_Handler),_createClass(o,[{key:"handle_checkout_error",value:function(){return _get(o.prototype.__proto__||Object.getPrototypeOf(o.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(o.prototype.__proto__||Object.getPrototypeOf(o.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(o.prototype.__proto__||Object.getPrototypeOf(o.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,a=[];if("CUSTOMER"===e.type)switch(e.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&a.push(this.params.cvv_missing),this.using_payment_token()||(a.push(this.params.card_number_missing),a.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=e.details)for(t=0,n=(i=e.details.invalidFieldKeys).length;t<n;t++)switch(i[t]){case"number":a.push(this.params.card_number_invalid);break;case"cvv":a.push(this.params.cvv_length_invalid);break;case"expirationDate":a.push(this.params.card_exp_date_invalid)}}else"NETWORK"===e.type&&null!=e.details.originalError.error.message&&(r=e.details.originalError.error.message,/given name format is invalid/.test(r)&&a.push(this.params.first_name_unsupported_characters),/surname format is invalid/.test(r)&&a.push(this.params.last_name_unsupported_characters));return a.length?a.join("<br/>"):_get(o.prototype.__proto__||Object.getPrototypeOf(o.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?(e=e.cards[0],s("input[name=wc-"+this.id_dasherized+"-card-type]").val(e.type),null!=e.type&&(n=e.type,0<=c.call(this.enabled_card_types,n))?t.addClass("card-type-"+e.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(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"setup_integration",t).call(t)}).catch(function(e){return t.handle_integration_error(e)})):_get(o.prototype.__proto__||Object.getPrototypeOf(o.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){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,i=s("#billing_state").val(),a=s("#billing_country").val(),o=s("#shipping_state").val(),_=s("#shipping_country").val(),i=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 i&&i.length<=2?i:"",postalCode:s("input[name=billing_postcode]").val(),countryCodeAlpha2:"string"==typeof a&&a.length<=2?a:""}:{},a=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 o&&o.length<=2?o:"",postalCode:s("input[name=shipping_postcode]").val(),countryCodeAlpha2:"string"==typeof _&&_.length<=2?_:""}}:{},o={nonce:e,amount:s("input[name=wc-"+this.id_dasherized+"-3d-secure-order-total]").val(),email:s("input[name=billing_email]").val(),billingAddress:i,additionalInformation:a,onLookupComplete:function(e,t){n.log("3D Secure lookup complete.",e);try{return t()}catch(e){return n.handle_payment_error(e)}}};return"1"===s("input[name=wc-"+this.id_dasherized+"-cart-contains-subscription]").val()&&(o.challengeRequested=!0),this.log("Verifying 3D Secure.",o),this.threeDSecure.verifyCard(o).then(function(e){return n.log("3D Secure response received.",e),n.threeds.liability_shift_always_required&&!e.liabilityShifted?n.render_error(n.threeds.failure_message):(null!=r&&r.data("verified",!0),s("input[name=wc-"+n.id_dasherized+"-3d-secure-verified]").val(1),n.submit_form(e.nonce))}).catch(function(e){return n.handle_payment_error(e)})}},{key:"show_integration_ui",value:function(){return u(this,e),_get(o.prototype.__proto__||Object.getPrototypeOf(o.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(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"hide_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").hide()}}]),o),s(document.body).trigger("wc_braintree_credit_card_payment_form_handler_loaded"),r=window.WC_Braintree_PayPal_Payment_Form_Handler=(_inherits(n,WC_Braintree_Payment_Form_Handler),_createClass(n,[{key:"init",value:function(){var t=this;return _get(n.prototype.__proto__||Object.getPrototypeOf(n.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(n.prototype.__proto__||Object.getPrototypeOf(n.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(n.prototype.__proto__||Object.getPrototypeOf(n.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(n.prototype.__proto__||Object.getPrototypeOf(n.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,r),this.cart_payment_nonce?this.unblock_ui():this.load_paypal_sdk()}},{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,t){var n=this;return u(this,r),this.block_ui(),this.integration.tokenizePayment(e).then(function(e){return n.log("Payment method tokenized.",e),n.set_payment_method(e)}).catch(function(e){return n.handle_payment_error(e),n.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(n.prototype.__proto__||Object.getPrototypeOf(n.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,r),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=[[],this.disabled_funding_options],n=t[0],t=t[1];return this.is_paypal_card_enabled||t.push("card"),(this.is_paypal_pay_later_enabled?n:t).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),n.length&&(e["enable-funding"]=n.join(",")),t.length&&(e["disable-funding"]=t.join(",")),e}}]),n),s(document.body).trigger("wc_braintree_paypal_payment_form_handler_loaded"),window.WC_Braintree_PayPal_Cart_Handler=(_inherits(a,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(a,[{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}}]),a),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);
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
3
  = 2.6.2 - 2021-11-16 =
4
  * Feature - Add support for disabling funding methods
5
  * Feature - Allow updating of expiration dates for credit cards in 'My Account'
1
  *** Changelog ***
2
 
3
+ = 2.6.3 - 2022-03-16 =
4
+ * Fix - is_ajax deprecation message
5
+ * Fix - URL for dynamic descriptors documentation in settings page
6
+ * Fix - Don't show "- OR -" if Apple Pay enabled but not available in current browser
7
+
8
  = 2.6.2 - 2021-11-16 =
9
  * Feature - Add support for disabling funding methods
10
  * Feature - Allow updating of expiration dates for credit cards in 'My Account'
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_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
@@ -35,7 +35,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
35
 
36
 
37
  /** plugin version number */
38
- const VERSION = '2.6.2';
39
 
40
  /** Braintree JS SDK version */
41
  const BRAINTREE_JS_SDK_VERSION = '3.73.1';
@@ -110,7 +110,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
110
  public function includes() {
111
 
112
  // frontend instance
113
- if ( ! is_admin() && ! is_ajax() ) {
114
  $this->frontend = $this->load_class( '/includes/class-wc-braintree-frontend.php', 'WC_Braintree_Frontend' );
115
  }
116
 
@@ -243,7 +243,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
243
  require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
244
 
245
  foreach ( $class_names as $class_name ) {
246
- class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\{$class_name}", "WC_Braintree\\Plugin_Framework\\{$class_name}" );
247
  }
248
  }
249
 
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_12 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
35
 
36
 
37
  /** plugin version number */
38
+ const VERSION = '2.6.3';
39
 
40
  /** Braintree JS SDK version */
41
  const BRAINTREE_JS_SDK_VERSION = '3.73.1';
110
  public function includes() {
111
 
112
  // frontend instance
113
+ if ( ! is_admin() && ! wp_doing_ajax() ) {
114
  $this->frontend = $this->load_class( '/includes/class-wc-braintree-frontend.php', 'WC_Braintree_Frontend' );
115
  }
116
 
243
  require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
244
 
245
  foreach ( $class_names as $class_name ) {
246
+ class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\{$class_name}", "WC_Braintree\\Plugin_Framework\\{$class_name}" );
247
  }
248
  }
249
 
i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot CHANGED
@@ -1,15 +1,15 @@
1
- # Copyright (C) 2021 WooCommerce
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.2\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
- "POT-Creation-Date: 2021-11-16 17:55:11+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
1
+ # Copyright (C) 2022 WooCommerce
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.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
+ "POT-Creation-Date: 2022-03-14 17:32:09+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
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_7 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_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\PayPal\Buttons;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 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_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\Apple_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 as Framework;
28
 
29
  /**
30
  * Braintree Frontend class
24
 
25
  defined( 'ABSPATH' ) or exit;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
includes/class-wc-braintree-my-payment-methods.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_7 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_12 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
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_7 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_12 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_7 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_12 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_7 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_12 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_7 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
@@ -127,7 +127,7 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
127
  return;
128
  }
129
 
130
- if ( is_admin() && ! is_ajax() ) {
131
  return;
132
  }
133
 
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
127
  return;
128
  }
129
 
130
+ if ( is_admin() && ! wp_doing_ajax() ) {
131
  return;
132
  }
133
 
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_7 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
@@ -450,7 +450,7 @@ class WC_Gateway_Braintree extends Framework\SV_WC_Payment_Gateway_Direct {
450
  'title' => __( 'Dynamic Descriptors', 'woocommerce-gateway-paypal-powered-by-braintree' ),
451
  'type' => 'title',
452
  /* translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag, %4$s - </a> tag */
453
- 'description' => sprintf( esc_html__( 'Dynamic descriptors define what will appear on your customers\' credit card statements for a specific purchase. Contact Braintree to enable these for your account.%1$sPlease ensure that you have %3$sread the documentation on dynamic descriptors%4$s and are using an accepted format.%2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), '<p style="font-weight: bold;">', '</p>', '<a target="_blank" href="https://docs.woocommerce.com/document/braintree/#dynamic-descriptor-setup">', '</a>' ),
454
  ),
455
 
456
  'name_dynamic_descriptor' => array(
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_12 as Framework;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
450
  'title' => __( 'Dynamic Descriptors', 'woocommerce-gateway-paypal-powered-by-braintree' ),
451
  'type' => 'title',
452
  /* translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag, %4$s - </a> tag */
453
+ 'description' => sprintf( esc_html__( 'Dynamic descriptors define what will appear on your customers\' credit card statements for a specific purchase. Contact Braintree to enable these for your account.%1$sPlease ensure that you have %3$sread the documentation on dynamic descriptors%4$s and are using an accepted format.%2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), '<p style="font-weight: bold;">', '</p>', '<a target="_blank" href="https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/#dynamic-descriptors-setup">', '</a>' ),
454
  ),
455
 
456
  'name_dynamic_descriptor' => array(
includes/integrations/Pre_Orders.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  namespace WC_Braintree\Integrations;
26
 
27
- use SkyVerge\WooCommerce\PluginFramework\v5_10_7 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
24
 
25
  namespace WC_Braintree\Integrations;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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_7 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_12 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_7 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_12 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_7 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_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( [
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_12 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_12\\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_7 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
23
  */
24
 
25
  use WC_Braintree\PayPal\Buttons\Abstract_Button;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
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.2
6
  Requires PHP: 5.4
7
- Stable tag: 2.6.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -107,6 +107,11 @@ If not, please get in touch with us through the [plugin forums](https://wordpres
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
110
  = 2.6.2 - 2021-11-16 =
111
  * Feature - Add support for disabling funding methods
112
  * Feature - Allow updating of expiration dates for credit cards in 'My Account'
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.9.2
6
  Requires PHP: 5.4
7
+ Stable tag: 2.6.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
107
 
108
  == Changelog ==
109
 
110
+ = 2.6.3 - 2022-03-16 =
111
+ * Fix - is_ajax deprecation message
112
+ * Fix - URL for dynamic descriptors documentation in settings page
113
+ * Fix - Don't show "- OR -" if Apple Pay enabled but not available in current browser
114
+
115
  = 2.6.2 - 2021-11-16 =
116
  * Feature - Add support for disabling funding methods
117
  * Feature - Allow updating of expiration dates for credit cards in 'My Account'
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit9b2474036b822a585558437604722fc9::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitbec19e61a0ae83492b90567eb2a275dd::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -42,75 +42,30 @@ namespace Composer\Autoload;
42
  */
43
  class ClassLoader
44
  {
45
- /** @var ?string */
46
  private $vendorDir;
47
 
48
  // PSR-4
49
- /**
50
- * @var array[]
51
- * @psalm-var array<string, array<string, int>>
52
- */
53
  private $prefixLengthsPsr4 = array();
54
- /**
55
- * @var array[]
56
- * @psalm-var array<string, array<int, string>>
57
- */
58
  private $prefixDirsPsr4 = array();
59
- /**
60
- * @var array[]
61
- * @psalm-var array<string, string>
62
- */
63
  private $fallbackDirsPsr4 = array();
64
 
65
  // PSR-0
66
- /**
67
- * @var array[]
68
- * @psalm-var array<string, array<string, string[]>>
69
- */
70
  private $prefixesPsr0 = array();
71
- /**
72
- * @var array[]
73
- * @psalm-var array<string, string>
74
- */
75
  private $fallbackDirsPsr0 = array();
76
 
77
- /** @var bool */
78
  private $useIncludePath = false;
79
-
80
- /**
81
- * @var string[]
82
- * @psalm-var array<string, string>
83
- */
84
  private $classMap = array();
85
-
86
- /** @var bool */
87
  private $classMapAuthoritative = false;
88
-
89
- /**
90
- * @var bool[]
91
- * @psalm-var array<string, bool>
92
- */
93
  private $missingClasses = array();
94
-
95
- /** @var ?string */
96
  private $apcuPrefix;
97
 
98
- /**
99
- * @var self[]
100
- */
101
  private static $registeredLoaders = array();
102
 
103
- /**
104
- * @param ?string $vendorDir
105
- */
106
  public function __construct($vendorDir = null)
107
  {
108
  $this->vendorDir = $vendorDir;
109
  }
110
 
111
- /**
112
- * @return string[]
113
- */
114
  public function getPrefixes()
115
  {
116
  if (!empty($this->prefixesPsr0)) {
@@ -120,47 +75,28 @@ class ClassLoader
120
  return array();
121
  }
122
 
123
- /**
124
- * @return array[]
125
- * @psalm-return array<string, array<int, string>>
126
- */
127
  public function getPrefixesPsr4()
128
  {
129
  return $this->prefixDirsPsr4;
130
  }
131
 
132
- /**
133
- * @return array[]
134
- * @psalm-return array<string, string>
135
- */
136
  public function getFallbackDirs()
137
  {
138
  return $this->fallbackDirsPsr0;
139
  }
140
 
141
- /**
142
- * @return array[]
143
- * @psalm-return array<string, string>
144
- */
145
  public function getFallbackDirsPsr4()
146
  {
147
  return $this->fallbackDirsPsr4;
148
  }
149
 
150
- /**
151
- * @return string[] Array of classname => path
152
- * @psalm-var array<string, string>
153
- */
154
  public function getClassMap()
155
  {
156
  return $this->classMap;
157
  }
158
 
159
  /**
160
- * @param string[] $classMap Class to filename map
161
- * @psalm-param array<string, string> $classMap
162
- *
163
- * @return void
164
  */
165
  public function addClassMap(array $classMap)
166
  {
@@ -175,11 +111,9 @@ class ClassLoader
175
  * Registers a set of PSR-0 directories for a given prefix, either
176
  * appending or prepending to the ones previously set for this prefix.
177
  *
178
- * @param string $prefix The prefix
179
- * @param string[]|string $paths The PSR-0 root directories
180
- * @param bool $prepend Whether to prepend the directories
181
- *
182
- * @return void
183
  */
184
  public function add($prefix, $paths, $prepend = false)
185
  {
@@ -222,13 +156,11 @@ class ClassLoader
222
  * Registers a set of PSR-4 directories for a given namespace, either
223
  * appending or prepending to the ones previously set for this namespace.
224
  *
225
- * @param string $prefix The prefix/namespace, with trailing '\\'
226
- * @param string[]|string $paths The PSR-4 base directories
227
- * @param bool $prepend Whether to prepend the directories
228
  *
229
  * @throws \InvalidArgumentException
230
- *
231
- * @return void
232
  */
233
  public function addPsr4($prefix, $paths, $prepend = false)
234
  {
@@ -272,10 +204,8 @@ class ClassLoader
272
  * Registers a set of PSR-0 directories for a given prefix,
273
  * replacing any others previously set for this prefix.
274
  *
275
- * @param string $prefix The prefix
276
- * @param string[]|string $paths The PSR-0 base directories
277
- *
278
- * @return void
279
  */
280
  public function set($prefix, $paths)
281
  {
@@ -290,12 +220,10 @@ class ClassLoader
290
  * Registers a set of PSR-4 directories for a given namespace,
291
  * replacing any others previously set for this namespace.
292
  *
293
- * @param string $prefix The prefix/namespace, with trailing '\\'
294
- * @param string[]|string $paths The PSR-4 base directories
295
  *
296
  * @throws \InvalidArgumentException
297
- *
298
- * @return void
299
  */
300
  public function setPsr4($prefix, $paths)
301
  {
@@ -315,8 +243,6 @@ class ClassLoader
315
  * Turns on searching the include path for class files.
316
  *
317
  * @param bool $useIncludePath
318
- *
319
- * @return void
320
  */
321
  public function setUseIncludePath($useIncludePath)
322
  {
@@ -339,8 +265,6 @@ class ClassLoader
339
  * that have not been registered with the class map.
340
  *
341
  * @param bool $classMapAuthoritative
342
- *
343
- * @return void
344
  */
345
  public function setClassMapAuthoritative($classMapAuthoritative)
346
  {
@@ -361,8 +285,6 @@ class ClassLoader
361
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
  *
363
  * @param string|null $apcuPrefix
364
- *
365
- * @return void
366
  */
367
  public function setApcuPrefix($apcuPrefix)
368
  {
@@ -383,8 +305,6 @@ class ClassLoader
383
  * Registers this instance as an autoloader.
384
  *
385
  * @param bool $prepend Whether to prepend the autoloader or not
386
- *
387
- * @return void
388
  */
389
  public function register($prepend = false)
390
  {
@@ -404,8 +324,6 @@ class ClassLoader
404
 
405
  /**
406
  * Unregisters this instance as an autoloader.
407
- *
408
- * @return void
409
  */
410
  public function unregister()
411
  {
@@ -485,11 +403,6 @@ class ClassLoader
485
  return self::$registeredLoaders;
486
  }
487
 
488
- /**
489
- * @param string $class
490
- * @param string $ext
491
- * @return string|false
492
- */
493
  private function findFileWithExtension($class, $ext)
494
  {
495
  // PSR-4 lookup
@@ -561,10 +474,6 @@ class ClassLoader
561
  * Scope isolated include.
562
  *
563
  * Prevents access to $this/self from included files.
564
- *
565
- * @param string $file
566
- * @return void
567
- * @private
568
  */
569
  function includeFile($file)
570
  {
42
  */
43
  class ClassLoader
44
  {
 
45
  private $vendorDir;
46
 
47
  // PSR-4
 
 
 
 
48
  private $prefixLengthsPsr4 = array();
 
 
 
 
49
  private $prefixDirsPsr4 = array();
 
 
 
 
50
  private $fallbackDirsPsr4 = array();
51
 
52
  // PSR-0
 
 
 
 
53
  private $prefixesPsr0 = array();
 
 
 
 
54
  private $fallbackDirsPsr0 = array();
55
 
 
56
  private $useIncludePath = false;
 
 
 
 
 
57
  private $classMap = array();
 
 
58
  private $classMapAuthoritative = false;
 
 
 
 
 
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)) {
75
  return array();
76
  }
77
 
 
 
 
 
78
  public function getPrefixesPsr4()
79
  {
80
  return $this->prefixDirsPsr4;
81
  }
82
 
 
 
 
 
83
  public function getFallbackDirs()
84
  {
85
  return $this->fallbackDirsPsr0;
86
  }
87
 
 
 
 
 
88
  public function getFallbackDirsPsr4()
89
  {
90
  return $this->fallbackDirsPsr4;
91
  }
92
 
 
 
 
 
93
  public function getClassMap()
94
  {
95
  return $this->classMap;
96
  }
97
 
98
  /**
99
+ * @param array $classMap Class to filename map
 
 
 
100
  */
101
  public function addClassMap(array $classMap)
102
  {
111
  * Registers a set of PSR-0 directories for a given prefix, either
112
  * appending or prepending to the ones previously set for this prefix.
113
  *
114
+ * @param string $prefix The prefix
115
+ * @param array|string $paths The PSR-0 root directories
116
+ * @param bool $prepend Whether to prepend the directories
 
 
117
  */
118
  public function add($prefix, $paths, $prepend = false)
119
  {
156
  * Registers a set of PSR-4 directories for a given namespace, either
157
  * appending or prepending to the ones previously set for this namespace.
158
  *
159
+ * @param string $prefix The prefix/namespace, with trailing '\\'
160
+ * @param array|string $paths The PSR-4 base directories
161
+ * @param bool $prepend Whether to prepend the directories
162
  *
163
  * @throws \InvalidArgumentException
 
 
164
  */
165
  public function addPsr4($prefix, $paths, $prepend = false)
166
  {
204
  * Registers a set of PSR-0 directories for a given prefix,
205
  * replacing any others previously set for this prefix.
206
  *
207
+ * @param string $prefix The prefix
208
+ * @param array|string $paths The PSR-0 base directories
 
 
209
  */
210
  public function set($prefix, $paths)
211
  {
220
  * Registers a set of PSR-4 directories for a given namespace,
221
  * replacing any others previously set for this namespace.
222
  *
223
+ * @param string $prefix The prefix/namespace, with trailing '\\'
224
+ * @param array|string $paths The PSR-4 base directories
225
  *
226
  * @throws \InvalidArgumentException
 
 
227
  */
228
  public function setPsr4($prefix, $paths)
229
  {
243
  * Turns on searching the include path for class files.
244
  *
245
  * @param bool $useIncludePath
 
 
246
  */
247
  public function setUseIncludePath($useIncludePath)
248
  {
265
  * that have not been registered with the class map.
266
  *
267
  * @param bool $classMapAuthoritative
 
 
268
  */
269
  public function setClassMapAuthoritative($classMapAuthoritative)
270
  {
285
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286
  *
287
  * @param string|null $apcuPrefix
 
 
288
  */
289
  public function setApcuPrefix($apcuPrefix)
290
  {
305
  * Registers this instance as an autoloader.
306
  *
307
  * @param bool $prepend Whether to prepend the autoloader or not
 
 
308
  */
309
  public function register($prepend = false)
310
  {
324
 
325
  /**
326
  * Unregisters this instance as an autoloader.
 
 
327
  */
328
  public function unregister()
329
  {
403
  return self::$registeredLoaders;
404
  }
405
 
 
 
 
 
 
406
  private function findFileWithExtension($class, $ext)
407
  {
408
  // PSR-4 lookup
474
  * Scope isolated include.
475
  *
476
  * Prevents access to $this/self from included files.
 
 
 
 
477
  */
478
  function includeFile($file)
479
  {
vendor/composer/InstalledVersions.php CHANGED
@@ -20,25 +20,12 @@ use Composer\Semver\VersionParser;
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
- * To require its presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
27
- /**
28
- * @var mixed[]|null
29
- * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
30
- */
31
  private static $installed;
32
-
33
- /**
34
- * @var bool|null
35
- */
36
  private static $canGetVendors;
37
-
38
- /**
39
- * @var array[]
40
- * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
41
- */
42
  private static $installedByVendor = array();
43
 
44
  /**
@@ -241,7 +228,7 @@ class InstalledVersions
241
 
242
  /**
243
  * @return array
244
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
245
  */
246
  public static function getRootPackage()
247
  {
@@ -255,7 +242,7 @@ class InstalledVersions
255
  *
256
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
257
  * @return array[]
258
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
259
  */
260
  public static function getRawData()
261
  {
@@ -278,7 +265,7 @@ class InstalledVersions
278
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
279
  *
280
  * @return array[]
281
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
282
  */
283
  public static function getAllRawData()
284
  {
@@ -301,7 +288,7 @@ class InstalledVersions
301
  * @param array[] $data A vendor/composer/installed.php data set
302
  * @return void
303
  *
304
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
305
  */
306
  public static function reload($data)
307
  {
@@ -311,7 +298,7 @@ class InstalledVersions
311
 
312
  /**
313
  * @return array[]
314
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
315
  */
316
  private static function getInstalled()
317
  {
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
 
 
 
 
27
  private static $installed;
 
 
 
 
28
  private static $canGetVendors;
 
 
 
 
 
29
  private static $installedByVendor = array();
30
 
31
  /**
228
 
229
  /**
230
  * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
  */
233
  public static function getRootPackage()
234
  {
242
  *
243
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
  * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
  */
247
  public static function getRawData()
248
  {
265
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
  *
267
  * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
  */
270
  public static function getAllRawData()
271
  {
288
  * @param array[] $data A vendor/composer/installed.php data set
289
  * @return void
290
  *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
  */
293
  public static function reload($data)
294
  {
298
 
299
  /**
300
  * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
  */
303
  private static function getInstalled()
304
  {
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit9b2474036b822a585558437604722fc9
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit9b2474036b822a585558437604722fc9
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit9b2474036b822a585558437604722fc9', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit9b2474036b822a585558437604722fc9', '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\ComposerStaticInit9b2474036b822a585558437604722fc9::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitbec19e61a0ae83492b90567eb2a275dd
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInitbec19e61a0ae83492b90567eb2a275dd', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInitbec19e61a0ae83492b90567eb2a275dd', '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\ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd::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 ComposerStaticInit9b2474036b822a585558437604722fc9
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
@@ -37,10 +37,10 @@ class ComposerStaticInit9b2474036b822a585558437604722fc9
37
  public static function getInitializer(ClassLoader $loader)
38
  {
39
  return \Closure::bind(function () use ($loader) {
40
- $loader->prefixLengthsPsr4 = ComposerStaticInit9b2474036b822a585558437604722fc9::$prefixLengthsPsr4;
41
- $loader->prefixDirsPsr4 = ComposerStaticInit9b2474036b822a585558437604722fc9::$prefixDirsPsr4;
42
- $loader->prefixesPsr0 = ComposerStaticInit9b2474036b822a585558437604722fc9::$prefixesPsr0;
43
- $loader->classMap = ComposerStaticInit9b2474036b822a585558437604722fc9::$classMap;
44
 
45
  }, null, ClassLoader::class);
46
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
37
  public static function getInitializer(ClassLoader $loader)
38
  {
39
  return \Closure::bind(function () use ($loader) {
40
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd::$prefixLengthsPsr4;
41
+ $loader->prefixDirsPsr4 = ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd::$prefixDirsPsr4;
42
+ $loader->prefixesPsr0 = ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd::$prefixesPsr0;
43
+ $loader->classMap = ComposerStaticInitbec19e61a0ae83492b90567eb2a275dd::$classMap;
44
 
45
  }, null, ClassLoader::class);
46
  }
vendor/composer/installed.json CHANGED
@@ -56,17 +56,17 @@
56
  },
57
  {
58
  "name": "skyverge/wc-plugin-framework",
59
- "version": "5.10.7",
60
- "version_normalized": "5.10.7.0",
61
  "source": {
62
  "type": "git",
63
  "url": "https://github.com/skyverge/wc-plugin-framework.git",
64
- "reference": "3a2c8cb4af31bd2c5e1af38647c249c37575db2c"
65
  },
66
  "dist": {
67
  "type": "zip",
68
- "url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/3a2c8cb4af31bd2c5e1af38647c249c37575db2c",
69
- "reference": "3a2c8cb4af31bd2c5e1af38647c249c37575db2c",
70
  "shasum": ""
71
  },
72
  "require-dev": {
@@ -76,12 +76,12 @@
76
  "lucatume/wp-browser": "3.0.5",
77
  "phpcompatibility/php-compatibility": "9.3.5"
78
  },
79
- "time": "2021-04-15T18:24:53+00:00",
80
  "type": "library",
81
  "installation-source": "dist",
82
  "description": "The official SkyVerge WooCommerce plugin framework",
83
  "support": {
84
- "source": "https://github.com/skyverge/wc-plugin-framework/tree/5.10.7",
85
  "issues": "https://github.com/skyverge/wc-plugin-framework/issues"
86
  },
87
  "install-path": "../skyverge/wc-plugin-framework"
56
  },
57
  {
58
  "name": "skyverge/wc-plugin-framework",
59
+ "version": "5.10.12",
60
+ "version_normalized": "5.10.12.0",
61
  "source": {
62
  "type": "git",
63
  "url": "https://github.com/skyverge/wc-plugin-framework.git",
64
+ "reference": "0c79b5799955c59e644caf1da222c20c982eba06"
65
  },
66
  "dist": {
67
  "type": "zip",
68
+ "url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/0c79b5799955c59e644caf1da222c20c982eba06",
69
+ "reference": "0c79b5799955c59e644caf1da222c20c982eba06",
70
  "shasum": ""
71
  },
72
  "require-dev": {
76
  "lucatume/wp-browser": "3.0.5",
77
  "phpcompatibility/php-compatibility": "9.3.5"
78
  },
79
+ "time": "2022-01-14T03:01:10+00:00",
80
  "type": "library",
81
  "installation-source": "dist",
82
  "description": "The official SkyVerge WooCommerce plugin framework",
83
  "support": {
84
+ "source": "https://github.com/skyverge/wc-plugin-framework/tree/5.10.12",
85
  "issues": "https://github.com/skyverge/wc-plugin-framework/issues"
86
  },
87
  "install-path": "../skyverge/wc-plugin-framework"
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '0139998a60a7e682cbc751d55ea24bd227063b41',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '0139998a60a7e682cbc751d55ea24bd227063b41',
20
  'dev_requirement' => false,
21
  ),
22
  'braintree/braintree_php' => array(
@@ -29,12 +29,12 @@
29
  'dev_requirement' => false,
30
  ),
31
  'skyverge/wc-plugin-framework' => array(
32
- 'pretty_version' => '5.10.7',
33
- 'version' => '5.10.7.0',
34
  'type' => 'library',
35
  'install_path' => __DIR__ . '/../skyverge/wc-plugin-framework',
36
  'aliases' => array(),
37
- 'reference' => '3a2c8cb4af31bd2c5e1af38647c249c37575db2c',
38
  'dev_requirement' => false,
39
  ),
40
  ),
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => 'd4b141956b8023e38ff9568aba61f2807eb19418',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => 'd4b141956b8023e38ff9568aba61f2807eb19418',
20
  'dev_requirement' => false,
21
  ),
22
  'braintree/braintree_php' => array(
29
  'dev_requirement' => false,
30
  ),
31
  'skyverge/wc-plugin-framework' => array(
32
+ 'pretty_version' => '5.10.12',
33
+ 'version' => '5.10.12.0',
34
  'type' => 'library',
35
  'install_path' => __DIR__ . '/../skyverge/wc-plugin-framework',
36
  'aliases' => array(),
37
+ 'reference' => '0c79b5799955c59e644caf1da222c20c982eba06',
38
  'dev_requirement' => false,
39
  ),
40
  ),
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Addresses\\Address' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Addresses;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Addresses\\Customer_Address' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Country_Helper' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php CHANGED
@@ -18,18 +18,18 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,7 +79,7 @@ abstract class Script_Handler {
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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Plugin_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Handlers\\Script_Handler' ) ) :
33
 
34
 
35
  /**
79
  */
80
  protected function get_js_handler_class_name() {
81
 
82
+ return sprintf( '%s_v5_10_12', $this->js_handler_base_class_name );
83
  }
84
 
85
 
vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php CHANGED
@@ -18,20 +18,20 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -83,7 +83,7 @@ class Lifecycle {
83
  // handle deactivation
84
  add_action( 'deactivate_' . $this->get_plugin()->get_plugin_file(), array( $this, 'handle_deactivation' ) );
85
 
86
- if ( is_admin() && ! is_ajax() ) {
87
 
88
  // initialize the plugin lifecycle
89
  add_action( 'wp_loaded', array( $this, 'init' ) );
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Plugin;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Admin\Notes_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Plugin;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Plugin;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Plugin_Compatibility;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Plugin\\Lifecycle' ) ) :
35
 
36
 
37
  /**
83
  // handle deactivation
84
  add_action( 'deactivate_' . $this->get_plugin()->get_plugin_file(), array( $this, 'handle_deactivation' ) );
85
 
86
+ if ( is_admin() && ! wp_doing_ajax() ) {
87
 
88
  // initialize the plugin lifecycle
89
  add_action( 'wp_loaded', array( $this, 'init' ) );
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php CHANGED
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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.
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Settings_API\\Abstract_Settings' ) ) :
32
 
33
  /**
34
  * The base settings handler.
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php CHANGED
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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.
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Settings_API\\Control' ) ) :
32
 
33
  /**
34
  * The base control object.
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php CHANGED
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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.
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Settings_API;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Settings_API\\Setting' ) ) :
32
 
33
  /**
34
  * The base setting object.
vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php CHANGED
@@ -17,17 +17,17 @@
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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.
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\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_12\\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
@@ -17,17 +17,17 @@
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Admin\\Setup_Wizard' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/Abstract_Cacheable_API_Base.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Plugin Framework
4
+ *
5
+ * This source file is subject to the GNU General Public License v3.0
6
+ * that is bundled with this package in the file license.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.html
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@skyverge.com so we can send you a copy immediately.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade the plugin to newer
16
+ * versions in the future. If you wish to customize the plugin for your
17
+ * needs please refer to http://www.skyverge.com
18
+ *
19
+ * @package SkyVerge/WooCommerce/API
20
+ * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\API;
26
+
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_API_Base;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\API\Traits\Cacheable_Request_Trait;
29
+
30
+ defined( 'ABSPATH' ) or exit;
31
+
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\API\\Abstract_Cacheable_API_Base' ) ) :
33
+
34
+
35
+ /**
36
+ * Abstract API base class with caching support.
37
+ *
38
+ * Plugins which need to use API request caching should use extend this API base class rather than SV_WC_API_Base.
39
+ * In addition, each request class which needs caching, should use the Cacheable_Request_Trait.
40
+ *
41
+ * @since 5.10.10
42
+ */
43
+ abstract class Abstract_Cacheable_API_Base extends SV_WC_API_Base
44
+ {
45
+
46
+
47
+ /** @var bool whether the response was loaded from cache */
48
+ protected $response_loaded_from_cache = false;
49
+
50
+
51
+ /**
52
+ * Simple wrapper for wp_remote_request() so child classes can override this
53
+ * and provide their own transport mechanism if needed, e.g. a custom
54
+ * cURL implementation
55
+ *
56
+ * @since 5.10.10
57
+ *
58
+ * @param string $request_uri
59
+ * @param string $request_args
60
+ * @return array|\WP_Error
61
+ */
62
+ protected function do_remote_request( $request_uri, $request_args ) {
63
+
64
+ if ( $this->is_request_cacheable() && ! $this->get_request()->should_refresh() && $response = $this->load_response_from_cache() ) {
65
+
66
+ $this->response_loaded_from_cache = true;
67
+
68
+ return $response;
69
+ }
70
+
71
+ return parent::do_remote_request( $request_uri, $request_args );
72
+ }
73
+
74
+
75
+ /**
76
+ * Handle and parse the response
77
+ *
78
+ * @since 5.10.10
79
+ *
80
+ * @param array|\WP_Error $response response data
81
+ * @throws SV_WC_API_Exception network issues, timeouts, API errors, etc
82
+ * @return SV_WC_API_Request|object request class instance that implements SV_WC_API_Request
83
+ */
84
+ protected function handle_response( $response ) {
85
+
86
+ parent::handle_response( $response );
87
+
88
+ // cache the response
89
+ if ( ! $this->is_response_loaded_from_cache() && $this->is_request_cacheable() ) {
90
+
91
+ $this->save_response_to_cache( $response );
92
+ }
93
+
94
+ return $this->response; // this param is set by the parent method
95
+ }
96
+
97
+
98
+ /**
99
+ * Resets the API response members to their default values.
100
+ *
101
+ * @since 5.10.10
102
+ */
103
+ protected function reset_response() {
104
+
105
+ $this->response_loaded_from_cache = false;
106
+
107
+ parent::reset_response();
108
+ }
109
+
110
+
111
+ /**
112
+ * Gets the request transient key for the current plugin and request data.
113
+ *
114
+ * Request transients can be disabled by using the filter below.
115
+ *
116
+ * @since 5.10.10
117
+ *
118
+ * @return string transient key
119
+ */
120
+ protected function get_request_transient_key() : string {
121
+
122
+ // ex: wc_<plugin_id>_<md5 hash of request uri, request data and cache lifetime>
123
+ return sprintf( 'wc_%s_api_response_%s', $this->get_plugin()->get_id(), md5( implode( '_', [
124
+ $this->get_request_uri(),
125
+ $this->get_request_body(),
126
+ $this->get_request_cache_lifetime(),
127
+ ] ) ) );
128
+ }
129
+
130
+
131
+ /**
132
+ * Checks whether the current request is cacheable.
133
+ *
134
+ * @since 5.10.10
135
+ *
136
+ * @return bool
137
+ */
138
+ protected function is_request_cacheable() : bool {
139
+
140
+ if ( ! in_array( Cacheable_Request_Trait::class, class_uses( $this->get_request() ), true ) ) {
141
+ return false;
142
+ }
143
+
144
+ /**
145
+ * Filters whether the API request is cacheable.
146
+ *
147
+ * Allows actors to disable API request caching when a request is normally cacheable. This may be useful
148
+ * primarily for debugging situations.
149
+ *
150
+ * Note: this filter is only applied if the request is originally cacheable, in order to prevent issues when
151
+ * a non-cacheable request is accidentally flagged as cacheable.
152
+ *
153
+ * @since 5.10.10
154
+ *
155
+ * @param bool $is_cacheable whether the request is cacheable
156
+ * @param SV_WC_API_Request $request the request instance
157
+ */
158
+ return (bool) apply_filters( 'wc_plugin_' . $this->get_plugin()->get_id() . '_api_request_is_cacheable', true, $this->get_request() );
159
+ }
160
+
161
+
162
+ /**
163
+ * Gets the cache lifetime for the current request.
164
+ *
165
+ * @since 5.10.10
166
+ *
167
+ * @return int
168
+ */
169
+ protected function get_request_cache_lifetime() : int {
170
+
171
+ /**
172
+ * Filters API request cache lifetime.
173
+ *
174
+ * Allows actors to override cache lifetime for cacheable API requests. This may be useful for debugging
175
+ * API requests by temporarily setting short cache timeouts.
176
+ *
177
+ * @since 5.10.10
178
+ *
179
+ * @param int $lifetime cache lifetime in seconds, 0 = unlimited
180
+ * @param SV_WC_API_Request $request the request instance
181
+ */
182
+ return (int) apply_filters( 'wc_plugin_' . $this->get_plugin()->get_id() . '_api_request_cache_lifetime' , $this->get_request()->get_cache_lifetime(), $this->get_request() );
183
+ }
184
+
185
+
186
+
187
+ /**
188
+ * Determine whether the response was loaded from cache or not.
189
+ *
190
+ * @since 5.10.10
191
+ *
192
+ * @return bool
193
+ */
194
+ protected function is_response_loaded_from_cache() : bool {
195
+
196
+ return $this->response_loaded_from_cache;
197
+ }
198
+
199
+
200
+ /**
201
+ * Loads the response for the current request from the cache, if available.
202
+ *
203
+ * @since 5.10.10
204
+ *
205
+ * @return array|null
206
+ */
207
+ protected function load_response_from_cache() {
208
+
209
+ return get_transient( $this->get_request_transient_key() );
210
+ }
211
+
212
+
213
+ /**
214
+ * Saves the response to cache.
215
+ *
216
+ * @since 5.10.10
217
+ *
218
+ * @param array $response
219
+ */
220
+ protected function save_response_to_cache( array $response ) {
221
+
222
+ set_transient( $this->get_request_transient_key(), $response, $this->get_request_cache_lifetime() );
223
+ }
224
+
225
+
226
+ /**
227
+ * Gets the response data for broadcasting the request.
228
+ *
229
+ * Adds a flag to the response data indicating whether the response was loaded from cache.
230
+ *
231
+ * @since 5.10.10
232
+ *
233
+ * @return array
234
+ */
235
+ protected function get_request_data_for_broadcast() : array {
236
+
237
+ $request_data = parent::get_request_data_for_broadcast();
238
+
239
+ if ( $this->is_request_cacheable() ) {
240
+ $request_data = [
241
+ 'force_refresh' => $this->get_request()->should_refresh(),
242
+ 'should_cache' => $this->get_request()->should_cache(),
243
+ ] + $request_data;
244
+ }
245
+
246
+ return $request_data;
247
+ }
248
+
249
+
250
+ /**
251
+ * Gets the response data for broadcasting the request.
252
+ *
253
+ * Adds a flag to the response data indicating whether the response was loaded from cache.
254
+ *
255
+ * @since 5.10.10
256
+ *
257
+ * @return array
258
+ */
259
+ protected function get_response_data_for_broadcast() : array {
260
+
261
+ $response_data = parent::get_response_data_for_broadcast();
262
+
263
+ if ( $this->is_request_cacheable() ) {
264
+ $response_data = [ 'from_cache' => $this->is_response_loaded_from_cache() ] + $response_data;
265
+ }
266
+
267
+ return $response_data;
268
+ }
269
+
270
+ }
271
+
272
+
273
+ endif;
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_JSON_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Response
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Response
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_JSON_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_XML_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Response
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Response
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_XML_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -79,7 +79,6 @@ abstract class SV_WC_API_Base {
79
  /** @var SV_WC_API_Response|object response */
80
  protected $response;
81
 
82
-
83
  /**
84
  * Perform the request and return the parsed response
85
  *
@@ -253,21 +252,8 @@ abstract class SV_WC_API_Base {
253
  */
254
  protected function broadcast_request() {
255
 
256
- $request_data = array(
257
- 'method' => $this->get_request_method(),
258
- 'uri' => $this->get_request_uri(),
259
- 'user-agent' => $this->get_request_user_agent(),
260
- 'headers' => $this->get_sanitized_request_headers(),
261
- 'body' => $this->get_sanitized_request_body(),
262
- 'duration' => $this->get_request_duration() . 's', // seconds
263
- );
264
-
265
- $response_data = array(
266
- 'code' => $this->get_response_code(),
267
- 'message' => $this->get_response_message(),
268
- 'headers' => $this->get_response_headers(),
269
- 'body' => $this->get_sanitized_response_body() ? $this->get_sanitized_response_body() : $this->get_raw_response_body(),
270
- );
271
 
272
  /**
273
  * API Base Request Performed Action.
@@ -275,6 +261,8 @@ abstract class SV_WC_API_Base {
275
  * Fired when an API request is performed via this base class. Plugins can
276
  * hook into this to log request/response data.
277
  *
 
 
278
  * @since 2.2.0
279
  * @param array $request_data {
280
  * @type string $method request method, e.g. POST
@@ -548,6 +536,28 @@ abstract class SV_WC_API_Base {
548
  }
549
 
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  /** Response Getters ******************************************************/
552
 
553
 
@@ -618,6 +628,27 @@ abstract class SV_WC_API_Base {
618
  }
619
 
620
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
621
  /** Misc Getters ******************************************************/
622
 
623
 
18
  *
19
  * @package SkyVerge/WooCommerce/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_Base' ) ) :
30
 
31
 
32
  /**
79
  /** @var SV_WC_API_Response|object response */
80
  protected $response;
81
 
 
82
  /**
83
  * Perform the request and return the parsed response
84
  *
252
  */
253
  protected function broadcast_request() {
254
 
255
+ $request_data = $this->get_request_data_for_broadcast();
256
+ $response_data = $this->get_response_data_for_broadcast();
 
 
 
 
 
 
 
 
 
 
 
 
 
257
 
258
  /**
259
  * API Base Request Performed Action.
261
  * Fired when an API request is performed via this base class. Plugins can
262
  * hook into this to log request/response data.
263
  *
264
+ * Note: request and response data arrays may contain additional, undocumented keys provided by the implementing plugin.
265
+ *
266
  * @since 2.2.0
267
  * @param array $request_data {
268
  * @type string $method request method, e.g. POST
536
  }
537
 
538
 
539
+ /**
540
+ * Gets the request data for broadcasting the request.
541
+ *
542
+ * Overriding this method allows child classes to customize the request data when broadcasting the request.
543
+ *
544
+ * @since 5.10.10
545
+ *
546
+ * @return array
547
+ */
548
+ protected function get_request_data_for_broadcast() : array {
549
+
550
+ return [
551
+ 'method' => $this->get_request_method(),
552
+ 'uri' => $this->get_request_uri(),
553
+ 'user-agent' => $this->get_request_user_agent(),
554
+ 'headers' => $this->get_sanitized_request_headers(),
555
+ 'body' => $this->get_sanitized_request_body(),
556
+ 'duration' => $this->get_request_duration() . 's', // seconds
557
+ ];
558
+ }
559
+
560
+
561
  /** Response Getters ******************************************************/
562
 
563
 
628
  }
629
 
630
 
631
+ /**
632
+ * Gets the response data for broadcasting the request.
633
+ *
634
+ * Overriding this method allows child classes to customize the response data when broadcasting the request.
635
+ *
636
+ * @since 5.10.10
637
+ *
638
+ * @return array
639
+ * @return array
640
+ */
641
+ protected function get_response_data_for_broadcast() : array
642
+ {
643
+ return [
644
+ 'code' => $this->get_response_code(),
645
+ 'message' => $this->get_response_message(),
646
+ 'headers' => $this->get_response_headers(),
647
+ 'body' => $this->get_sanitized_response_body() ?: $this->get_raw_response_body(),
648
+ ];
649
+ }
650
+
651
+
652
  /** Misc Getters ******************************************************/
653
 
654
 
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Exceptions
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Exceptions
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_Exception' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_Request' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/API/Request
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_API_Response' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/api/traits/Cacheable_Request_Trait.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Plugin Framework
4
+ *
5
+ * This source file is subject to the GNU General Public License v3.0
6
+ * that is bundled with this package in the file license.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.html
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@skyverge.com so we can send you a copy immediately.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade the plugin to newer
16
+ * versions in the future. If you wish to customize the plugin for your
17
+ * needs please refer to http://www.skyverge.com
18
+ *
19
+ * @package SkyVerge/WooCommerce/API/Response
20
+ * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\API\Traits;
26
+
27
+ defined( 'ABSPATH' ) or exit;
28
+
29
+ if ( ! trait_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\API\\Traits\\Cacheable_Request_Trait' ) ) :
30
+
31
+ /**
32
+ * This trait can be used to add response caching support to API requests.
33
+ *
34
+ * It is intended to be used by a class implementing the SV_WC_API_Request interface. Caching itself is handled
35
+ * by the Abstract_Cacheable_API_Base class, which the API handler should abstract in order to support caching.
36
+ *
37
+ * Adding `use Cacheable_Request_Trait;` to a request class will declare caching support for that request class.
38
+ * It's also possible to customize the cache lifetime by setting it in the request constructor.
39
+ */
40
+ trait Cacheable_Request_Trait {
41
+
42
+
43
+ /** @var int the cache lifetime for the request, in seconds, defaults to 86400 (24 hours) */
44
+ protected $cache_lifetime = 86400;
45
+
46
+ /** @var bool whether to force a fresh request regardless if a cached response is available */
47
+ protected $force_refresh = false;
48
+
49
+ /** @var bool whether to the current request should be cached or not */
50
+ protected $should_cache = true;
51
+
52
+
53
+ /**
54
+ * Sets the cache lifetime for this request.
55
+ *
56
+ * @since 5.10.10
57
+ *
58
+ * @param int $lifetime cache lifetime, in seconds. Set to 0 for unlimited
59
+ * @return self
60
+ */
61
+ public function set_cache_lifetime( int $lifetime ) {
62
+
63
+ $this->cache_lifetime = $lifetime;
64
+
65
+ return $this;
66
+ }
67
+
68
+
69
+ /**
70
+ * Gets the cache lifetime for this request.
71
+ *
72
+ * @since 5.10.10
73
+ *
74
+ * @return int
75
+ */
76
+ public function get_cache_lifetime() : int {
77
+
78
+ return $this->cache_lifetime;
79
+ }
80
+
81
+
82
+ /**
83
+ * Sets whether a fresh request should be attempted, regardless if a cached response is available.
84
+ *
85
+ * @since 5.10.10
86
+ *
87
+ * @param bool $value whether to force a fresh request, or not
88
+ * @return self
89
+ */
90
+ public function set_force_refresh( bool $value ) {
91
+
92
+ $this->force_refresh = $value;
93
+
94
+ return $this;
95
+ }
96
+
97
+
98
+ /**
99
+ * Determines whether a fresh request should be attempted.
100
+ *
101
+ * @since 5.10.10
102
+ *
103
+ * @return bool
104
+ */
105
+ public function should_refresh() : bool {
106
+
107
+ return $this->force_refresh;
108
+ }
109
+
110
+
111
+ /**
112
+ * Sets whether the request's response should be stored in cache.
113
+ *
114
+ * @since 5.10.10
115
+ *
116
+ * @param bool $value whether to cache the request, or not
117
+ * @return self
118
+ */
119
+ public function set_should_cache( bool $value ) {
120
+
121
+ $this->should_cache = $value;
122
+
123
+ return $this;
124
+ }
125
+
126
+
127
+ /**
128
+ * Determines whether the request's response should be stored in cache.
129
+ *
130
+ * @since 5.10.10
131
+ *
132
+ * @return bool
133
+ */
134
+ public function should_cache() : bool {
135
+
136
+ return $this->should_cache;
137
+ }
138
+
139
+
140
+ /**
141
+ * Bypasses caching for this request completely.
142
+ *
143
+ * When called, sets the `force_refresh` flag to true and `should_cache` flag to false
144
+ *
145
+ * @since 5.10.10
146
+ *
147
+ * @return self
148
+ */
149
+ public function bypass_cache() {
150
+
151
+ $this->set_force_refresh( true );
152
+ $this->set_should_cache( false );
153
+
154
+ return $this;
155
+ }
156
+
157
+ }
158
+
159
+
160
+ endif;
vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt CHANGED
@@ -1,5 +1,22 @@
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
 
1
  *** SkyVerge WooCommerce Plugin Framework Changelog ***
2
 
3
+ 2022.01.13 - version 5.10.12
4
+ * Fix - Remove deprecated usages of `is_ajax()` in favor of `wp_doing_ajax()`
5
+
6
+ 2022.01.11 - version 5.10.11
7
+ * Tweak - Remove automatic notices for unsupported WooCommerce versions
8
+
9
+ 2021.09.22 - version 5.10.10
10
+ * Feature - Add `Abstract_Cacheable_API_Base` and `Cacheable_Request_Trait` to support caching API request responses
11
+ * Tweak - Allow classes extending `SV_WC_API_Base` to tweak request and response data when broadcasting a request
12
+
13
+ 2021.08.27 - version 5.10.9
14
+ * Feature - Add helper methods to convert arrays to comma separated lists for database IN clauses use
15
+ * Feature - Add helper method to format a percentage
16
+
17
+ 2021.06.17 - version 5.10.8
18
+ * Fix - Address an issue at checkout with payment form JS never loaded when a $0 order has a total updated later
19
+
20
  2021.04.15 - version 5.10.7
21
  * Fix - Prevent fatal errors by loading External_Checkout extensions in the wp_loaded action rather than on init
22
 
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Admin_Notice_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-framework-bootstrap.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -234,6 +234,24 @@ class SV_WC_Helper {
234
  }
235
 
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  /**
238
  * Helper method to check if the multibyte extension is loaded, which
239
  * indicates it's safe to use the mb_*() string methods
@@ -1071,7 +1089,7 @@ class SV_WC_Helper {
1071
  */
1072
  public static function trigger_error( $message, $type = E_USER_NOTICE ) {
1073
 
1074
- if ( is_callable( 'is_ajax' ) && is_ajax() ) {
1075
 
1076
  switch ( $type ) {
1077
 
@@ -1096,6 +1114,39 @@ class SV_WC_Helper {
1096
  }
1097
 
1098
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1099
  }
1100
 
1101
 
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Helper' ) ) :
30
 
31
 
32
  /**
234
  }
235
 
236
 
237
+ /**
238
+ * Formats a number as a percentage.
239
+ *
240
+ * @since 5.10.9
241
+ *
242
+ * @NOTE The second and third parameter below are directly passed to {@see wc_format_decimal()} in case the decimal output or rounding needs to be tweaked.
243
+ *
244
+ * @param float|int|string $fraction the fraction to format as percentage
245
+ * @param int|string|false number of decimal points to use, empty string to use {@see woocommerce_price_num_decimals(), or false to avoid rounding (optional, default).
246
+ * @param bool $trim_zeros from end of string (optional, default false)
247
+ * @return string fraction formatted as percentage
248
+ */
249
+ public static function format_percentage( $fraction, $decimal_points = false, $trim_zeros = false ) {
250
+
251
+ return sprintf( '%s%%', (string) wc_format_decimal( $fraction * 100, $decimal_points, $trim_zeros ) );
252
+ }
253
+
254
+
255
  /**
256
  * Helper method to check if the multibyte extension is loaded, which
257
  * indicates it's safe to use the mb_*() string methods
1089
  */
1090
  public static function trigger_error( $message, $type = E_USER_NOTICE ) {
1091
 
1092
+ if ( is_callable( 'wp_doing_ajax' ) && wp_doing_ajax() ) {
1093
 
1094
  switch ( $type ) {
1095
 
1114
  }
1115
 
1116
 
1117
+ /**
1118
+ * Converts an array of strings to a comma separated list of strings, escaped for SQL use.
1119
+ *
1120
+ * This can be safely used in SQL IN clauses.
1121
+ *
1122
+ * @since 5.10.9
1123
+ *
1124
+ * @param string[] $values
1125
+ * @return string
1126
+ */
1127
+ public static function get_escaped_string_list( array $values ) {
1128
+ global $wpdb;
1129
+
1130
+ return (string) $wpdb->prepare( implode( ', ', array_fill( 0, count( $values ), '%s' ) ), $values );
1131
+ }
1132
+
1133
+
1134
+ /**
1135
+ * Converts an array of numerical integers into a comma separated list of IDs.
1136
+ *
1137
+ * This can be safely used for SQL IN clauses.
1138
+ *
1139
+ * @since 5.10.9
1140
+ *
1141
+ * @param int[] $ids
1142
+ * @return string
1143
+ */
1144
+ public static function get_escaped_id_list( array $ids ) {
1145
+
1146
+ return implode( ',', array_unique( array_map( 'intval', $ids ) ) );
1147
+ }
1148
+
1149
+
1150
  }
1151
 
1152
 
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Hook_Deprecator' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Plugin_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Plugin_Dependencies' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Exceptions
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Exceptions
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Plugin_Exception' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,7 +43,7 @@ abstract class SV_WC_Plugin {
43
 
44
 
45
  /** Plugin Framework Version */
46
- const VERSION = '5.10.7';
47
 
48
  /** @var object single instance of plugin */
49
  protected static $instance;
@@ -75,9 +75,6 @@ abstract class SV_WC_Plugin {
75
  /** @var array memoized list of active plugins */
76
  private $active_plugins = [];
77
 
78
- /** @var int|float minimum supported WooCommerce versions before the latest (units for major releases, decimals for minor) */
79
- private $min_wc_semver;
80
-
81
  /** @var SV_WC_Plugin_Dependencies dependency handler instance */
82
  private $dependency_handler;
83
 
@@ -127,13 +124,11 @@ abstract class SV_WC_Plugin {
127
  $this->version = $version;
128
 
129
  $args = wp_parse_args( $args, [
130
- 'min_wc_semver' => 0.2, // by default, 2 minor versions behind the latest published are supported
131
  'text_domain' => '',
132
  'dependencies' => [],
133
  ] );
134
 
135
- $this->min_wc_semver = is_numeric( $args['min_wc_semver'] ) ? abs( $args['min_wc_semver'] ) : null;
136
- $this->text_domain = $args['text_domain'];
137
 
138
  // includes that are required to be available at all times
139
  $this->includes();
@@ -451,6 +446,10 @@ abstract class SV_WC_Plugin {
451
  require_once( $framework_path . '/api/abstract-sv-wc-api-json-request.php' );
452
  require_once( $framework_path . '/api/abstract-sv-wc-api-json-response.php' );
453
 
 
 
 
 
454
  // REST API Controllers
455
  require_once( $framework_path . '/rest-api/Controllers/Settings.php' );
456
 
@@ -546,81 +545,12 @@ abstract class SV_WC_Plugin {
546
  /**
547
  * Adds admin notices upon initialization.
548
  *
549
- * This may also produce notices if running an unsupported version of WooCommerce.
550
  *
551
  * @since 3.0.0
552
  */
553
  public function add_admin_notices() {
554
-
555
- // bail if there's no defined versions to compare
556
- if ( empty( $this->min_wc_semver ) || ! is_numeric( $this->min_wc_semver ) ) {
557
- return;
558
- }
559
-
560
- $latest_wc_versions = SV_WC_Plugin_Compatibility::get_latest_wc_versions();
561
- $current_wc_version = SV_WC_Plugin_Compatibility::get_wc_version();
562
-
563
- // bail if the latest WooCommerce version or the current WooCommerce versions can't be determined
564
- if ( empty( $latest_wc_versions ) || empty( $current_wc_version ) ) {
565
- return;
566
- }
567
-
568
- // grab latest published version
569
- $supported_wc_version = $latest_wc_version = current( $latest_wc_versions );
570
-
571
- // grab semver parts
572
- $latest_semver = explode( '.', $latest_wc_version );
573
- $supported_semver = explode( '.', (string) $this->min_wc_semver );
574
- $supported_major = max( 0, (int) $latest_semver[0] - (int) $supported_semver[0] );
575
- $supported_minor = isset( $supported_semver[1] ) ? (int) $supported_semver[1] : 0;
576
- $previous_minor = null;
577
-
578
- // loop known WooCommerce versions from the most recent until we get the oldest supported one
579
- foreach ( $latest_wc_versions as $older_wc_version ) {
580
-
581
- // as we loop through versions, the latest one before we break the loop will be the minimum supported one
582
- $supported_wc_version = $older_wc_version;
583
-
584
- $older_semver = explode( '.', $older_wc_version );
585
- $older_major = (int) $older_semver[0];
586
- $older_minor = isset( $older_semver[1] ) ? (int) $older_semver[1] : 0;
587
-
588
- // if major is ignored, skip; if the minor hasn't changed (patch must be), skip
589
- if ( $older_major > $supported_major || $older_minor === $previous_minor ) {
590
- continue;
591
- }
592
-
593
- // we reached the maximum number of supported minor versions
594
- if ( $supported_minor <= 0 ) {
595
- break;
596
- }
597
-
598
- // store the previous minor while we loop patch versions, which we ignore
599
- $previous_minor = $older_minor;
600
-
601
- $supported_minor--;
602
- }
603
-
604
- // for strict comparison, we strip the patch version from the determined versions and compare only major, minor versions, ignoring patches (i.e. 1.2.3 becomes 1.2)
605
- $current_wc_version = substr( $current_wc_version, 0, strpos( $current_wc_version, '.', strpos( $current_wc_version, '.' ) + 1 ) );
606
- $supported_wc_version = substr( $supported_wc_version, 0, strpos( $supported_wc_version, '.', strpos( $supported_wc_version, '.' ) + 1 ) );
607
- $compared_wc_version = $current_wc_version && $supported_wc_version ? version_compare( $current_wc_version, $supported_wc_version ) : null;
608
-
609
- // installed version is at more than 2 minor versions ($min_wc_semver value) behind the last published version
610
- if ( -1 === $compared_wc_version ) {
611
-
612
- $this->get_admin_notice_handler()->add_admin_notice(
613
- sprintf(
614
- /* translators: Placeholders: %1$s - plugin name, %2$s - WooCommerce version number, %3$s - opening <a> HTML link tag, %4$s - closing </a> HTML link tag */
615
- __( 'Heads up! %1$s will soon discontinue support for WooCommerce %2$s. Please %3$supdate WooCommerce%4$s to take advantage of the latest updates and features.', 'woocommerce-plugin-framework' ),
616
- $this->get_plugin_name(),
617
- $current_wc_version,
618
- '<a href="' . esc_url( admin_url( 'update-core.php' ) ) .'">', '</a>'
619
- ),
620
- $this->get_id_dasherized() . '-deprecated-wc-version-as-of-' . str_replace( '.', '-', $supported_wc_version ),
621
- [ 'notice_class' => 'notice-info' ]
622
- );
623
- }
624
  }
625
 
626
 
@@ -722,7 +652,14 @@ abstract class SV_WC_Plugin {
722
  $messages[] = isset( $data['uri'] ) && $data['uri'] ? 'Request' : 'Response';
723
 
724
  foreach ( (array) $data as $key => $value ) {
725
- $messages[] = trim( sprintf( '%s: %s', $key, is_array( $value ) || ( is_object( $value ) && 'stdClass' == get_class( $value ) ) ? print_r( (array) $value, true ) : $value ) );
 
 
 
 
 
 
 
726
  }
727
 
728
  return implode( "\n", $messages ) . "\n";
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Plugin' ) ) :
30
 
31
 
32
  /**
43
 
44
 
45
  /** Plugin Framework Version */
46
+ const VERSION = '5.10.12';
47
 
48
  /** @var object single instance of plugin */
49
  protected static $instance;
75
  /** @var array memoized list of active plugins */
76
  private $active_plugins = [];
77
 
 
 
 
78
  /** @var SV_WC_Plugin_Dependencies dependency handler instance */
79
  private $dependency_handler;
80
 
124
  $this->version = $version;
125
 
126
  $args = wp_parse_args( $args, [
 
127
  'text_domain' => '',
128
  'dependencies' => [],
129
  ] );
130
 
131
+ $this->text_domain = $args['text_domain'];
 
132
 
133
  // includes that are required to be available at all times
134
  $this->includes();
446
  require_once( $framework_path . '/api/abstract-sv-wc-api-json-request.php' );
447
  require_once( $framework_path . '/api/abstract-sv-wc-api-json-response.php' );
448
 
449
+ // Cacheable API
450
+ require_once( $framework_path . '/api/traits/Cacheable_Request_Trait.php' );
451
+ require_once( $framework_path . '/api/Abstract_Cacheable_API_Base.php' );
452
+
453
  // REST API Controllers
454
  require_once( $framework_path . '/rest-api/Controllers/Settings.php' );
455
 
545
  /**
546
  * Adds admin notices upon initialization.
547
  *
548
+ * @internal
549
  *
550
  * @since 3.0.0
551
  */
552
  public function add_admin_notices() {
553
+ // stub method
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  }
555
 
556
 
652
  $messages[] = isset( $data['uri'] ) && $data['uri'] ? 'Request' : 'Response';
653
 
654
  foreach ( (array) $data as $key => $value ) {
655
+
656
+ if ( is_array( $value ) || ( is_object( $value ) && 'stdClass' === get_class( $value ) ) ) {
657
+ $value = print_r( (array) $value, true );
658
+ } elseif ( is_bool( $value ) ) {
659
+ $value = wc_bool_to_string( $value );
660
+ }
661
+
662
+ $messages[] = trim( sprintf( '%s: %s', $key, $value ) );
663
  }
664
 
665
  return implode( "\n", $messages ) . "\n";
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WordPress/WP-Admin-Message-Handler
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WordPress/WP-Admin-Message-Handler
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WP_Admin_Message_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Data_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php CHANGED
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  use DateTimeZone;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_DateTime' ) ) :
32
 
33
 
34
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Order_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Compatibility
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Product_Compatibility' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po CHANGED
@@ -6,7 +6,7 @@ msgid ""
6
  msgstr ""
7
  "Project-Id-Version: WC Plugin Framework\n"
8
  "Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
9
- "POT-Creation-Date: 2015-07-22 12:09:16+00:00\n"
10
  "PO-Revision-Date: 2017-03-27 11:59-0700\n"
11
  "Last-Translator: Illimar Tambek <illimar.tambek@gmail.com>\n"
12
  "Language-Team: Estonian (http://www.transifex.com/projects/p/wc-plugin-"
@@ -245,38 +245,29 @@ msgid ""
245
  msgstr ""
246
 
247
  #. translators: Placeholders: %s - plugin name
248
- #: class-sv-wc-plugin.php:306
249
  msgid "You cannot clone instances of %s."
250
  msgstr "%s eksemplari ei saa kloonida."
251
 
252
  #. translators: Placeholders: %s - plugin name
253
- #: class-sv-wc-plugin.php:317
254
  msgid "You cannot unserialize instances of %s."
255
  msgstr "%s eksemplari ei saa deserialiseerida (unserialize)."
256
 
257
- #. translators: Placeholders: %1$s - plugin name, %2$s - WooCommerce version
258
- #. number, %3$s - opening <a> HTML link tag, %4$s - closing </a> HTML link tag
259
- #: class-sv-wc-plugin.php:615
260
- msgid ""
261
- "Heads up! %1$s will soon discontinue support for WooCommerce %2$s. Please "
262
- "%3$supdate WooCommerce%4$s to take advantage of the latest updates and "
263
- "features."
264
- msgstr ""
265
-
266
  #. translators: Docs as in Documentation
267
- #: class-sv-wc-plugin.php:658
268
  msgid "Docs"
269
  msgstr "Dokumentatsioon"
270
 
271
- #: class-sv-wc-plugin.php:751
272
  msgid "%1$s - A minimum of %2$s is required."
273
  msgstr ""
274
 
275
- #: class-sv-wc-plugin.php:760
276
  msgid "Set as %1$s - %2$s is required."
277
  msgstr ""
278
 
279
- #: class-sv-wc-plugin.php:1040
280
  #: payment-gateway/class-sv-wc-payment-gateway-plugin.php:876
281
  msgid "Configure"
282
  msgstr "Seadista"
@@ -729,13 +720,13 @@ msgid "Last Four"
729
  msgstr "Viimased 4 numbrit"
730
 
731
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:574
732
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:358
733
  msgid "Expiration (MM/YY)"
734
  msgstr "Aegub (KK/AA)"
735
 
736
  #. translators: e-check account type, HTML form field label
737
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:595
738
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:466
739
  #: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
740
  msgid "Account Type"
741
  msgstr "Konto tüüp"
@@ -1134,7 +1125,7 @@ msgstr "%1$s %2$s: %3$s kinnitatud: %4$s lõpeb numbritega %5$s (aegub %6$s)"
1134
 
1135
  #. translators: Placeholders: %s - expiry date
1136
  #: payment-gateway/class-sv-wc-payment-gateway-direct.php:760
1137
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:714
1138
  #: payment-gateway/class-sv-wc-payment-gateway.php:2698
1139
  msgid "(expires %s)"
1140
  msgstr "(aegub %s)"
@@ -1300,67 +1291,67 @@ msgstr "Oih, sul läks liiga kaua aega - palun proovi uuesti."
1300
  msgid "There was an error with your request, please try again."
1301
  msgstr "Sinu päringuga esines viga, palun proovi uuesti."
1302
 
1303
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:340
1304
  msgid "Card Number"
1305
  msgstr "Kaardi number"
1306
 
1307
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:361
1308
  msgid "MM / YY"
1309
  msgstr "KK / AA"
1310
 
1311
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:380
1312
  msgid "Card Security Code"
1313
  msgstr "Kaardi turvakood"
1314
 
1315
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:383
1316
  msgid "CSC"
1317
  msgstr "Turvakood"
1318
 
1319
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:423
1320
  msgid "Where do I find this?"
1321
  msgstr "Kust ma selle leian?"
1322
 
1323
  #. translators: e-check routing number, HTML form field label,
1324
  #. https:en.wikipedia.org/wiki/Routing_transit_number
1325
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:429
1326
  msgid "Routing Number"
1327
  msgstr "Suunakood"
1328
 
1329
  #. translators: e-check account number, HTML form field label
1330
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:448
1331
  msgid "Account Number"
1332
  msgstr "Kontonumber"
1333
 
1334
  #. translators: Test mode refers to the current software environment
1335
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:514
1336
  msgid "TEST MODE ENABLED"
1337
  msgstr "TESTREŽIIM SISSE LÜLITATUD"
1338
 
1339
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:541
1340
  #, fuzzy
1341
  msgid "Sample Check"
1342
  msgstr "E-tšekk"
1343
 
1344
  #. translators: Payment method as in a specific credit card, eCheck or bank
1345
  #. account
1346
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:616
1347
  msgid "Manage Payment Methods"
1348
  msgstr "Halda maksevahendeid"
1349
 
1350
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:753
1351
  msgid "Use a new card"
1352
  msgstr "Kasuta uut kaarti"
1353
 
1354
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:753
1355
  msgid "Use a new bank account"
1356
  msgstr "Kasuta uut pangakontot"
1357
 
1358
  #. translators: account as in customer's account on the eCommerce site
1359
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:816
1360
  msgid "Securely Save to Account"
1361
  msgstr "Salvesta turvaliselt oma kontole"
1362
 
1363
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:950
1364
  #, fuzzy
1365
  msgid "Payment Info"
1366
  msgstr "Maksevahendid"
@@ -2021,17 +2012,17 @@ msgctxt "enhanced select"
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 ""
2028
 
2029
- #: class-sv-wc-plugin.php:663
2030
  msgctxt "noun"
2031
  msgid "Support"
2032
  msgstr "Kasutajatugi"
2033
 
2034
- #: class-sv-wc-plugin.php:668
2035
  msgctxt "verb"
2036
  msgid "Review"
2037
  msgstr ""
@@ -2117,13 +2108,13 @@ msgid "Diners"
2117
  msgstr "Diners"
2118
 
2119
  #. translators: http:www.investopedia.com/terms/c/checkingaccount.asp
2120
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:474
2121
  msgctxt "account type"
2122
  msgid "Checking"
2123
  msgstr "Tšekikonto"
2124
 
2125
  #. translators: http:www.investopedia.com/terms/s/savingsaccount.asp
2126
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:476
2127
  msgctxt "account type"
2128
  msgid "Savings"
2129
  msgstr "Hoiuarve"
6
  msgstr ""
7
  "Project-Id-Version: WC Plugin Framework\n"
8
  "Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
9
+ "POT-Creation-Date: 2022-01-11 05:09:55+00:00\n"
10
  "PO-Revision-Date: 2017-03-27 11:59-0700\n"
11
  "Last-Translator: Illimar Tambek <illimar.tambek@gmail.com>\n"
12
  "Language-Team: Estonian (http://www.transifex.com/projects/p/wc-plugin-"
245
  msgstr ""
246
 
247
  #. translators: Placeholders: %s - plugin name
248
+ #: class-sv-wc-plugin.php:301
249
  msgid "You cannot clone instances of %s."
250
  msgstr "%s eksemplari ei saa kloonida."
251
 
252
  #. translators: Placeholders: %s - plugin name
253
+ #: class-sv-wc-plugin.php:312
254
  msgid "You cannot unserialize instances of %s."
255
  msgstr "%s eksemplari ei saa deserialiseerida (unserialize)."
256
 
 
 
 
 
 
 
 
 
 
257
  #. translators: Docs as in Documentation
258
+ #: class-sv-wc-plugin.php:588
259
  msgid "Docs"
260
  msgstr "Dokumentatsioon"
261
 
262
+ #: class-sv-wc-plugin.php:688
263
  msgid "%1$s - A minimum of %2$s is required."
264
  msgstr ""
265
 
266
+ #: class-sv-wc-plugin.php:697
267
  msgid "Set as %1$s - %2$s is required."
268
  msgstr ""
269
 
270
+ #: class-sv-wc-plugin.php:977
271
  #: payment-gateway/class-sv-wc-payment-gateway-plugin.php:876
272
  msgid "Configure"
273
  msgstr "Seadista"
720
  msgstr "Viimased 4 numbrit"
721
 
722
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:574
723
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:362
724
  msgid "Expiration (MM/YY)"
725
  msgstr "Aegub (KK/AA)"
726
 
727
  #. translators: e-check account type, HTML form field label
728
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:595
729
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:470
730
  #: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
731
  msgid "Account Type"
732
  msgstr "Konto tüüp"
1125
 
1126
  #. translators: Placeholders: %s - expiry date
1127
  #: payment-gateway/class-sv-wc-payment-gateway-direct.php:760
1128
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:718
1129
  #: payment-gateway/class-sv-wc-payment-gateway.php:2698
1130
  msgid "(expires %s)"
1131
  msgstr "(aegub %s)"
1291
  msgid "There was an error with your request, please try again."
1292
  msgstr "Sinu päringuga esines viga, palun proovi uuesti."
1293
 
1294
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:344
1295
  msgid "Card Number"
1296
  msgstr "Kaardi number"
1297
 
1298
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:365
1299
  msgid "MM / YY"
1300
  msgstr "KK / AA"
1301
 
1302
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:384
1303
  msgid "Card Security Code"
1304
  msgstr "Kaardi turvakood"
1305
 
1306
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:387
1307
  msgid "CSC"
1308
  msgstr "Turvakood"
1309
 
1310
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:427
1311
  msgid "Where do I find this?"
1312
  msgstr "Kust ma selle leian?"
1313
 
1314
  #. translators: e-check routing number, HTML form field label,
1315
  #. https:en.wikipedia.org/wiki/Routing_transit_number
1316
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:433
1317
  msgid "Routing Number"
1318
  msgstr "Suunakood"
1319
 
1320
  #. translators: e-check account number, HTML form field label
1321
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:452
1322
  msgid "Account Number"
1323
  msgstr "Kontonumber"
1324
 
1325
  #. translators: Test mode refers to the current software environment
1326
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:518
1327
  msgid "TEST MODE ENABLED"
1328
  msgstr "TESTREŽIIM SISSE LÜLITATUD"
1329
 
1330
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:545
1331
  #, fuzzy
1332
  msgid "Sample Check"
1333
  msgstr "E-tšekk"
1334
 
1335
  #. translators: Payment method as in a specific credit card, eCheck or bank
1336
  #. account
1337
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:620
1338
  msgid "Manage Payment Methods"
1339
  msgstr "Halda maksevahendeid"
1340
 
1341
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:757
1342
  msgid "Use a new card"
1343
  msgstr "Kasuta uut kaarti"
1344
 
1345
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:757
1346
  msgid "Use a new bank account"
1347
  msgstr "Kasuta uut pangakontot"
1348
 
1349
  #. translators: account as in customer's account on the eCommerce site
1350
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:820
1351
  msgid "Securely Save to Account"
1352
  msgstr "Salvesta turvaliselt oma kontole"
1353
 
1354
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:954
1355
  #, fuzzy
1356
  msgid "Payment Info"
1357
  msgstr "Maksevahendid"
2012
  msgid "Searching&hellip;"
2013
  msgstr ""
2014
 
2015
+ #: class-sv-wc-helper.php:426
2016
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
2017
  msgid "and"
2018
  msgstr ""
2019
 
2020
+ #: class-sv-wc-plugin.php:593
2021
  msgctxt "noun"
2022
  msgid "Support"
2023
  msgstr "Kasutajatugi"
2024
 
2025
+ #: class-sv-wc-plugin.php:598
2026
  msgctxt "verb"
2027
  msgid "Review"
2028
  msgstr ""
2108
  msgstr "Diners"
2109
 
2110
  #. translators: http:www.investopedia.com/terms/c/checkingaccount.asp
2111
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:478
2112
  msgctxt "account type"
2113
  msgid "Checking"
2114
  msgstr "Tšekikonto"
2115
 
2116
  #. translators: http:www.investopedia.com/terms/s/savingsaccount.asp
2117
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:480
2118
  msgctxt "account type"
2119
  msgid "Savings"
2120
  msgstr "Hoiuarve"
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2021
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"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
@@ -234,39 +234,30 @@ msgid ""
234
  "resources to help you upgrade%5$s and to explain PHP versions further."
235
  msgstr ""
236
 
237
- #: class-sv-wc-plugin.php:306
238
  #. translators: Placeholders: %s - plugin name
239
  msgid "You cannot clone instances of %s."
240
  msgstr ""
241
 
242
- #: class-sv-wc-plugin.php:317
243
  #. translators: Placeholders: %s - plugin name
244
  msgid "You cannot unserialize instances of %s."
245
  msgstr ""
246
 
247
- #: class-sv-wc-plugin.php:615
248
- #. translators: Placeholders: %1$s - plugin name, %2$s - WooCommerce version
249
- #. number, %3$s - opening <a> HTML link tag, %4$s - closing </a> HTML link tag
250
- msgid ""
251
- "Heads up! %1$s will soon discontinue support for WooCommerce %2$s. Please "
252
- "%3$supdate WooCommerce%4$s to take advantage of the latest updates and "
253
- "features."
254
- msgstr ""
255
-
256
- #: class-sv-wc-plugin.php:658
257
  #. translators: Docs as in Documentation
258
  msgid "Docs"
259
  msgstr ""
260
 
261
- #: class-sv-wc-plugin.php:751
262
  msgid "%1$s - A minimum of %2$s is required."
263
  msgstr ""
264
 
265
- #: class-sv-wc-plugin.php:760
266
  msgid "Set as %1$s - %2$s is required."
267
  msgstr ""
268
 
269
- #: class-sv-wc-plugin.php:1040
270
  #: payment-gateway/class-sv-wc-payment-gateway-plugin.php:876
271
  msgid "Configure"
272
  msgstr ""
@@ -698,12 +689,12 @@ msgid "Last Four"
698
  msgstr ""
699
 
700
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:574
701
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:358
702
  msgid "Expiration (MM/YY)"
703
  msgstr ""
704
 
705
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:595
706
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:466
707
  #: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
708
  #. translators: e-check account type, HTML form field label
709
  msgid "Account Type"
@@ -1066,7 +1057,7 @@ msgid "%1$s %2$s %3$s Approved: %4$s ending in %5$s"
1066
  msgstr ""
1067
 
1068
  #: payment-gateway/class-sv-wc-payment-gateway-direct.php:760
1069
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:714
1070
  #: payment-gateway/class-sv-wc-payment-gateway.php:2698
1071
  #. translators: Placeholders: %s - expiry date
1072
  msgid "(expires %s)"
@@ -1224,66 +1215,66 @@ msgstr ""
1224
  msgid "There was an error with your request, please try again."
1225
  msgstr ""
1226
 
1227
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:340
1228
  msgid "Card Number"
1229
  msgstr ""
1230
 
1231
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:361
1232
  msgid "MM / YY"
1233
  msgstr ""
1234
 
1235
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:380
1236
  msgid "Card Security Code"
1237
  msgstr ""
1238
 
1239
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:383
1240
  msgid "CSC"
1241
  msgstr ""
1242
 
1243
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:423
1244
  msgid "Where do I find this?"
1245
  msgstr ""
1246
 
1247
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:429
1248
  #. translators: e-check routing number, HTML form field label,
1249
  #. https:en.wikipedia.org/wiki/Routing_transit_number
1250
  msgid "Routing Number"
1251
  msgstr ""
1252
 
1253
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:448
1254
  #. translators: e-check account number, HTML form field label
1255
  msgid "Account Number"
1256
  msgstr ""
1257
 
1258
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:514
1259
  #. translators: Test mode refers to the current software environment
1260
  msgid "TEST MODE ENABLED"
1261
  msgstr ""
1262
 
1263
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:541
1264
  msgid "Sample Check"
1265
  msgstr ""
1266
 
1267
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:616
1268
  #. translators: Payment method as in a specific credit card, eCheck or bank
1269
  #. account
1270
  msgid "Manage Payment Methods"
1271
  msgstr ""
1272
 
1273
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:753
1274
  msgid "Use a new card"
1275
  msgstr ""
1276
 
1277
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:753
1278
  msgid "Use a new bank account"
1279
  msgstr ""
1280
 
1281
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:816
1282
  #. translators: account as in customer's account on the eCommerce site
1283
  msgid "Securely Save to Account"
1284
  msgstr ""
1285
 
1286
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:950
1287
  msgid "Payment Info"
1288
  msgstr ""
1289
 
@@ -1912,17 +1903,17 @@ msgctxt "enhanced select"
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 ""
1919
 
1920
- #: class-sv-wc-plugin.php:663
1921
  msgctxt "noun"
1922
  msgid "Support"
1923
  msgstr ""
1924
 
1925
- #: class-sv-wc-plugin.php:668
1926
  msgctxt "verb"
1927
  msgid "Review"
1928
  msgstr ""
@@ -2007,13 +1998,13 @@ msgctxt "credit card type"
2007
  msgid "Diners"
2008
  msgstr ""
2009
 
2010
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:474
2011
  #. translators: http:www.investopedia.com/terms/c/checkingaccount.asp
2012
  msgctxt "account type"
2013
  msgid "Checking"
2014
  msgstr ""
2015
 
2016
- #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:476
2017
  #. translators: http:www.investopedia.com/terms/s/savingsaccount.asp
2018
  msgctxt "account type"
2019
  msgid "Savings"
1
+ # Copyright (C) 2022
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.12\n"
6
  "Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
7
+ "POT-Creation-Date: 2022-01-11 05:09:55+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
234
  "resources to help you upgrade%5$s and to explain PHP versions further."
235
  msgstr ""
236
 
237
+ #: class-sv-wc-plugin.php:301
238
  #. translators: Placeholders: %s - plugin name
239
  msgid "You cannot clone instances of %s."
240
  msgstr ""
241
 
242
+ #: class-sv-wc-plugin.php:312
243
  #. translators: Placeholders: %s - plugin name
244
  msgid "You cannot unserialize instances of %s."
245
  msgstr ""
246
 
247
+ #: class-sv-wc-plugin.php:588
 
 
 
 
 
 
 
 
 
248
  #. translators: Docs as in Documentation
249
  msgid "Docs"
250
  msgstr ""
251
 
252
+ #: class-sv-wc-plugin.php:688
253
  msgid "%1$s - A minimum of %2$s is required."
254
  msgstr ""
255
 
256
+ #: class-sv-wc-plugin.php:697
257
  msgid "Set as %1$s - %2$s is required."
258
  msgstr ""
259
 
260
+ #: class-sv-wc-plugin.php:977
261
  #: payment-gateway/class-sv-wc-payment-gateway-plugin.php:876
262
  msgid "Configure"
263
  msgstr ""
689
  msgstr ""
690
 
691
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:574
692
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:362
693
  msgid "Expiration (MM/YY)"
694
  msgstr ""
695
 
696
  #: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:595
697
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:470
698
  #: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
699
  #. translators: e-check account type, HTML form field label
700
  msgid "Account Type"
1057
  msgstr ""
1058
 
1059
  #: payment-gateway/class-sv-wc-payment-gateway-direct.php:760
1060
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:718
1061
  #: payment-gateway/class-sv-wc-payment-gateway.php:2698
1062
  #. translators: Placeholders: %s - expiry date
1063
  msgid "(expires %s)"
1215
  msgid "There was an error with your request, please try again."
1216
  msgstr ""
1217
 
1218
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:344
1219
  msgid "Card Number"
1220
  msgstr ""
1221
 
1222
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:365
1223
  msgid "MM / YY"
1224
  msgstr ""
1225
 
1226
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:384
1227
  msgid "Card Security Code"
1228
  msgstr ""
1229
 
1230
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:387
1231
  msgid "CSC"
1232
  msgstr ""
1233
 
1234
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:427
1235
  msgid "Where do I find this?"
1236
  msgstr ""
1237
 
1238
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:433
1239
  #. translators: e-check routing number, HTML form field label,
1240
  #. https:en.wikipedia.org/wiki/Routing_transit_number
1241
  msgid "Routing Number"
1242
  msgstr ""
1243
 
1244
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:452
1245
  #. translators: e-check account number, HTML form field label
1246
  msgid "Account Number"
1247
  msgstr ""
1248
 
1249
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:518
1250
  #. translators: Test mode refers to the current software environment
1251
  msgid "TEST MODE ENABLED"
1252
  msgstr ""
1253
 
1254
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:545
1255
  msgid "Sample Check"
1256
  msgstr ""
1257
 
1258
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:620
1259
  #. translators: Payment method as in a specific credit card, eCheck or bank
1260
  #. account
1261
  msgid "Manage Payment Methods"
1262
  msgstr ""
1263
 
1264
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:757
1265
  msgid "Use a new card"
1266
  msgstr ""
1267
 
1268
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:757
1269
  msgid "Use a new bank account"
1270
  msgstr ""
1271
 
1272
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:820
1273
  #. translators: account as in customer's account on the eCommerce site
1274
  msgid "Securely Save to Account"
1275
  msgstr ""
1276
 
1277
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:954
1278
  msgid "Payment Info"
1279
  msgstr ""
1280
 
1903
  msgid "Searching&hellip;"
1904
  msgstr ""
1905
 
1906
+ #: class-sv-wc-helper.php:426
1907
  msgctxt "coordinating conjunction for a list of items: a, b, and c"
1908
  msgid "and"
1909
  msgstr ""
1910
 
1911
+ #: class-sv-wc-plugin.php:593
1912
  msgctxt "noun"
1913
  msgid "Support"
1914
  msgstr ""
1915
 
1916
+ #: class-sv-wc-plugin.php:598
1917
  msgctxt "verb"
1918
  msgid "Review"
1919
  msgstr ""
1998
  msgid "Diners"
1999
  msgstr ""
2000
 
2001
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:478
2002
  #. translators: http:www.investopedia.com/terms/c/checkingaccount.asp
2003
  msgctxt "account type"
2004
  msgid "Checking"
2005
  msgstr ""
2006
 
2007
+ #: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:480
2008
  #. translators: http:www.investopedia.com/terms/s/savingsaccount.asp
2009
  msgctxt "account type"
2010
  msgid "Savings"
vendor/skyverge/wc-plugin-framework/woocommerce/index.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
18
  *
19
  * @package SkyVerge/WooCommerce
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php CHANGED
@@ -18,13 +18,13 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php CHANGED
@@ -18,14 +18,14 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
 
@@ -71,7 +71,7 @@ abstract class External_Checkout {
71
  */
72
  protected function init() {
73
 
74
- if ( is_admin() && ! is_ajax() ) {
75
  $this->init_admin();
76
  } elseif ( $this->get_processing_gateway() && $this->get_plugin()->get_id() === $this->get_processing_gateway()->get_plugin()->get_id() ) {
77
  $this->init_ajax();
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
71
  */
72
  protected function init() {
73
 
74
+ if ( is_admin() && ! wp_doing_ajax() ) {
75
  $this->init_admin();
76
  } elseif ( $this->get_processing_gateway() && $this->get_plugin()->get_id() === $this->get_processing_gateway()->get_plugin()->get_id() ) {
77
  $this->init_ajax();
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php CHANGED
@@ -19,20 +19,20 @@
19
  *
20
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
21
  * @author SkyVerge
22
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -102,7 +102,7 @@ abstract class Frontend extends Script_Handler {
102
  }
103
 
104
  $locations = $this->get_handler()->get_display_locations();
105
- $is_cart_ajax = is_ajax() && 'update_shipping_method' === SV_WC_Helper::get_requested_value( 'wc-ajax' );
106
 
107
  if ( is_product() && in_array( 'product', $locations, true ) ) {
108
  $this->init_product();
@@ -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_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
 
19
  *
20
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout
21
  * @author SkyVerge
22
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Handlers\Script_Handler;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Helper;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway;
31
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Payment_Gateway\\External_Checkout\\Frontend' ) ) :
36
 
37
 
38
  /**
102
  }
103
 
104
  $locations = $this->get_handler()->get_display_locations();
105
+ $is_cart_ajax = wp_doing_ajax() && 'update_shipping_method' === SV_WC_Helper::get_requested_value( 'wc-ajax' );
106
 
107
  if ( is_product() && in_array( 'product', $locations, true ) ) {
108
  $this->init_product();
322
  */
323
  public function enqueue_scripts() {
324
 
325
+ wp_enqueue_style( 'sv-wc-external-checkout-v5_10_12', $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
@@ -18,18 +18,18 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Helper;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Exception;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,7 +36,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment
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 */
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Helper;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\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
@@ -18,18 +18,18 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,7 +37,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\Payment
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,7 +94,7 @@ class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_7\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_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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Exception;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Plugin;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\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_12', $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
@@ -18,21 +18,21 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_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',
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Google-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout\Google_Pay;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Payment_Gateway\External_Checkout\External_Checkout;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Payment_Gateway\External_Checkout\Orders;
29
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Exception;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Helper;
31
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Plugin;
32
 
33
  defined( 'ABSPATH' ) or exit;
34
 
35
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\\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
@@ -18,13 +18,13 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment_Gateway/External_Checkout
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment_Gateway/External_Checkout
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\External_Checkout;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_7\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' );
61
  }
62
 
63
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Payment_Gateway\External_Checkout\Admin;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,7 +34,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_7\\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_7\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_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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\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_12', $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_12', $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
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_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',
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/External_Checkout/Apple-Pay
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Payment_Gateway\External_Checkout\Orders;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as FrameworkBase;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as FrameworkBase;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php CHANGED
@@ -18,17 +18,17 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\Handlers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
28
 
29
  defined( 'ABSPATH' ) or exit;
30
 
31
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -17,17 +17,17 @@
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
17
  * needs please refer to http://www.skyverge.com
18
  *
19
  * @author SkyVerge
20
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway\Admin;
25
 
26
  defined( 'ABSPATH' ) or exit;
27
 
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12 as Framework;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Admin
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-order-partial-capture.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-profile-field-customer-id.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-profile-section.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Gateway/Admin/Views
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
22
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
23
  */
24
  ?>
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/API
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_API' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin/sv-wc-payment-gateway-admin-order.coffee"],"names":[],"mappings":";CAOG,WAEH,OAAO,SAAE,GACR,aAAD,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAiGC,OA/FA,EAAA,OAAA,EAAA,OAAA,mCAAA,EAA+E,GAC/E,EAAA,OAAA,EAAA,OAAA,mBAAA,EAA+D,GAC/D,EAAA,OAAA,EAAA,OAAA,8BAAA,EAA0E,GAC1E,EAAA,OAAA,EAAA,OAAA,YAAA,E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MAAmB,MAAA,EAAA,KAAA,SAArD,MAAO,EAAS,KAAK,SAEA,EAAS,QAA9B,OAAA,SAAS,WAER,KAAM,WAGP,OAAA,MAAO,EAAkC,iBAExC,OAAQ,WAGT,OAAA,EAAG,4BAA6B,aAGnC,OAAO,2DApGL,KAAA","file":"sv-wc-payment-gateway-admin-order.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript\n Version 5.0.0\n\n Copyright (c) 2017-2020, 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\t\"use strict\"\n\n\tsv_wc_payment_gateway_admin_order = window.sv_wc_payment_gateway_admin_order ? {}\n\twoocommerce_admin = window.woocommerce_admin ? {}\n\twoocommerce_admin_meta_boxes = window.woocommerce_admin_meta_boxes ? {}\n\taccounting = window.accounting ? {}\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events = () ->\n\n\t\t# prevent the events to be attached again\n\t\tif ( $( '.sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events' ).length )\n\t\t\treturn\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).addClass( 'sv-wc-payment-gateway-partial-capture-with-events' ).appendTo( '#woocommerce-order-items .inside' )\n\n\t\t$( '#woocommerce-order-items' ).on 'click', '.sv-wc-payment-gateway-capture:not(.disabled)', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tif ( $( @ ).hasClass( 'partial-capture' ) )\n\n\t\t\t\t$( 'div.sv-wc-payment-gateway-partial-capture' ).slideDown();\n\t\t\t\t$( 'div.wc-order-data-row-toggle' ).not( 'div.sv-wc-payment-gateway-partial-capture' ).slideUp();\n\t\t\t\t$( 'div.wc-order-totals-items' ).slideUp();\n\n\t\t\telse\n\n\t\t\t\tsubmitCapture()\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'change keyup', '#capture_amount', ( e ) ->\n\n\t\t\ttotal = accounting.unformat( $( @ ).val(), woocommerce_admin.mon_decimal_point );\n\n\t\t\tif ( total )\n\t\t\t\t$( 'button.capture-action' ).removeAttr( 'disabled' )\n\t\t\telse\n\t\t\t\t$( 'button.capture-action' ).attr( 'disabled', 'disabled' )\n\n\t\t\t$( 'button .capture-amount .amount' ).text( accounting.formatMoney( total, {\n\t\t\t\tsymbol: woocommerce_admin_meta_boxes.currency_format_symbol,\n\t\t\t\tdecimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep,\n\t\t\t\tthousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep,\n\t\t\t\tprecision: woocommerce_admin_meta_boxes.currency_format_num_decimals,\n\t\t\t\tformat: woocommerce_admin_meta_boxes.currency_format\n\t\t\t} ) )\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'click', '.capture-action', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tamount = $( '.sv-wc-payment-gateway-partial-capture #capture_amount' ).val()\n\t\t\tcomment = $( '.sv-wc-payment-gateway-partial-capture #capture_comment' ).val()\n\n\t\t\tsubmitCapture( amount, comment )\n\n\tsubmitCapture = ( amount = '', comment = '' ) ->\n\n\t\tif ( confirm( sv_wc_payment_gateway_admin_order.capture_ays ) )\n\n\t\t\t$( '#woocommerce-order-items' ).block( {\n\t\t\t\tmessage: null\n\t\t\t\toverlayCSS: {\n\t\t\t\t\tbackground: '#fff'\n\t\t\t\t\topacity: 0.6\n\t\t\t\t}\n\t\t\t} )\n\n\t\t\tdata =\n\t\t\t\taction: sv_wc_payment_gateway_admin_order.capture_action\n\t\t\t\tnonce: sv_wc_payment_gateway_admin_order.capture_nonce\n\t\t\t\tgateway_id: sv_wc_payment_gateway_admin_order.gateway_id\n\t\t\t\torder_id: sv_wc_payment_gateway_admin_order.order_id\n\t\t\t\tamount: amount\n\t\t\t\tcomment: comment\n\n\t\t\t$.ajax(\n\t\t\t\turl: sv_wc_payment_gateway_admin_order.ajax_url\n\t\t\t\tdata: data\n\t\t\t).done( ( response ) ->\n\n\t\t\t\talert( response.data.message ) if response.data? and response.data.message?\n\n\t\t\t\tlocation.reload() if response.success\n\n\t\t\t).fail( ->\n\n\t\t\t\t# connection error\n\t\t\t\talert( sv_wc_payment_gateway_admin_order.capture_error )\n\n\t\t\t).always( ->\n\n\t\t\t\t# never leave the UI blocked\n\t\t\t\t$( '#woocommerce-order-items' ).unblock()\n\t\t\t)\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events()\n"]}
1
+ {"version":3,"sources":["admin/sv-wc-payment-gateway-admin-order.coffee"],"names":[],"mappings":";CAOG,WAEH,OAAO,SAAE,GACR,aAAD,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAiGC,OA/FA,EAAA,OAAA,EAAA,OAAA,mCAAA,EAA+E,GAC/E,EAAA,OAAA,EAAA,OAAA,mBAAA,EAA+D,GAC/D,EAAA,OAAA,EAAA,OAAA,8BAAA,EAA0E,GAC1E,EAAA,OAAA,EAAA,OAAA,YAAA,EAAwD,GAExD,OAAO,qDAAuD,WAGxD,IAAA,EAAG,4FAA6F,OAsCrG,OAnCA,EAAG,0CAA2C,SAAU,qDAAsD,SAAU,oCAExH,EAAG,4BAA6B,GAAG,QAAS,gDAAiD,SAAE,GAIzF,OAFL,EAAE,iBAEG,EAAG,MAAI,SAAU,oBAErB,EAAG,6CAA8C,YACjD,EAAG,gCAAiC,IAAK,6CAA8C,UACvF,EAAG,6BAA8B,WAIjC,MAGF,EAAG,0CAA2C,GAAG,eAAgB,kBAAmB,SAAE,GAExF,IAAA,EAOG,OAPA,EAAQ,EAAW,SAAU,EAAG,MAAI,MAAO,EAAkB,oBAG5D,EAAG,yBAA0B,WAAY,YAEzC,EAAG,yBAA0B,KAAM,WAAY,YAEhD,EAAG,kCAAmC,KAAM,EAAW,YAAa,EAAO,CAC1E,OAAW,EAA6B,uBACxC,QAAW,EAA6B,4BACxC,SAAW,EAA6B,6BACxC,UAAW,EAA6B,6BACxC,OAAW,EAA6B,qBAI1C,EAAG,0CAA2C,GAAG,QAAS,kBAAmB,SAAE,GAEjF,IAAA,EAAA,EAKG,OALA,EAAE,iBAEF,EAAU,EAAG,0DAA2D,MACxE,EAAU,EAAG,2DAA4D,MAEzE,EAAe,EAAQ,MAEzB,EAAgB,WAAE,IAEnB,EAFmB,EAAS,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAAI,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAEnC,GAAA,QAAS,EAAkC,aAkB/C,OAhBA,EAAG,4BAA6B,MAAO,CACtC,QAAS,KACT,WAAY,CACX,WAAY,OACZ,QAAS,MAIX,EACC,CAAA,OAAY,EAAkC,eAC9C,MAAY,EAAkC,cAC9C,WAAY,EAAkC,WAC9C,SAAY,EAAkC,SAC9C,OAAY,EACZ,QAAY,GAEb,EAAE,KACD,CAAA,IAAM,EAAkC,SACxC,KAAM,IACL,KAAM,SAAE,GAIY,GAFa,MAAA,EAAA,MAAmB,MAAA,EAAA,KAAA,SAArD,MAAO,EAAS,KAAK,SAEA,EAAS,QAA9B,OAAA,SAAS,WAER,KAAM,WAGP,OAAA,MAAO,EAAkC,iBAExC,OAAQ,WAGT,OAAA,EAAG,4BAA6B,aAGnC,OAAO,2DApGL,KAAA","file":"sv-wc-payment-gateway-admin-order.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript\n Version 5.0.0\n\n Copyright (c) 2017-2022, 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\t\"use strict\"\n\n\tsv_wc_payment_gateway_admin_order = window.sv_wc_payment_gateway_admin_order ? {}\n\twoocommerce_admin = window.woocommerce_admin ? {}\n\twoocommerce_admin_meta_boxes = window.woocommerce_admin_meta_boxes ? {}\n\taccounting = window.accounting ? {}\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events = () ->\n\n\t\t# prevent the events to be attached again\n\t\tif ( $( '.sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events' ).length )\n\t\t\treturn\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).addClass( 'sv-wc-payment-gateway-partial-capture-with-events' ).appendTo( '#woocommerce-order-items .inside' )\n\n\t\t$( '#woocommerce-order-items' ).on 'click', '.sv-wc-payment-gateway-capture:not(.disabled)', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tif ( $( @ ).hasClass( 'partial-capture' ) )\n\n\t\t\t\t$( 'div.sv-wc-payment-gateway-partial-capture' ).slideDown();\n\t\t\t\t$( 'div.wc-order-data-row-toggle' ).not( 'div.sv-wc-payment-gateway-partial-capture' ).slideUp();\n\t\t\t\t$( 'div.wc-order-totals-items' ).slideUp();\n\n\t\t\telse\n\n\t\t\t\tsubmitCapture()\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'change keyup', '#capture_amount', ( e ) ->\n\n\t\t\ttotal = accounting.unformat( $( @ ).val(), woocommerce_admin.mon_decimal_point );\n\n\t\t\tif ( total )\n\t\t\t\t$( 'button.capture-action' ).removeAttr( 'disabled' )\n\t\t\telse\n\t\t\t\t$( 'button.capture-action' ).attr( 'disabled', 'disabled' )\n\n\t\t\t$( 'button .capture-amount .amount' ).text( accounting.formatMoney( total, {\n\t\t\t\tsymbol: woocommerce_admin_meta_boxes.currency_format_symbol,\n\t\t\t\tdecimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep,\n\t\t\t\tthousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep,\n\t\t\t\tprecision: woocommerce_admin_meta_boxes.currency_format_num_decimals,\n\t\t\t\tformat: woocommerce_admin_meta_boxes.currency_format\n\t\t\t} ) )\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'click', '.capture-action', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tamount = $( '.sv-wc-payment-gateway-partial-capture #capture_amount' ).val()\n\t\t\tcomment = $( '.sv-wc-payment-gateway-partial-capture #capture_comment' ).val()\n\n\t\t\tsubmitCapture( amount, comment )\n\n\tsubmitCapture = ( amount = '', comment = '' ) ->\n\n\t\tif ( confirm( sv_wc_payment_gateway_admin_order.capture_ays ) )\n\n\t\t\t$( '#woocommerce-order-items' ).block( {\n\t\t\t\tmessage: null\n\t\t\t\toverlayCSS: {\n\t\t\t\t\tbackground: '#fff'\n\t\t\t\t\topacity: 0.6\n\t\t\t\t}\n\t\t\t} )\n\n\t\t\tdata =\n\t\t\t\taction: sv_wc_payment_gateway_admin_order.capture_action\n\t\t\t\tnonce: sv_wc_payment_gateway_admin_order.capture_nonce\n\t\t\t\tgateway_id: sv_wc_payment_gateway_admin_order.gateway_id\n\t\t\t\torder_id: sv_wc_payment_gateway_admin_order.order_id\n\t\t\t\tamount: amount\n\t\t\t\tcomment: comment\n\n\t\t\t$.ajax(\n\t\t\t\turl: sv_wc_payment_gateway_admin_order.ajax_url\n\t\t\t\tdata: data\n\t\t\t).done( ( response ) ->\n\n\t\t\t\talert( response.data.message ) if response.data? and response.data.message?\n\n\t\t\t\tlocation.reload() if response.success\n\n\t\t\t).fail( ->\n\n\t\t\t\t# connection error\n\t\t\t\talert( sv_wc_payment_gateway_admin_order.capture_error )\n\n\t\t\t).always( ->\n\n\t\t\t\t# never leave the UI blocked\n\t\t\t\t$( '#woocommerce-order-items' ).unblock()\n\t\t\t)\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events()\n"]}
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_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
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_12=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_12_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,MA4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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"]}
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,iCAAP,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,kB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AAS,MAAO,QAAS,+CAnb1B,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_12\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_12_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_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
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_12=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_12_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_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,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,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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"]}
1
+ {"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_10_12","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,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,kCAAP,WAwBcC,SAAAA,EAAAA,GAAS,EAAA,KAAA,GAGpBC,IAAAA,EAcGD,EAdHC,UACAC,EAaGF,EAbHE,YACAC,EAYGH,EAZHG,cACAC,EAWGJ,EAXHI,WAEAC,GASGL,EAVHM,sBAUGN,EATHK,UACAE,EAQGP,EARHO,yBACAC,EAOGR,EAPHQ,cACAC,EAMGT,EANHS,aACAC,EAKGV,EALHU,WACAC,EAIGX,EAJHW,oBACAC,EAGGZ,EAHHY,cACAC,EAEGb,EAFHa,eACAC,EACGd,EADHc,cAGIC,KAAAA,UAAyBX,EACzBY,KAAAA,WAAyBd,EACzBe,KAAAA,aAAyBd,EACzBe,KAAAA,QAAyBb,EACzBc,KAAAA,uBAAyBZ,EACzBa,KAAAA,aAAyBZ,EACzBa,KAAAA,YAAyBZ,EACzBa,KAAAA,mBAAyBX,EACzBY,KAAAA,aAAyBX,EACzBY,KAAAA,cAAyBX,EACzBY,KAAAA,aAAyBX,EAEzBd,EAAO0B,aACNC,KAAAA,UAAY3B,EAAO0B,YAQnBE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9D,MAAO,gBAAkBA,GAE5BI,KAAAA,YAEA2D,KAAAA,aAAc,CAAE,KAAKhH,iBAhjB5B,CAAA,IAAA,eAsjBC,MAAA,SAAciH,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,UAwkBC,MAAA,WACMf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBC,MAAA,WACMnB,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_12} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_10_12 = class SV_WC_Google_Pay_Handler_v5_10_12 {\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_12_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_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
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_12=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_12_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,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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"]}
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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oot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2022, 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_12\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_12_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_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
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_12=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_12_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,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"]}
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,oCAAP,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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,cAtW9E,CAAA,IAAA,WA6WL,MAAA,WAAa,OAAA,KAAC,KAAK,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,QA7W5E,CAAA,IAAA,aAmXL,MAAA,WAAe,OAAA,KAAC,KAAK,cAnXhB,EAAA,GAuXN,EAAG,SAAS,MAAO,QAAS,kDA5X1B,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-2022, 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_12\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_12 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_12_loaded\" )\n"]}
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/images/license.txt CHANGED
@@ -1,4 +1,4 @@
1
- card-cc-plain.png, card-echeck.png, and sample-check.png are copyright SkyVerge, Inc. 2013-2020
2
 
3
  All other card icons are copyright Dreamstale under the following license:
4
 
1
+ card-cc-plain.png, card-echeck.png, and sample-check.png are copyright SkyVerge, Inc. 2013-2022
2
 
3
  All other card icons are copyright Dreamstale under the following license:
4
 
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_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,6 +605,6 @@ jQuery( function( $ ) {
605
  }
606
  }
607
 
608
- $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_7_loaded' );
609
 
610
  } );
7
  *
8
  * @since 5.10.0
9
  *
10
+ * @type {SV_WC_Google_Pay_Handler_v5_10_12} object
11
  */
12
+ window.SV_WC_Google_Pay_Handler_v5_10_12 = class SV_WC_Google_Pay_Handler_v5_10_12 {
13
 
14
  /**
15
  * Handler constructor.
605
  }
606
  }
607
 
608
+ $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_12_loaded' );
609
 
610
  } );
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Direct' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Helper' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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_12", $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_12", $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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -51,6 +51,9 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
51
  /** @var string JS handler base class name, without the FW version */
52
  protected $js_handler_base_class_name = 'SV_WC_Payment_Form_Handler';
53
 
 
 
 
54
 
55
  /**
56
  * Sets up class.
@@ -99,7 +102,8 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
99
  add_action( "wc_{$gateway_id}_payment_form_end", array( $this, 'render_fieldset_end' ), 5 );
100
 
101
  // payment form JS
102
- add_action( "wc_{$gateway_id}_payment_form_end", array( $this, 'render_js' ), 5 );
 
103
  }
104
 
105
 
@@ -1005,15 +1009,50 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
1005
 
1006
 
1007
  /**
1008
- * Renders the payment form JS
1009
  *
1010
- * @hooked wc_{gateway ID}_payment_form_end @ priority 5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1011
  *
1012
  * @since 4.0.0
1013
  */
1014
  public function render_js() {
1015
 
1016
- wc_enqueue_js( $this->get_safe_handler_js() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1017
  }
1018
 
1019
 
@@ -1064,7 +1103,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_7\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types );
1068
  }
1069
  }
1070
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Payment_Form' ) ) :
30
 
31
 
32
  /**
51
  /** @var string JS handler base class name, without the FW version */
52
  protected $js_handler_base_class_name = 'SV_WC_Payment_Form_Handler';
53
 
54
+ /** @var bool memoization to account whether the payment JS has been rendered for a gateway */
55
+ protected $payment_form_js_rendered = [];
56
+
57
 
58
  /**
59
  * Sets up class.
102
  add_action( "wc_{$gateway_id}_payment_form_end", array( $this, 'render_fieldset_end' ), 5 );
103
 
104
  // payment form JS
105
+ add_action( "wc_{$gateway_id}_payment_form_end", [ $this, 'render_js' ], 5 );
106
+ add_action( 'wp_footer', [ $this, 'maybe_render_js' ] );
107
  }
108
 
109
 
1009
 
1010
 
1011
  /**
1012
+ * Maybe renders the payment gateway JS on checkout or pay pages.
1013
  *
1014
+ * This is hooking directly into `wp_footer` in case the `wc_{$gateway_id}_payment_form_end` didn't trigger already.
1015
+ *
1016
+ * @since 5.10.8
1017
+ */
1018
+ public function maybe_render_js() {
1019
+
1020
+ if ( ! is_order_received_page() && ( is_checkout() || is_checkout_pay_page() || is_add_payment_method_page() ) ) {
1021
+ $this->render_js();
1022
+ }
1023
+ }
1024
+
1025
+
1026
+ /**
1027
+ * Renders the payment form JS.
1028
+ *
1029
+ * This is normally hooked to `wc_{$gateway_id}_payment_form_end` with priority 5.
1030
+ * However, in the circumstance this doesn't trigger, {@see SV_WC_Payment_Gateway_Payment_Form::maybe_render_js()} hooked to footer.
1031
+ * This may happen when the customer reaches checkout with a $0 value order.
1032
+ *
1033
+ * @see SV_WC_Payment_Gateway_Payment_Form::get_safe_handler_js()
1034
  *
1035
  * @since 4.0.0
1036
  */
1037
  public function render_js() {
1038
 
1039
+ $gateway_id = $this->get_gateway()->get_id();
1040
+
1041
+ // bail if the payment form JS was already rendered for the current gateway
1042
+ if ( in_array( $gateway_id, $this->payment_form_js_rendered, true ) ) {
1043
+ return;
1044
+ }
1045
+
1046
+ switch ( current_action() ) :
1047
+ case 'wp_footer' :
1048
+ $this->payment_form_js_rendered[] = $gateway_id;
1049
+ ?><script type="text/javascript">jQuery(function($){<?php echo $this->get_safe_handler_js(); ?>});</script><?php
1050
+ break;
1051
+ case "wc_{$gateway_id}_payment_form_end" :
1052
+ $this->payment_form_js_rendered[] = $gateway_id;
1053
+ wc_enqueue_js( $this->get_safe_handler_js() );
1054
+ break;
1055
+ endswitch;
1056
  }
1057
 
1058
 
1103
 
1104
  if ( is_array( $card_types ) && ! empty( $card_types ) ) {
1105
 
1106
+ $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_10_12\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types );
1107
  }
1108
  }
1109
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php CHANGED
@@ -18,20 +18,20 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
@@ -370,7 +370,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
370
  public function maybe_init_my_payment_methods() {
371
 
372
  // bail if not frontend or an AJAX request
373
- if ( is_admin() && ! is_ajax() ) {
374
  return;
375
  }
376
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
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_12\Payment_Gateway\External_Checkout\External_Checkout;
30
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay;
31
 
32
  defined( 'ABSPATH' ) or exit;
33
 
34
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Plugin' ) ) :
35
 
36
 
37
  /**
370
  public function maybe_init_my_payment_methods() {
371
 
372
  // bail if not frontend or an AJAX request
373
+ if ( is_admin() && ! wp_doing_ajax() ) {
374
  return;
375
  }
376
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway_Privacy' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_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 );
@@ -663,7 +663,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
663
  }
664
 
665
  // only load on the frontend and AJAX
666
- if ( is_admin() && ! is_ajax() ) {
667
  return;
668
  }
669
 
@@ -1303,12 +1303,12 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
1303
 
1304
  // add "detailed customer decline messages" option if the feature is supported
1305
  if ( $this->supports( self::FEATURE_DETAILED_CUSTOMER_DECLINE_MESSAGES ) ) {
1306
- $this->form_fields['enable_customer_decline_messages'] = array(
1307
  'title' => esc_html__( 'Detailed Decline Messages', 'woocommerce-plugin-framework' ),
1308
  'type' => 'checkbox',
1309
  'label' => esc_html__( 'Check to enable detailed decline messages to the customer during checkout when possible, rather than a generic decline message.', 'woocommerce-plugin-framework' ),
1310
- 'default' => 'no',
1311
- );
1312
  }
1313
 
1314
  // debug mode
@@ -3588,7 +3588,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
3588
  }
3589
 
3590
  // add debug message to woocommerce->errors/messages if checkout or both is enabled, the admin/Ajax check ensures capture charge transactions aren't logged as notices to the front end
3591
- if ( ( $this->debug_checkout() || ( 'error' === $type && $this->is_test_environment() ) ) && ( ! is_admin() || is_ajax() ) ) {
3592
 
3593
  if ( 'message' === $type ) {
3594
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WC_Payment_Gateway' ) ) :
30
 
31
 
32
  /**
460
  }
461
 
462
  $handle = 'sv-wc-payment-gateway-payment-form';
463
+ $versioned_handle = $handle . '-v5_10_12';
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 );
663
  }
664
 
665
  // only load on the frontend and AJAX
666
+ if ( is_admin() && ! wp_doing_ajax() ) {
667
  return;
668
  }
669
 
1303
 
1304
  // add "detailed customer decline messages" option if the feature is supported
1305
  if ( $this->supports( self::FEATURE_DETAILED_CUSTOMER_DECLINE_MESSAGES ) ) {
1306
+ $this->form_fields['enable_customer_decline_messages'] = [
1307
  'title' => esc_html__( 'Detailed Decline Messages', 'woocommerce-plugin-framework' ),
1308
  'type' => 'checkbox',
1309
  'label' => esc_html__( 'Check to enable detailed decline messages to the customer during checkout when possible, rather than a generic decline message.', 'woocommerce-plugin-framework' ),
1310
+ 'default' => 'yes',
1311
+ ];
1312
  }
1313
 
1314
  // debug mode
3588
  }
3589
 
3590
  // add debug message to woocommerce->errors/messages if checkout or both is enabled, the admin/Ajax check ensures capture charge transactions aren't logged as notices to the front end
3591
+ if ( ( $this->debug_checkout() || ( 'error' === $type && $this->is_test_environment() ) ) && ( ! is_admin() || wp_doing_ajax() ) ) {
3592
 
3593
  if ( 'message' === $type ) {
3594
 
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Exceptions
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Exceptions
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Payment-Tokens
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
 
18
  *
19
  * @package SkyVerge/WooCommerce/Payment-Gateway/Payment-Tokens
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,22 +18,22 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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,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_7\REST_API::get_system_status_data()
49
  *
50
  * @since 5.2.0
51
  *
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\Payment_Gateway;
26
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\REST_API as Plugin_REST_API;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\Payment_Gateway\\REST_API' ) ) :
31
 
32
 
33
  /**
34
  * The payment gateway plugin REST API handler class.
35
  *
36
+ * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_12\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_12\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
@@ -18,18 +18,18 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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.
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12\REST_API\Controllers;
26
 
27
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Settings_API\Abstract_Settings;
28
+ use SkyVerge\WooCommerce\PluginFramework\v5_10_12\Settings_API\Setting;
29
 
30
  defined( 'ABSPATH' ) or exit;
31
 
32
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Plugin/Classes
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\REST_API' ) ) :
30
 
31
 
32
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php CHANGED
@@ -18,16 +18,16 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge / Delicious Brains
21
- * @copyright Copyright (c) 2015-2020 Delicious Brains Inc.
22
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge / Delicious Brains
21
+ * @copyright Copyright (c) 2015-2022 Delicious Brains Inc.
22
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WP_Async_Request' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php CHANGED
@@ -18,16 +18,16 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge / Delicious Brains
21
- * @copyright Copyright (c) 2015-2020 Delicious Brains Inc.
22
- * @copyright Copyright (c) 2013-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge / Delicious Brains
21
+ * @copyright Copyright (c) 2015-2022 Delicious Brains Inc.
22
+ * @copyright Copyright (c) 2013-2022, SkyVerge, Inc.
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_12;
27
 
28
  defined( 'ABSPATH' ) or exit;
29
 
30
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\SV_WP_Background_Job_Handler' ) ) :
31
 
32
 
33
  /**
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php CHANGED
@@ -18,15 +18,15 @@
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge
21
- * @copyright Copyright (c) 2017-2020, SkyVerge, Inc.
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
  /**
18
  *
19
  * @package SkyVerge/WooCommerce/Utilities
20
  * @author SkyVerge
21
+ * @copyright Copyright (c) 2017-2022, SkyVerge, Inc.
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_12;
26
 
27
  defined( 'ABSPATH' ) or exit;
28
 
29
+ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_12\\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.6.2
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.3.0
15
  *
16
  * Copyright (c) 2016-2020, Automattic, Inc.
17
  *
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.3
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: 6.3.1
15
  *
16
  * Copyright (c) 2016-2020, Automattic, Inc.
17
  *