Version Description
Download this release
Release Info
Developer | SkyVerge |
Plugin | WooCommerce PayPal Powered by Braintree Payment Gateway |
Version | 2.5.0 |
Comparing to | |
See all releases |
Code changes from version 2.4.3 to 2.5.0
- assets/js/admin/wc-braintree.js +173 -0
- assets/js/admin/wc-braintree.min.js +1 -0
- assets/js/frontend/wc-braintree-apple-pay.min.js +1 -1
- assets/js/frontend/wc-braintree.min.js +1 -1
- class-wc-braintree.php +8 -8
- i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot +168 -97
- includes/PayPal/Buttons/Abstract_Button.php +10 -2
- includes/PayPal/Buttons/Cart.php +1 -1
- includes/PayPal/Buttons/Product.php +31 -2
- includes/api/class-wc-braintree-api-response-message-helper.php +1 -1
- includes/api/class-wc-braintree-api.php +1 -1
- includes/api/requests/abstract-wc-braintree-api-request.php +3 -4
- includes/api/requests/class-wc-braintree-api-customer-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-transaction-request.php +1 -1
- includes/api/responses/abstract-wc-braintree-api-response.php +1 -1
- includes/api/responses/abstract-wc-braintree-api-transaction-response.php +1 -1
- includes/api/responses/abstract-wc-braintree-api-vault-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-client-token-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-customer-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-merchant-configuration-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-payment-method-response.php +3 -2
- includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php +1 -1
- includes/apple-pay/api/class-wc-braintree-apple-pay-api-payment-response.php +1 -1
- includes/apple-pay/class-wc-braintree-apple-pay-frontend.php +1 -1
- includes/apple-pay/class-wc-braintree-apple-pay.php +1 -1
- includes/class-wc-braintree-capture.php +1 -1
- includes/class-wc-braintree-frontend.php +13 -5
- includes/class-wc-braintree-lifecycle.php +28 -1
- includes/class-wc-braintree-payment-method-handler.php +19 -18
- includes/class-wc-braintree-payment-method.php +48 -29
- includes/class-wc-gateway-braintree-credit-card.php +2 -4
- includes/class-wc-gateway-braintree-paypal.php +411 -86
- includes/class-wc-gateway-braintree.php +36 -2
- includes/class-wc-payment-token-braintree-paypal.php +47 -0
- includes/integrations/Pre_Orders.php +4 -3
- includes/integrations/Product_Addons.php +1 -1
- includes/payment-forms/abstract-wc-braintree-payment-form.php +1 -1
- includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php +2 -2
- includes/payment-forms/class-wc-braintree-paypal-payment-form.php +31 -7
- readme.txt +8 -2
- vendor/autoload.php +1 -1
- vendor/composer/ClassLoader.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.json +12 -8
- vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php +5 -5
- vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php +6 -6
- vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php +3 -4
- vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/assets/js/admin/sv-wc-plugin-admin-setup-wizard.min.js +1 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/assets/js/admin/sv-wp-admin-job-batch-handler.min.js +1 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt +37 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php +36 -33
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php +48 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php +5 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php +50 -8
- vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.mo +0 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po +508 -463
- vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot +472 -456
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php +481 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php +330 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php +432 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php +234 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php +187 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php +291 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php +721 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php → External_Checkout/Orders.php} +44 -27
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api-request.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api-response.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api.php +4 -4
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php +250 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay-ajax.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay-frontend.php +18 -286
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay.php +31 -182
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php +3 -3
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php +6 -6
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php +47 -10
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-order-partial-capture.php +5 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php +11 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php +0 -416
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-apple-pay.css +0 -23
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-external-checkout.css +19 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-my-payment-methods.min.css +1 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js +4 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map +1 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-admin-order.min.js +0 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-token-editor.min.js +0 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.min.js +0 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js +610 -0
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.min.js +0 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.min.js +0 -1
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +15 -8
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php +16 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php +26 -22
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php +462 -431
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php +14 -4
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php +120 -9
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +84 -8
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php +6 -6
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +100 -38
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php +443 -98
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php +441 -55
- vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php +5 -5
- vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/Controllers/Settings.php +5 -5
- vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php +2 -2
- vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php +2 -2
- woocommerce-gateway-paypal-powered-by-braintree.php +75 -49
assets/js/admin/wc-braintree.js
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* WooCommerce Braintree Admin Javascript
|
3 |
+
* Version 2.5.0
|
4 |
+
*
|
5 |
+
* Copyright (c) 2016-2021, Automattic, Inc.
|
6 |
+
* Licensed under the GNU General Public License v3.0
|
7 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
+
*/
|
9 |
+
jQuery( document ).ready( ( $ ) => {
|
10 |
+
|
11 |
+
'use strict';
|
12 |
+
|
13 |
+
// get button sizes from localized params
|
14 |
+
var buttonSizes = wc_braintree_admin_params.button_sizes;
|
15 |
+
|
16 |
+
var defaultButton;
|
17 |
+
var paylaterButton;
|
18 |
+
var hasRenderedDefaultButton = false;
|
19 |
+
var hasRenderedPaylaterButton = false;
|
20 |
+
var renderingDefaultButton = false;
|
21 |
+
var renderingPaylaterButton = false;
|
22 |
+
|
23 |
+
var $payLaterMessageContainer = $( '#wc_braintree_paypal_pay_later_message_preview' );
|
24 |
+
var payLaterMessage = null;
|
25 |
+
|
26 |
+
var configurePayLaterMessaging = function() {
|
27 |
+
|
28 |
+
$payLaterMessageContainer.attr( 'data-pp-style-logo-type', getPayLaterMessagingLogoType() );
|
29 |
+
$payLaterMessageContainer.attr( 'data-pp-style-logo-position', $( '#woocommerce_braintree_paypal_pay_later_messaging_logo_position' ).val() );
|
30 |
+
$payLaterMessageContainer.attr( 'data-pp-style-text-color', $( '#woocommerce_braintree_paypal_pay_later_messaging_text_color' ).val() );
|
31 |
+
|
32 |
+
if ( ! payLaterMessage && $payLaterMessageContainer.length ) {
|
33 |
+
|
34 |
+
payLaterMessage = paypal.Messages({
|
35 |
+
/**
|
36 |
+
* Sets the Pay Later messaging amount after the first render to workaround an uncaught error that
|
37 |
+
* causes no message to show up the first time.
|
38 |
+
*
|
39 |
+
* The error starts with a warning: Invalid option value (currency). Expected USD but received "EUR",
|
40 |
+
* followed by Uncaught TypeError: Cannot read property 'payload' of undefined.
|
41 |
+
*/
|
42 |
+
onRender: function() {
|
43 |
+
$payLaterMessageContainer.attr('data-pp-amount', 100);
|
44 |
+
}
|
45 |
+
});
|
46 |
+
|
47 |
+
payLaterMessage
|
48 |
+
.render( '#' + $payLaterMessageContainer.attr( 'id' ) )
|
49 |
+
.catch( ( error ) => console.log( error ) );
|
50 |
+
}
|
51 |
+
};
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Gets the selected Pay Later Messaging logo type.
|
55 |
+
*
|
56 |
+
* @return {string}
|
57 |
+
*/
|
58 |
+
var getPayLaterMessagingLogoType = function() {
|
59 |
+
|
60 |
+
return $( '#woocommerce_braintree_paypal_pay_later_messaging_logo_type' ).val();
|
61 |
+
}
|
62 |
+
|
63 |
+
$( '#woocommerce_braintree_paypal_enable_paypal_pay_later' ).on( 'change', function() {
|
64 |
+
|
65 |
+
$( '.pay-later-field' ).closest( 'tr' ).toggle( $( this ).prop( 'checked' ) && $( this ).is( ':visible' ) );
|
66 |
+
} ).change();
|
67 |
+
|
68 |
+
$( '#woocommerce_braintree_paypal_pay_later_messaging_logo_type' ).on( 'change', function() {
|
69 |
+
|
70 |
+
$( '#woocommerce_braintree_paypal_pay_later_messaging_logo_position' ).closest( 'tr' ).toggle( getPayLaterMessagingLogoType() === 'primary' );
|
71 |
+
} ).change();
|
72 |
+
|
73 |
+
$( '#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() {
|
74 |
+
|
75 |
+
if ( defaultButton && defaultButton.close && hasRenderedDefaultButton ) {
|
76 |
+
defaultButton.close().then( () => {
|
77 |
+
$( '#wc_braintree_paypal_button_preview' ).empty();
|
78 |
+
} );
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( paylaterButton && paylaterButton.close && hasRenderedPaylaterButton ) {
|
82 |
+
paylaterButton.close().then( () => {
|
83 |
+
$( '#wc_braintree_paypal_button_preview_paylater' ).empty();
|
84 |
+
} );
|
85 |
+
}
|
86 |
+
|
87 |
+
hasRenderedDefaultButton = false;
|
88 |
+
hasRenderedPaylaterButton = false;
|
89 |
+
|
90 |
+
var color = $( '#woocommerce_braintree_paypal_button_color' ).val();
|
91 |
+
var size = $( '#woocommerce_braintree_paypal_button_size' ).val();
|
92 |
+
var shape = $( '#woocommerce_braintree_paypal_button_shape' ).val();
|
93 |
+
var offerPayLater = $( '#woocommerce_braintree_paypal_enable_paypal_pay_later' ).is( ':checked' );
|
94 |
+
|
95 |
+
var defaultParams = {
|
96 |
+
env: 'sandbox',
|
97 |
+
style: {
|
98 |
+
label: 'pay',
|
99 |
+
color: color,
|
100 |
+
shape: shape,
|
101 |
+
layout: 'vertical',
|
102 |
+
tagline: false,
|
103 |
+
},
|
104 |
+
fundingSource: paypal.FUNDING.PAYPAL,
|
105 |
+
client: {
|
106 |
+
sandbox: 'sandbox',
|
107 |
+
},
|
108 |
+
payment: function( data, actions ) {
|
109 |
+
return actions.payment.create( {
|
110 |
+
payment: {
|
111 |
+
transactions: [
|
112 |
+
{
|
113 |
+
amount: { total: '0.01', currency: 'USD' }
|
114 |
+
}
|
115 |
+
]
|
116 |
+
}
|
117 |
+
} );
|
118 |
+
},
|
119 |
+
onAuthorize: function( data, actions ) {}
|
120 |
+
};
|
121 |
+
|
122 |
+
if ( size !== 'responsive' ) {
|
123 |
+
defaultParams.style.height = buttonSizes[size].height;
|
124 |
+
}
|
125 |
+
|
126 |
+
configurePayLaterMessaging();
|
127 |
+
|
128 |
+
// show the Pay Later messaging only when we intend to show the Pay Later button
|
129 |
+
$payLaterMessageContainer.toggle( offerPayLater );
|
130 |
+
|
131 |
+
if ( ! hasRenderedDefaultButton && ! renderingDefaultButton ) {
|
132 |
+
|
133 |
+
renderingDefaultButton = true;
|
134 |
+
|
135 |
+
defaultButton = paypal.Buttons(defaultParams);
|
136 |
+
|
137 |
+
if ( size !== 'responsive' ) {
|
138 |
+
$( '#wc_braintree_paypal_button_preview' ).width( buttonSizes[size].width );
|
139 |
+
} else {
|
140 |
+
$( '#wc_braintree_paypal_button_preview' ).width( '100%' );
|
141 |
+
}
|
142 |
+
|
143 |
+
defaultButton.render( '#wc_braintree_paypal_button_preview' ).then( () => {
|
144 |
+
hasRenderedDefaultButton = true;
|
145 |
+
renderingDefaultButton = false;
|
146 |
+
} );
|
147 |
+
}
|
148 |
+
|
149 |
+
if ( offerPayLater && ! hasRenderedPaylaterButton && ! renderingPaylaterButton ) {
|
150 |
+
|
151 |
+
renderingPaylaterButton = true;
|
152 |
+
|
153 |
+
var paylaterParams = defaultParams;
|
154 |
+
paylaterParams.fundingSource = paypal.FUNDING.PAYLATER;
|
155 |
+
|
156 |
+
paylaterButton = paypal.Buttons( paylaterParams );
|
157 |
+
if ( paylaterButton.isEligible() ) {
|
158 |
+
|
159 |
+
if ( size !== 'responsive' ) {
|
160 |
+
$( '#wc_braintree_paypal_button_preview_paylater' ).width( buttonSizes[size].width );
|
161 |
+
} else {
|
162 |
+
$( '#wc_braintree_paypal_button_preview_paylater' ).width( '100%' );
|
163 |
+
}
|
164 |
+
|
165 |
+
paylaterButton.render( '#wc_braintree_paypal_button_preview_paylater' ).then( () => {
|
166 |
+
hasRenderedPaylaterButton = true;
|
167 |
+
renderingPaylaterButton = false;
|
168 |
+
} );
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
} ).first().change();
|
173 |
+
} );
|
assets/js/admin/wc-braintree.min.js
ADDED
@@ -0,0 +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()});
|
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,
|
1 |
+
"use strict";var _createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),_get=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)};function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(function(){function i(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}jQuery(document).ready(function(t){var r;function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.on_validate_merchant=t.on_validate_merchant.bind(t),t.process_authorization=t.process_authorization.bind(t),t.store_name=e.store_name,t.client_token_nonce=e.client_token_nonce,t}return r=window.WC_Braintree_Apple_Pay_Handler=(_inherits(o,SV_WC_Apple_Pay_Handler_v5_10_5),_createClass(o,[{key:"is_available",value:function(){return window.ApplePaySession&&ApplePaySession.canMakePayments()}},{key:"init",value:function(){if(this.is_available())return this.instance?_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"init",this).call(this):this.create_client()}},{key:"create_client",value:function(){var t=this;return this.get_client_token().done(function(e){if(e.success)return braintree.client.create({authorization:e.data}).then(function(e){return t.client=e,t.create_instance()}).catch(function(e){return console.error("Could not create Braintree client"),console.error(e)})}).fail(function(e,t,n){return console.error("Could not retrieve the client token via AJAX: "+n)})}},{key:"get_client_token",value:function(){var e={action:"wc_"+this.gateway_id+"_get_client_token",nonce:this.client_token_nonce};return t.post(this.ajax_url,e)}},{key:"create_instance",value:function(){var t=this;return braintree.applePay.create({client:this.client}).then(function(e){return t.instance=e,ApplePaySession.canMakePaymentsWithActiveCard(e.merchantIdentifier).then(function(e){if(e)return t.init()})}).catch(function(e){return console.error("Could not create Braintree Apple Pay instance. "+e.message),console.error(e)})}},{key:"get_new_session",value:function(e){e=this.instance.createPaymentRequest(e);return _get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"get_new_session",this).call(this,e)}},{key:"on_validate_merchant",value:function(e){var t=this;return i(this,r),this.instance.performValidation({validationURL:e.validationURL,displayName:this.store_name}).then(function(e){return t.session.completeMerchantValidation(e)}).catch(function(e){return t.session.abort(),t.fail_payment("Merchant could not be validated. "+e.message)})}},{key:"process_authorization",value:function(t){var n=this;return i(this,r),this.instance.tokenize({token:t.token}).then(function(e){return t.braintree_nonce=e.nonce,_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"process_authorization",n).call(n,t)}).catch(function(e){return n.set_payment_status(!1),n.fail_payment("Payment could not be processed. "+e)})}}]),o),t(document.body).trigger("wc_braintree_apple_pay_handler_loaded")})}).call(void 0);
|
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 c(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}var u=[].indexOf;jQuery(document).ready(function(s){var e,n,r;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 i(e){_classCallCheck(this,i);var t=_possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.on_authorize=t.on_authorize.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_credit_enabled=e.is_paypal_credit_enabled,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.init(),t}function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return 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.product_checkout_nonce=e.product_checkout_nonce,t.product_checkout_url=e.product_checkout_url,t.is_product_page=e.is_product_page,t.validate_product_url=e.validate_product_url,t.validate_product_nonce=e.validate_product_nonce,t.should_validate_product_data=e.should_validate_product_data,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.is_product_page&&t.handle_product_page(),t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}return window.WC_Braintree_Payment_Form_Handler=(_createClass(t,[{key:"init",value:function(){return this.is_sdk_ready()?s("form.checkout").length?this.handle_checkout_page():s("form#order_review").length?this.handle_pay_page():s("form#add_payment_method").length?this.handle_add_payment_method_page():void 0:console.error("Braintree SDK is missing.")}},{key:"handle_checkout_page",value:function(){var e=this;return this.form=s("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",s(document.body).on("updated_checkout",function(){if(!e.setting_up)return s('iframe[name^="braintree-"]').remove(),e.setup_braintree()}),s(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),s(document.body).on("checkout_error",function(){return e.handle_checkout_error()}),this.form.on("checkout_place_order_"+this.id,function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_checkout_error",value:function(){return this.unblock_ui()}},{key:"handle_pay_page",value:function(){var e=this;return this.form=s("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.form=s("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"verify_form",value:function(){return!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0}},{key:"submit_form",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var n=this,e=s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form");if(s("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(){return s("input.js-wc-"+n.id_dasherized+"-payment-token:checked").val()?e.slideUp(200):e.slideDown(200)}).change(),s("input#createaccount").change(function(e){var t=s("input.js-wc-"+n.id_dasherized+"-tokenize-payment-method").closest("p.form-row");return s(e.target).is(":checked")?(t.slideDown(),t.next().show()):(t.hide(),t.next().hide())}),!s("input#createaccount").is(":checked"))return s("input#createaccount").change()}},{key:"setup_braintree",value:function(){if(!s("#wc-"+this.id_dasherized+"-account-number-hosted iframe").data("ready"))return this.setting_up=!0,this.block_ui(),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.create_client()}},{key:"create_client",value:function(){var r=this;return this.log("Creating client."),this.get_client_token().done(function(e){return e.success?braintree.client.create({authorization:e.data}).then(function(e){return r.client=e,r.log("Client ready."),r.setup_integration()}).catch(function(e){return r.handle_integration_error(e),r.unblock_ui()}):r.handle_integration_error(e.data)}).fail(function(e,t,n){return r.handle_integration_error({message:"Could not retrieve the client token via AJAX: "+n}),r.unblock_ui()})}},{key:"get_client_token",value:function(){this.id;var e={action:"wc_"+this.id+"_get_client_token",nonce:this.client_token_nonce};return s.post(this.ajax_url,e)}},{key:"setup_integration",value:function(){var t=this;return this.log("Creating integration."),this.get_integration_class().create(this.get_integration_options()).then(function(e){return t.integration=e,t.show_integration_ui(),s("#wc-"+t.id_dasherized+"-account-number-hosted iframe").data("ready",!0),t.do_integration_ready(),s(document).trigger("wc_"+t.id+"_integration_ready",t.integration),t.log("Integration ready."),t.setting_up=!1}).catch(function(e){return t.handle_integration_error(e),t.unblock_ui(),t.setting_up=!1})}},{key:"refresh_braintree",value:function(){var e=this;if(null!=this.integration&&!this.refreshing&&!this.setting_up)return this.log("Refreshing integration."),this.refreshing=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.refreshing=!1,e.setup_braintree()})}},{key:"teardown_braintree",value:function(){var e=this;if(null!=this.integration)return this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.unblock_ui()})}},{key:"do_integration_ready",value:function(){}},{key:"get_integration_options",value:function(){return{client:this.client}}},{key:"get_integration_class",value:function(){}},{key:"handle_integration_error",value:function(e){return this.log("Integration error. "+e.message,e,"error"),this.hide_integration_ui(),this.unblock_ui()}},{key:"handle_payment_error",value:function(e){return this.log("Payment error. "+e.message,e,"error"),this.render_error(this.get_user_message(e)),this.unblock_ui()}},{key:"render_error",value:function(e){return s(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+e+"</div>").removeClass("processing").unblock(),s("html, body").animate({scrollTop:this.form.offset().top-100},1e3),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),s(document.body).trigger("checkout_error"),this.unblock_ui()}},{key:"get_user_message",value:function(){return this.payment_error_message}},{key:"show_integration_ui",value:function(){if(s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".woocommerce-error").remove(),s("input#createaccount").length&&s("input#createaccount").is(":checked"))return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").show()}},{key:"hide_integration_ui",value:function(){return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").prepend('<div class="woocommerce-error">'+this.integration_error_message+"</div>"),s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").hide()}},{key:"block_ui",value:function(){return s(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return s(this.form_ui_selector).unblock()}},{key:"is_selected",value:function(){return this.get_selected_gateway_id()===this.id}},{key:"is_sdk_ready",value:function(){return"undefined"!=typeof braintree&&null!==braintree&&null!=braintree.client&&null!=this.get_integration_class()}},{key:"has_payment_nonce",value:function(){return this.form.find("input[name=wc_"+this.id+"_payment_nonce]").val()}},{key:"using_payment_token",value:function(){return this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()}},{key:"get_selected_gateway_id",value:function(){return this.form.find("input[name=payment_method]:checked").val()}},{key:"log",value:function(e,t){t=1<arguments.length&&void 0!==t?t:null;if(this.debug)return console.log(this.name+": "+e),t?console.log(t):void 0}}]),t),s(document.body).trigger("wc_braintree_payment_form_handler_loaded"),e=window.WC_Braintree_Credit_Card_Payment_Form_Handler=(_inherits(a,WC_Braintree_Payment_Form_Handler),_createClass(a,[{key:"handle_checkout_error",value:function(){return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_checkout_error",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),s("input[name=wc-"+this.id_dasherized+"-card-type]").val(""),s("input[name=wc-"+this.id_dasherized+"-3d-secure-verified]").val(0)}},{key:"verify_form",value:function(){var e;return this.has_payment_nonce()||!this.csc_required&&this.using_payment_token()?(e=s("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(e)?(this.verify_3d_secure(e.data("nonce"),null,e),!1):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"verify_form",this).call(this)):(this.tokenize_payment(),!1)}},{key:"tokenize_payment",value:function(){var t=this;return this.integration.tokenize().then(function(e){if(t.log("Payment method received.",e),null!=e.nonce&&null!=e.details&&null!=e.details.bin)return t.should_verify_3d_secure(e)?t.verify_3d_secure(e.nonce,e.details.bin):t.submit_form(e.nonce)}).catch(function(e){return t.handle_payment_error(e)})}},{key:"get_integration_options",value:function(){var e={client:this.client,fields:{number:{selector:"#wc-braintree-credit-card-account-number-hosted",placeholder:s("#wc-braintree-credit-card-account-number-hosted").data("placeholder")},cvv:{selector:"#wc-braintree-credit-card-csc-hosted",placeholder:s("#wc-braintree-credit-card-csc-hosted").data("placeholder")},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted",placeholder:s("#wc-braintree-credit-card-expiry-hosted").data("placeholder")}},styles:this.hosted_fields_styles};return this.csc_required&&this.using_payment_token()&&(delete e.fields.number,delete e.fields.expirationDate),this.csc_required||delete e.fields.cvv,e}},{key:"get_integration_class",value:function(){return braintree.hostedFields}},{key:"do_integration_ready",value:function(){var t=this;return this.integration.on("cardTypeChange",function(e){return t.on_card_type_change(e)}),!this.csc_required&&s("input.js-wc-braintree-credit-card-payment-token:checked").val()&&this.teardown_braintree(),this.unblock_ui()}},{key:"handle_saved_payment_methods",value:function(){var e,t,n=this;return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_saved_payment_methods",this).call(this),t=s("div.js-wc-braintree-credit-card-new-payment-method-form"),e=s("div.wc-braintree-hosted-field-card-csc-parent"),s("input.js-wc-braintree-credit-card-payment-token").change(function(){return s("input.js-wc-braintree-credit-card-payment-token:checked").val()?n.csc_required&&e.hasClass("form-row-last")?(e.removeClass("form-row-last").addClass("form-row-first"),t.after(e),n.refresh_braintree()):void 0:(n.csc_required&&e.hasClass("form-row-first")&&(e.removeClass("form-row-first").addClass("form-row-last"),t.find("div.wc-braintree-hosted-field-card-expiry-parent").after(e)),n.refresh_braintree())}).change()}},{key:"get_user_message",value:function(e){var t,n,r,i=[];if("CUSTOMER"===e.type)switch(e.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&i.push(this.params.cvv_missing),this.using_payment_token()||(i.push(this.params.card_number_missing),i.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=e.details)for(t=0,n=(r=e.details.invalidFieldKeys).length;t<n;t++)switch(r[t]){case"number":i.push(this.params.card_number_invalid);break;case"cvv":i.push(this.params.cvv_length_invalid);break;case"expirationDate":i.push(this.params.card_exp_date_invalid)}}else"NETWORK"===e.type&&null!=e.details.originalError.error.message&&(e=e.details.originalError.error.message,/given name format is invalid/.test(e)&&i.push(this.params.first_name_unsupported_characters),/surname format is invalid/.test(e)&&i.push(this.params.last_name_unsupported_characters));return i.length?i.join("<br/>"):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"get_user_message",this).call(this)}},{key:"on_card_type_change",value:function(e){var t,n;if(null!=e.cards)return(t=s("#wc-braintree-credit-card-account-number-hosted")).attr("class",function(e,t){return t.replace(/(^|\s)card-type-\S+/g,"")}),e.cards.length?1===e.cards.length?(n=e.cards[0],s("input[name=wc-"+this.id_dasherized+"-card-type]").val(n.type),null!=n.type&&(e=n.type,0<=u.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<=u.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 c(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 c(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(i,WC_Braintree_Payment_Form_Handler),_createClass(i,[{key:"init",value:function(){var t=this;return _get(i.prototype.__proto__||Object.getPrototypeOf(i.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()})}},{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(i.prototype.__proto__||Object.getPrototypeOf(i.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(i.prototype.__proto__||Object.getPrototypeOf(i.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(i.prototype.__proto__||Object.getPrototypeOf(i.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(){var e,t=this;return c(this,n),this.cart_payment_nonce?this.unblock_ui():(e=this.is_single_use()?"checkout":"vault",this.render_button(this.integration.createPayment({flow:e,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 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_button",value:function(e,t,n){var r,i=this;return s(n).html(""),r=this.is_paypal_credit_enabled&&"USD"===this.get_store_currency()?{allowed:[paypal.FUNDING.CREDIT]}:{disallowed:[paypal.FUNDING.CREDIT]},r={env:this.is_test_environment?"sandbox":"production",commit:this.button_is_pay_now(),style:t,funding:r,payment:function(){return e},onAuthorize:function(e,t){return i.on_authorize(e,t)},onError:function(e){return i.handle_integration_error(e)}},paypal.Button.render(r,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_authorize",value:function(e){var t=this;return c(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(i.prototype.__proto__||Object.getPrototypeOf(i.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 c(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:"is_sdk_ready",value:function(){return _get(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"is_sdk_ready",this).call(this)&&"undefined"!=typeof paypal&&null!==paypal}}]),i),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"),r=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(c(this,r),_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(c(this,r),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){return c(this,r),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?t:n)()}).fail(n)}},{key:"hide_button",value:function(){return s("#wc_braintree_paypal_container").slideUp()}},{key:"show_button",value:function(){return s("#wc_braintree_paypal_container").slideDown()}},{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return(e=e).wp_nonce=this.product_checkout_nonce,e.product_id=s("input[name=wc_braintree_paypal_product_id]").val(),e.cart_form=s("form.cart").serialize(),s.ajax({type:"POST",url:this.product_checkout_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),_),s(document.body).trigger("wc_braintree_paypal_product_button_handler_loaded")})}).call(void 0);
|
1 |
+
"use strict";var _get=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(r):void 0}t=Object.getPrototypeOf(t);if(null!==t)return e(t,n,r)},_createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){function u(e,t){if(!(e instanceof t))throw new Error("Bound instance method accessed before binding")}var c=[].indexOf;jQuery(document).ready(function(s){var e,n,i;function t(e){_classCallCheck(this,t),this.show_integration_ui=this.show_integration_ui.bind(this),this.hide_integration_ui=this.hide_integration_ui.bind(this),this.id=e.id,this.id_dasherized=e.id_dasherized,this.name=e.name,this.type=e.type,this.debug=e.debug,this.client_token_nonce=e.client_token_nonce,this.ajax_url=e.ajax_url,this.integration_error_message=e.integration_error_message,this.payment_error_message=e.payment_error_message,this.params=window.sv_wc_payment_gateway_payment_form_params}function a(e){_classCallCheck(this,a);var t=_possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e));return t.show_integration_ui=t.show_integration_ui.bind(t),t.hide_integration_ui=t.hide_integration_ui.bind(t),t.csc_required=e.csc_required,t.hosted_fields_styles=e.hosted_fields_styles,t.threeds=e.threeds,t.enabled_card_types=e.enabled_card_types,t.init(),t}function r(e){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.on_approve=t.on_approve.bind(t),t.get_linked_account_html=t.get_linked_account_html.bind(t),t.is_test_environment=e.is_test_environment,t.is_paypal_pay_later_enabled=e.is_paypal_pay_later_enabled,t.is_paypal_card_enabled=e.is_paypal_card_enabled,t.force_buyer_country=e.force_buyer_country,t.must_login_message=e.must_login_message,t.must_login_add_method_message=e.must_login_add_method_message,t.button_styles=e.button_styles,t.cart_payment_nonce=e.cart_payment_nonce,t.paypal_intent=e.paypal_intent,t.init(),t}function o(e){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.is_paypal_card_enabled=!1,t.set_payment_method_nonce=e.set_payment_method_nonce,t.cart_handler_url=e.cart_handler_url,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}function _(e){_classCallCheck(this,_);var t=_possibleConstructorReturn(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,e));return t.do_integration_ready=t.do_integration_ready.bind(t),t.validate_product_button=t.validate_product_button.bind(t),t.validate_product_data=t.validate_product_data.bind(t),t.is_paypal_card_enabled=!1,t.product_checkout_nonce=e.product_checkout_nonce,t.product_checkout_url=e.product_checkout_url,t.is_product_page=e.is_product_page,t.validate_product_url=e.validate_product_url,t.validate_product_nonce=e.validate_product_nonce,t.should_validate_product_data=e.should_validate_product_data,t.form=s("form.woocommerce-cart-form"),t.form_ui_selector="",t.is_product_page&&t.handle_product_page(),t.setup_braintree(),s(document.body).on("updated_cart_totals",function(){return t.setup_braintree()}),t}return window.WC_Braintree_Payment_Form_Handler=(_createClass(t,[{key:"init",value:function(){return this.is_sdk_ready()?s("form.checkout").length?this.handle_checkout_page():s("form#order_review").length?this.handle_pay_page():s("form#add_payment_method").length?this.handle_add_payment_method_page():void 0:console.error("Braintree SDK is missing.")}},{key:"handle_checkout_page",value:function(){var e=this;return this.form=s("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",s(document.body).on("updated_checkout",function(){if(!e.setting_up)return s('iframe[name^="braintree-"]').remove(),e.setup_braintree()}),s(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),s(document.body).on("checkout_error",function(){return e.handle_checkout_error()}),this.form.on("checkout_place_order_"+this.id,function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_checkout_error",value:function(){return this.unblock_ui()}},{key:"handle_pay_page",value:function(){var e=this;return this.form=s("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.form=s("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(){if(e.is_selected())return e.block_ui(),e.verify_form()})}},{key:"verify_form",value:function(){return!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0}},{key:"submit_form",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var n=this,e=s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form");if(s("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(){return s("input.js-wc-"+n.id_dasherized+"-payment-token:checked").val()?e.slideUp(200):e.slideDown(200)}).change(),s("input#createaccount").change(function(e){var t=s("input.js-wc-"+n.id_dasherized+"-tokenize-payment-method").closest("p.form-row");return s(e.target).is(":checked")?(t.slideDown(),t.next().show()):(t.hide(),t.next().hide())}),!s("input#createaccount").is(":checked"))return s("input#createaccount").change()}},{key:"setup_braintree",value:function(){if(!s("#wc-"+this.id_dasherized+"-account-number-hosted iframe").data("ready"))return this.setting_up=!0,this.block_ui(),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.create_client()}},{key:"create_client",value:function(){var r=this;return this.log("Creating client."),this.get_client_token().done(function(e){return e.success?braintree.client.create({authorization:e.data}).then(function(e){return r.client=e,r.log("Client ready."),r.setup_integration()}).catch(function(e){return r.handle_integration_error(e),r.unblock_ui()}):r.handle_integration_error(e.data)}).fail(function(e,t,n){return r.handle_integration_error({message:"Could not retrieve the client token via AJAX: "+n}),r.unblock_ui()})}},{key:"get_client_token",value:function(){this.id;var e={action:"wc_"+this.id+"_get_client_token",nonce:this.client_token_nonce};return s.post(this.ajax_url,e)}},{key:"setup_integration",value:function(){var t=this;return this.log("Creating integration."),this.get_integration_class().create(this.get_integration_options()).then(function(e){return t.integration=e,t.show_integration_ui(),s("#wc-"+t.id_dasherized+"-account-number-hosted iframe").data("ready",!0),t.do_integration_ready(),s(document).trigger("wc_"+t.id+"_integration_ready",t.integration),t.log("Integration ready."),t.setting_up=!1}).catch(function(e){return t.handle_integration_error(e),t.unblock_ui(),t.setting_up=!1})}},{key:"refresh_braintree",value:function(){var e=this;if(null!=this.integration&&!this.refreshing&&!this.setting_up)return this.log("Refreshing integration."),this.refreshing=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.refreshing=!1,e.setup_braintree()})}},{key:"teardown_braintree",value:function(){var e=this;if(null!=this.integration&&!this.tearing_down&&!this.setting_up)return this.log("Tearing down integration."),this.tearing_down=!0,this.block_ui(),this.integration.teardown(function(){return e.integration=null,e.tearing_down=!1,e.unblock_ui()})}},{key:"do_integration_ready",value:function(){}},{key:"get_integration_options",value:function(){return{client:this.client}}},{key:"get_integration_class",value:function(){}},{key:"handle_integration_error",value:function(e){return this.log("Integration error. "+e.message,e,"error"),this.hide_integration_ui(),this.unblock_ui()}},{key:"handle_payment_error",value:function(e){return this.log("Payment error. "+e.message,e,"error"),this.render_error(this.get_user_message(e)),this.unblock_ui()}},{key:"render_error",value:function(e){return s(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+e+"</div>").removeClass("processing").unblock(),s("html, body").animate({scrollTop:this.form.offset().top-100},1e3),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),s(document.body).trigger("checkout_error"),this.unblock_ui()}},{key:"get_user_message",value:function(){return this.payment_error_message}},{key:"show_integration_ui",value:function(){if(s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".woocommerce-error").remove(),s("input#createaccount").length&&s("input#createaccount").is(":checked"))return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").show()}},{key:"hide_integration_ui",value:function(){return s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").prepend('<div class="woocommerce-error">'+this.integration_error_message+"</div>"),s("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").hide()}},{key:"block_ui",value:function(){return s(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return s(this.form_ui_selector).unblock()}},{key:"is_selected",value:function(){return this.get_selected_gateway_id()===this.id}},{key:"is_sdk_ready",value:function(){return"undefined"!=typeof braintree&&null!==braintree&&null!=braintree.client&&null!=this.get_integration_class()}},{key:"has_payment_nonce",value:function(){return this.form.find("input[name=wc_"+this.id+"_payment_nonce]").val()}},{key:"using_payment_token",value:function(){return this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()}},{key:"get_selected_gateway_id",value:function(){return this.form.find("input[name=payment_method]:checked").val()}},{key:"log",value:function(e,t){t=1<arguments.length&&void 0!==t?t:null;if(this.debug)return console.log(this.name+": "+e),t?console.log(t):void 0}}]),t),s(document.body).trigger("wc_braintree_payment_form_handler_loaded"),e=window.WC_Braintree_Credit_Card_Payment_Form_Handler=(_inherits(a,WC_Braintree_Payment_Form_Handler),_createClass(a,[{key:"handle_checkout_error",value:function(){return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_checkout_error",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(""),s("input[name=wc-"+this.id_dasherized+"-card-type]").val(""),s("input[name=wc-"+this.id_dasherized+"-3d-secure-verified]").val(0)}},{key:"verify_form",value:function(){var e;return this.has_payment_nonce()||!this.csc_required&&this.using_payment_token()?(e=s("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(e)?(this.verify_3d_secure(e.data("nonce"),null,e),!1):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"verify_form",this).call(this)):(this.tokenize_payment(),!1)}},{key:"tokenize_payment",value:function(){var t=this;return this.integration.tokenize().then(function(e){if(t.log("Payment method received.",e),null!=e.nonce&&null!=e.details&&null!=e.details.bin)return t.should_verify_3d_secure(e)?t.verify_3d_secure(e.nonce,e.details.bin):t.submit_form(e.nonce)}).catch(function(e){return t.handle_payment_error(e)})}},{key:"get_integration_options",value:function(){var e={client:this.client,fields:{number:{selector:"#wc-braintree-credit-card-account-number-hosted",placeholder:s("#wc-braintree-credit-card-account-number-hosted").data("placeholder")},cvv:{selector:"#wc-braintree-credit-card-csc-hosted",placeholder:s("#wc-braintree-credit-card-csc-hosted").data("placeholder")},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted",placeholder:s("#wc-braintree-credit-card-expiry-hosted").data("placeholder")}},styles:this.hosted_fields_styles};return this.csc_required&&this.using_payment_token()&&(delete e.fields.number,delete e.fields.expirationDate),this.csc_required||delete e.fields.cvv,e}},{key:"get_integration_class",value:function(){return braintree.hostedFields}},{key:"do_integration_ready",value:function(){var t=this;return this.integration.on("cardTypeChange",function(e){return t.on_card_type_change(e)}),!this.csc_required&&s("input.js-wc-braintree-credit-card-payment-token:checked").val()&&this.teardown_braintree(),this.unblock_ui()}},{key:"handle_saved_payment_methods",value:function(){var e,t,n=this;return _get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"handle_saved_payment_methods",this).call(this),t=s("div.js-wc-braintree-credit-card-new-payment-method-form"),e=s("div.wc-braintree-hosted-field-card-csc-parent"),s("input.js-wc-braintree-credit-card-payment-token").change(function(){return s("input.js-wc-braintree-credit-card-payment-token:checked").val()?n.csc_required&&e.hasClass("form-row-last")?(e.removeClass("form-row-last").addClass("form-row-first"),t.after(e),n.refresh_braintree()):void 0:(n.csc_required&&e.hasClass("form-row-first")&&(e.removeClass("form-row-first").addClass("form-row-last"),t.find("div.wc-braintree-hosted-field-card-expiry-parent").after(e)),n.refresh_braintree())}).change()}},{key:"get_user_message",value:function(e){var t,n,r,i=[];if("CUSTOMER"===e.type)switch(e.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&i.push(this.params.cvv_missing),this.using_payment_token()||(i.push(this.params.card_number_missing),i.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=e.details)for(t=0,n=(r=e.details.invalidFieldKeys).length;t<n;t++)switch(r[t]){case"number":i.push(this.params.card_number_invalid);break;case"cvv":i.push(this.params.cvv_length_invalid);break;case"expirationDate":i.push(this.params.card_exp_date_invalid)}}else"NETWORK"===e.type&&null!=e.details.originalError.error.message&&(e=e.details.originalError.error.message,/given name format is invalid/.test(e)&&i.push(this.params.first_name_unsupported_characters),/surname format is invalid/.test(e)&&i.push(this.params.last_name_unsupported_characters));return i.length?i.join("<br/>"):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"get_user_message",this).call(this)}},{key:"on_card_type_change",value:function(e){var t,n;if(null!=e.cards)return(t=s("#wc-braintree-credit-card-account-number-hosted")).attr("class",function(e,t){return t.replace(/(^|\s)card-type-\S+/g,"")}),e.cards.length?1===e.cards.length?(n=e.cards[0],s("input[name=wc-"+this.id_dasherized+"-card-type]").val(n.type),null!=n.type&&(e=n.type,0<=c.call(this.enabled_card_types,e))?t.addClass("card-type-"+n.type):t.addClass("card-type-invalid")):void 0:t.addClass("card-type-invalid")}},{key:"is_3d_secure_enabled",value:function(){return this.threeds.enabled&&null!=braintree.threeDSecure}},{key:"setup_integration",value:function(){var t=this;return this.threeds.enabled&&(this.threeds.enabled=this.client.getConfiguration().gatewayConfiguration.threeDSecureEnabled),this.is_3d_secure_enabled()?(s("input[name=wc-"+this.id_dasherized+"-3d-secure-enabled]").val(1),this.threeDSecure&&this.threeDSecure.teardown(),braintree.threeDSecure.create({version:2,client:this.client}).then(function(e){return t.threeDSecure=e,s(document.body).on("click","#wc-braintree-credit-card-3dsecure-container",function(e){return s(e.currentTarget).fadeOut(200),t.threeDSecure.cancelVerifyCard(),t.unblock_ui()}),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",t).call(t)}).catch(function(e){return t.handle_integration_error(e)})):_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"setup_integration",this).call(this)}},{key:"should_verify_3d_secure",value:function(e){var t=e.details.cardType;return this.is_3d_secure_enabled()&&"CreditCard"===e.type&&0<=c.call(this.threeds.card_types,t)}},{key:"should_verify_3d_secure_token",value:function(e){if(this.is_3d_secure_enabled()&&e.val()&&e.data("nonce")&&!e.data("verified"))return!0}},{key:"verify_3d_secure",value:function(e,t,n){var r=this,i=2<arguments.length&&void 0!==n?n:null,a=s("#billing_state").val(),o=s("#billing_country").val(),_=s("#shipping_state").val(),n=s("#shipping_country").val(),o=s("input[name=billing_first_name]").val()?{givenName:s("input[name=billing_first_name]").val().latinise(),surname:s("input[name=billing_last_name]").val().latinise(),phoneNumber:s("input[name=billing_phone]").val(),streetAddress:s("input[name=billing_address_1]").val(),extendedAddress:s("input[name=billing_address_2]").val(),locality:s("#billing_city").val(),region:"string"==typeof a&&a.length<=2?a:"",postalCode:s("input[name=billing_postcode]").val(),countryCodeAlpha2:"string"==typeof o&&o.length<=2?o:""}:{},n=s("input[name=shipping_first_name]").val()?{shippingGivenName:s("input[name=shipping_first_name]").val().latinise(),shippingSurname:s("input[name=shipping_last_name]").val().latinise(),shippingAddress:{streetAddress:s("input[name=shipping_address_1]").val(),extendedAddress:s("input[name=shipping_address_2]").val(),locality:s("input[name=shipping_city]").val(),region:"string"==typeof _&&_.length<=2?_:"",postalCode:s("input[name=shipping_postcode]").val(),countryCodeAlpha2:"string"==typeof n&&n.length<=2?n:""}}:{},n={nonce:e,amount:s("input[name=wc-"+this.id_dasherized+"-3d-secure-order-total]").val(),email:s("input[name=billing_email]").val(),billingAddress:o,additionalInformation:n,onLookupComplete:function(e,t){r.log("3D Secure lookup complete.",e);try{return t()}catch(e){return r.handle_payment_error(e)}}};return"1"===s("input[name=wc-"+this.id_dasherized+"-cart-contains-subscription]").val()&&(n.challengeRequested=!0),this.log("Verifying 3D Secure.",n),this.threeDSecure.verifyCard(n).then(function(e){return r.log("3D Secure response received.",e),r.threeds.liability_shift_always_required&&!e.liabilityShifted?r.render_error(r.threeds.failure_message):(null!=i&&i.data("verified",!0),s("input[name=wc-"+r.id_dasherized+"-3d-secure-verified]").val(1),r.submit_form(e.nonce))}).catch(function(e){return r.handle_payment_error(e)})}},{key:"show_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"show_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").show()}},{key:"hide_integration_ui",value:function(){return u(this,e),_get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"hide_integration_ui",this).call(this),s(".wc-braintree-hosted-field-parent").hide()}}]),a),s(document.body).trigger("wc_braintree_credit_card_payment_form_handler_loaded"),n=window.WC_Braintree_PayPal_Payment_Form_Handler=(_inherits(r,WC_Braintree_Payment_Form_Handler),_createClass(r,[{key:"init",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"init",this).call(this),s("input[name=wc_"+this.id+"_payment_nonce]").val(this.cart_payment_nonce),s(document.body).on("click",'input[name="payment_method"], input.js-wc-braintree-paypal-payment-token',function(){return t.toggle_order_button()}),s(document.body).on("payment_method_selected",function(){return t.toggle_order_button()}),s(document.body).on("click",".wc-braintree-paypal-account .cancel",function(e){return e.preventDefault(),s(e.currentTarget).parent().remove(),t.setup_braintree()}),s(document.body).on("update_checkout",function(e){return t.teardown_braintree()})}},{key:"toggle_order_button",value:function(){return!this.is_selected()||this.has_payment_nonce()||this.using_payment_token()?s("#place_order").show():s("#place_order").hide()}},{key:"verify_form",value:function(){var e=_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"verify_form",this).call(this);return this.has_payment_nonce()||this.using_payment_token()||this.render_error(this.must_login_message),e}},{key:"handle_payment_error",value:function(e){return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_payment_error",this).call(this,e),this.cart_payment_nonce=!1,this.setup_braintree()}},{key:"get_integration_class",value:function(){return braintree.paypalCheckout}},{key:"setup_braintree",value:function(){return this.cart_payment_nonce?this.unblock_ui():(_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setup_braintree",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),this.toggle_order_button())}},{key:"do_integration_ready",value:function(){return u(this,n),this.cart_payment_nonce?this.unblock_ui():(this.load_paypal_sdk(),this.set_device_data())}},{key:"load_paypal_sdk",value:function(){var e,t=this,n=this.get_sdk_options();return this.paypal_sdk_loaded&&this.previous_paypal_sdk_options&&JSON.stringify(this.previous_paypal_sdk_options)===JSON.stringify(n)?this.do_paypal_sdk_loaded():(e=n,this.paypal_sdk_messages_component_loaded&&(e.components="buttons"),this.integration.loadPayPalSDK(e,function(){return t.paypal_sdk_loaded=!0,t.previous_paypal_sdk_options=n,paypal.Messages&&(t.paypal_sdk_messages_component_loaded=!0),t.do_paypal_sdk_loaded()}))}},{key:"do_paypal_sdk_loaded",value:function(){var t=this,e=this.is_single_use()?"checkout":"vault";return this.render_pay_later_messaging(),this.render_button(this.integration.createPayment({flow:e,intent:this.is_single_use()?this.paypal_intent:"tokenize",amount:this.get_order_amount(),currency:this.get_store_currency(),locale:this.get_store_locale()}),this.get_button_styles(),"#wc_braintree_paypal_container").then(function(){return"undefined"===t.get_button_styles().height&&s("#wc_braintree_paypal_container").css({width:"100%"}),t.unblock_ui()}).catch(function(e){return t.log("Could not render the PayPal button. "+e.message,e),t.hide_integration_ui(),t.unblock_ui()})}},{key:"render_pay_later_messaging",value:function(){var t=this,e=s("#wc_braintree_paypal_pay_later_messaging_container");if(e.length)return paypal.Messages?paypal.Messages({amount:this.get_order_amount()}).render("#wc_braintree_paypal_pay_later_messaging_container").catch(function(e){return t.log("Could not render the PayPal Pay Later messeging. "+e.message,e)}):e.hide()}},{key:"render_button",value:function(e,t,n){var r=this;return s(n).html(""),t={env:this.is_test_environment?"sandbox":"production",commit:this.button_is_pay_now(),style:t,onApprove:function(e,t){return r.on_approve(e,t)},onError:function(e){return r.handle_integration_error(e)}},this.is_single_use()?t.createOrder=function(){return e}:t.createBillingAgreement=function(){return e},paypal.Buttons(t).render(n)}},{key:"button_is_pay_now",value:function(){return!s("form#add_payment_method").length}},{key:"get_button_styles",value:function(){return this.button_styles}},{key:"on_approve",value:function(e){var t=this;return u(this,n),this.block_ui(),this.integration.tokenizePayment(e).then(function(e){return t.log("Payment method tokenized.",e),t.set_payment_method(e)}).catch(function(e){return t.handle_payment_error(e),t.unblock_ui()})}},{key:"set_payment_method",value:function(e){return s("input[name=wc_"+this.id+"_payment_nonce]").val(e.nonce),s("#wc_braintree_paypal_container").html(this.get_linked_account_html(e.details)),this.is_single_use()&&s("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!0),s("#place_order").show(),this.form.submit()}},{key:"handle_saved_payment_methods",value:function(){var t=this;return _get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"handle_saved_payment_methods",this).call(this),s("input.js-wc-braintree-paypal-tokenize-payment-method").change(function(e){if(null!=t.integration&&s(e.target).is(":visible"))return t.block_ui(),t.do_integration_ready()}).change()}},{key:"get_linked_account_html",value:function(e){var t;return u(this,n),t=s("<div class='wc-"+this.id_dasherized+"-account'></div>"),null!=e.firstName&&null!=e.lastName&&t.append("<span class='name'>"+e.firstName+" "+e.lastName+"</span>"),t.append("<span class='email'>"+e.email+"</span>"),t.append("<a href='#' class='cancel'>Cancel</a>"),t}},{key:"is_single_use",value:function(){var e=s("input[name=wc-braintree-paypal-tokenize-payment-method]");return 0===e.length||("checkbox"===e.attr("type")?!e.is(":checked"):!e.val())}},{key:"get_order_amount",value:function(){return s("input[name=wc_braintree_paypal_amount]").val()}},{key:"get_store_currency",value:function(){return s("input[name=wc_braintree_paypal_currency]").val()}},{key:"get_store_locale",value:function(){return s("input[name=wc_braintree_paypal_locale]").val()}},{key:"get_sdk_options",value:function(){var e,t=[],n=[];return this.is_paypal_card_enabled||n.push("card"),(this.is_paypal_pay_later_enabled?t:n).push("paylater"),e={components:this.is_paypal_pay_later_enabled?"buttons,messages":"buttons",currency:this.get_store_currency(),intent:this.is_single_use()?this.paypal_intent:"tokenize",vault:!this.is_single_use(),commit:this.button_is_pay_now()},this.force_buyer_country&&(e["buyer-country"]=this.force_buyer_country),t.length&&(e["enable-funding"]=t.join(",")),n.length&&(e["disable-funding"]=n.join(",")),e}},{key:"set_device_data",value:function(){if(braintree&&braintree.dataCollector)return braintree.dataCollector.create({client:this.client,paypal:!0}).then(function(e){if(e&&e.deviceData)return s("#wc_braintree_paypal_device_data").val(e.deviceData)})}}]),r),s(document.body).trigger("wc_braintree_paypal_payment_form_handler_loaded"),window.WC_Braintree_PayPal_Cart_Handler=(_inherits(o,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(o,[{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return e.wp_nonce=this.set_payment_method_nonce,s.ajax({type:"POST",url:this.cart_handler_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),o),s(document.body).trigger("wc_braintree_paypal_cart_handler_loaded"),i=window.WC_Braintree_PayPal_Product_Button_Handler=(_inherits(_,WC_Braintree_PayPal_Payment_Form_Handler),_createClass(_,[{key:"handle_product_page",value:function(){return this.product_form={element:s("form.cart"),is_variable:s("form.cart").hasClass("variations_form")},this.should_validate_product_data&&this.product_form.element.on("change",this.validate_product_button),this.product_form.is_variable&&s(document.body).on("woocommerce_variation_has_changed",this.validate_product_button),this.validate_product_button()}},{key:"do_integration_ready",value:function(){if(u(this,i),_get(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"do_integration_ready",this).call(this),this.is_product_page)return this.validate_product_button()}},{key:"validate_product_button",value:function(){if(u(this,i),this.product_form.is_variable&&this.product_form.element.find(".single_add_to_cart_button").is(".disabled"))this.hide_button();else{if(!this.should_validate_product_data)return this.show_button();this.validate_product_data(this.show_button,this.hide_button)}}},{key:"validate_product_data",value:function(t,n){var r=this;return u(this,i),s.ajax({type:"POST",url:this.validate_product_url,data:{wp_nonce:this.validate_product_nonce,product_id:s("input[name=wc_braintree_paypal_product_id]").val(),cart_form:s("form.cart").serialize()}}).done(function(e){return e.data.is_valid?(e.data.order_amount&&r.maybe_update_order_amount(e.data.order_amount),t()):n()}).fail(n)}},{key:"hide_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideUp()}},{key:"show_button",value:function(){return s("#wc_braintree_paypal_container, #wc_braintree_paypal_pay_later_messaging_container").slideDown()}},{key:"maybe_update_order_amount",value:function(e){if(parseFloat(e)!==parseFloat(this.get_order_amount()))return s('[name="wc_braintree_paypal_amount"]').val(e),this.refresh_braintree()}},{key:"button_is_pay_now",value:function(){return!1}},{key:"set_payment_method",value:function(e){var t=this;if(null!=e.nonce)return(e=e).wp_nonce=this.product_checkout_nonce,e.product_id=s("input[name=wc_braintree_paypal_product_id]").val(),e.cart_form=s("form.cart").serialize(),s.ajax({type:"POST",url:this.product_checkout_url,data:e,dataType:"json"}).done(function(e){if(t.log("Cart response received.",e),null!=e.redirect_url)return window.location=e.redirect_url}).fail(function(e){return t.log("Error setting the PayPal cart data.",e,"error")}).always(function(){return t.unblock_ui()})}},{key:"is_single_use",value:function(){return"1"===s("input[name=wc_braintree_paypal_single_use]").val()}},{key:"has_payment_nonce",value:function(){return!1}}]),_),s(document.body).trigger("wc_braintree_paypal_product_button_handler_loaded")})}).call(void 0);
|
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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
@@ -73,10 +73,10 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
|
|
73 |
|
74 |
|
75 |
/** plugin version number */
|
76 |
-
const VERSION = '2.
|
77 |
|
78 |
/** Braintree JS SDK version */
|
79 |
-
const BRAINTREE_JS_SDK_VERSION = '3.
|
80 |
|
81 |
/** @var WC_Braintree single instance of this plugin */
|
82 |
protected static $instance;
|
@@ -158,6 +158,7 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
|
|
158 |
require_once( $this->get_plugin_path() . '/includes/class-wc-gateway-braintree-paypal.php' );
|
159 |
|
160 |
// payment method
|
|
|
161 |
require_once( $this->get_plugin_path() . '/includes/class-wc-braintree-payment-method-handler.php' );
|
162 |
require_once( $this->get_plugin_path() . '/includes/class-wc-braintree-payment-method.php' );
|
163 |
|
@@ -234,7 +235,6 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
|
|
234 |
'SV_WC_Payment_Gateway_Apple_Pay_API_Response',
|
235 |
'SV_WC_Payment_Gateway_Apple_Pay_Admin',
|
236 |
'SV_WC_Payment_Gateway_Apple_Pay_Frontend',
|
237 |
-
'SV_WC_Payment_Gateway_Apple_Pay_Orders',
|
238 |
'SV_WC_Payment_Gateway_Apple_Pay_Payment_Response',
|
239 |
'SV_WC_Payment_Gateway_Direct',
|
240 |
'SV_WC_Payment_Gateway_Exception',
|
@@ -275,12 +275,12 @@ class WC_Braintree extends Framework\SV_WC_Payment_Gateway_Plugin {
|
|
275 |
require_once $this->get_framework_path() . '/utilities/class-sv-wp-job-batch-handler.php';
|
276 |
|
277 |
require_once $this->get_payment_gateway_framework_path() . '/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php';
|
278 |
-
require_once $this->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php';
|
279 |
-
require_once $this->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php';
|
280 |
-
require_once $this->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
|
281 |
|
282 |
foreach ( $class_names as $class_name ) {
|
283 |
-
class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\
|
284 |
}
|
285 |
}
|
286 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
73 |
|
74 |
|
75 |
/** plugin version number */
|
76 |
+
const VERSION = '2.5.0';
|
77 |
|
78 |
/** Braintree JS SDK version */
|
79 |
+
const BRAINTREE_JS_SDK_VERSION = '3.73.1';
|
80 |
|
81 |
/** @var WC_Braintree single instance of this plugin */
|
82 |
protected static $instance;
|
158 |
require_once( $this->get_plugin_path() . '/includes/class-wc-gateway-braintree-paypal.php' );
|
159 |
|
160 |
// payment method
|
161 |
+
require_once( $this->get_plugin_path() . '/includes/class-wc-payment-token-braintree-paypal.php' );
|
162 |
require_once( $this->get_plugin_path() . '/includes/class-wc-braintree-payment-method-handler.php' );
|
163 |
require_once( $this->get_plugin_path() . '/includes/class-wc-braintree-payment-method.php' );
|
164 |
|
235 |
'SV_WC_Payment_Gateway_Apple_Pay_API_Response',
|
236 |
'SV_WC_Payment_Gateway_Apple_Pay_Admin',
|
237 |
'SV_WC_Payment_Gateway_Apple_Pay_Frontend',
|
|
|
238 |
'SV_WC_Payment_Gateway_Apple_Pay_Payment_Response',
|
239 |
'SV_WC_Payment_Gateway_Direct',
|
240 |
'SV_WC_Payment_Gateway_Exception',
|
275 |
require_once $this->get_framework_path() . '/utilities/class-sv-wp-job-batch-handler.php';
|
276 |
|
277 |
require_once $this->get_payment_gateway_framework_path() . '/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php';
|
278 |
+
require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php';
|
279 |
+
require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php';
|
280 |
+
require_once $this->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php';
|
281 |
|
282 |
foreach ( $class_names as $class_name ) {
|
283 |
+
class_alias( "SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\{$class_name}", "WC_Braintree\\Plugin_Framework\\{$class_name}" );
|
284 |
}
|
285 |
}
|
286 |
|
i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
# Copyright (C)
|
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 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://woocommerce.com/my-account/marketplace-ticket-form/\n"
|
8 |
-
"POT-Creation-Date:
|
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:
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
|
@@ -78,8 +78,8 @@ msgstr ""
|
|
78 |
msgid "Configure PayPal"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: includes/PayPal/Buttons/Abstract_Button.php:
|
82 |
-
#: includes/class-wc-gateway-braintree.php:
|
83 |
msgid "Cancel"
|
84 |
msgstr ""
|
85 |
|
@@ -138,16 +138,16 @@ msgstr ""
|
|
138 |
msgid "Required PayPal token is missing or empty!"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: includes/class-wc-braintree-frontend.php:
|
142 |
#. translators: %s - last four digits of a card/account
|
143 |
msgid "ending in %s"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: includes/class-wc-braintree-frontend.php:
|
147 |
msgid "(default)"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/class-wc-braintree-payment-method-handler.php:
|
151 |
#. translators: Placeholders: %1$s - payment gateway title (PayPal), %2$s -
|
152 |
#. PayPal account email address
|
153 |
msgid "%1$s Account Saved: %2$s"
|
@@ -248,15 +248,15 @@ msgstr ""
|
|
248 |
msgid "Display and Require the Card Security Code (CVV/CID) field on checkout"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
252 |
#: includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php:151
|
253 |
msgid ""
|
254 |
"We cannot process your order with the payment information that you "
|
255 |
"provided. Please use an alternate payment method."
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
259 |
-
#: includes/class-wc-gateway-braintree.php:
|
260 |
msgid ""
|
261 |
"Oops, there was a temporary payment error. Please try another payment "
|
262 |
"method or contact us to complete your transaction."
|
@@ -270,209 +270,280 @@ msgstr ""
|
|
270 |
msgid "Allow customers to securely pay using their PayPal account via Braintree."
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
274 |
msgid "Token ID"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
278 |
msgid "Email"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
282 |
msgid "Use a new PayPal account"
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
286 |
msgid "PayPal Accounts"
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
290 |
msgid "Unlink"
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
294 |
msgid "Button Appearance"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
298 |
msgid "Button Color"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
302 |
msgid "Gold"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
306 |
msgid "Blue"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
310 |
msgid "Silver"
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
314 |
msgid "White"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
318 |
msgid "Black"
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
322 |
msgid "Button Size"
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
326 |
msgid "Medium"
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
330 |
msgid "Large"
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
334 |
msgid "Responsive"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
338 |
msgid "Button Shape"
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
342 |
-
msgid "PayPal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
346 |
-
msgid "
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
350 |
-
msgid "
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
msgid "Buy Now on Product Pages"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
358 |
msgid "Add the PayPal Buy Now button to product pages."
|
359 |
msgstr ""
|
360 |
|
361 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
362 |
msgid "Enable Cart Checkout"
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
366 |
msgid "Allow customers to check out with PayPal from the Cart page"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
370 |
msgid "Preview"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
374 |
#. translators: Placeholders: %1$s - payment method title (e.g. PayPal), %2$s -
|
375 |
#. transaction environment (either Sandbox or blank string), %3$s - type of
|
376 |
#. transaction (either Authorization or Payment)
|
377 |
msgid "%1$s %2$s %3$s Approved"
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
381 |
-
#: includes/class-wc-gateway-braintree.php:
|
382 |
msgid "Sandbox"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
386 |
msgid "Authorization"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
390 |
msgid "Payment"
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
394 |
#: includes/integrations/Pre_Orders.php:109
|
395 |
#. translators: Placeholders: %s - transaction ID
|
396 |
msgid "(Transaction ID %s)"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
400 |
msgid "PayPal Account Saved: %s"
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
404 |
msgid "PayPal"
|
405 |
msgstr ""
|
406 |
|
407 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
408 |
msgid ""
|
409 |
"Click the PayPal icon below to sign into your PayPal account and pay "
|
410 |
"securely."
|
411 |
msgstr ""
|
412 |
|
413 |
-
#: includes/class-wc-gateway-braintree.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
msgid "Merchant ID"
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: includes/class-wc-gateway-braintree.php:
|
418 |
msgid "The Merchant ID for your Braintree account."
|
419 |
msgstr ""
|
420 |
|
421 |
-
#: includes/class-wc-gateway-braintree.php:
|
422 |
msgid "Public Key"
|
423 |
msgstr ""
|
424 |
|
425 |
-
#: includes/class-wc-gateway-braintree.php:
|
426 |
msgid "The Public Key for your Braintree account."
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: includes/class-wc-gateway-braintree.php:
|
430 |
msgid "Private Key"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: includes/class-wc-gateway-braintree.php:
|
434 |
msgid "The Private Key for your Braintree account."
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: includes/class-wc-gateway-braintree.php:
|
438 |
msgid "Sandbox Merchant ID"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: includes/class-wc-gateway-braintree.php:
|
442 |
msgid "The Merchant ID for your Braintree sandbox account."
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: includes/class-wc-gateway-braintree.php:
|
446 |
msgid "Sandbox Public Key"
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: includes/class-wc-gateway-braintree.php:
|
450 |
msgid "The Public Key for your Braintree sandbox account."
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: includes/class-wc-gateway-braintree.php:
|
454 |
msgid "Sandbox Private Key"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: includes/class-wc-gateway-braintree.php:
|
458 |
msgid "The Private Key for your Braintree sandbox account."
|
459 |
msgstr ""
|
460 |
|
461 |
-
#: includes/class-wc-gateway-braintree.php:
|
462 |
msgid "Merchant Account IDs"
|
463 |
msgstr ""
|
464 |
|
465 |
-
#: includes/class-wc-gateway-braintree.php:
|
466 |
msgid ""
|
467 |
"Enter additional merchant account IDs if you do not want to use your "
|
468 |
"Braintree account default. %1$sLearn more about merchant account IDs%2$s"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: includes/class-wc-gateway-braintree.php:
|
472 |
msgid "Dynamic Descriptors"
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: includes/class-wc-gateway-braintree.php:
|
476 |
#. translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag,
|
477 |
#. %4$s - </a> tag
|
478 |
msgid ""
|
@@ -482,11 +553,11 @@ msgid ""
|
|
482 |
"dynamic descriptors%4$s and are using an accepted format.%2$s"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: includes/class-wc-gateway-braintree.php:
|
486 |
msgid "Name"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: includes/class-wc-gateway-braintree.php:
|
490 |
msgid ""
|
491 |
"The value in the business name field of a customer's statement. Company "
|
492 |
"name/DBA section must be either 3, 7 or 12 characters and the product "
|
@@ -494,65 +565,65 @@ msgid ""
|
|
494 |
"between for a total descriptor name of 22 characters)."
|
495 |
msgstr ""
|
496 |
|
497 |
-
#: includes/class-wc-gateway-braintree.php:
|
498 |
msgid "Phone"
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: includes/class-wc-gateway-braintree.php:
|
502 |
msgid ""
|
503 |
"The value in the phone number field of a customer's statement. Phone must "
|
504 |
"be exactly 10 characters and can only contain numbers, dashes, parentheses "
|
505 |
"and periods."
|
506 |
msgstr ""
|
507 |
|
508 |
-
#: includes/class-wc-gateway-braintree.php:
|
509 |
msgid "URL"
|
510 |
msgstr ""
|
511 |
|
512 |
-
#: includes/class-wc-gateway-braintree.php:
|
513 |
msgid ""
|
514 |
"The value in the URL/web address field of a customer's statement. The URL "
|
515 |
"must be 13 characters or less."
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: includes/class-wc-gateway-braintree.php:
|
519 |
msgid "Enter connection credentials manually"
|
520 |
msgstr ""
|
521 |
|
522 |
-
#: includes/class-wc-gateway-braintree.php:
|
523 |
msgid "Connect/Disconnect"
|
524 |
msgstr ""
|
525 |
|
526 |
-
#: includes/class-wc-gateway-braintree.php:
|
527 |
msgid ""
|
528 |
"You just connected your Braintree account to WooCommerce. You can start "
|
529 |
"taking payments now."
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: includes/class-wc-gateway-braintree.php:
|
533 |
msgid ""
|
534 |
"Once you have processed a payment, PayPal will review your application for "
|
535 |
"final approval. Before you ship any goods make sure you have received a "
|
536 |
"final approval for your Braintree account."
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: includes/class-wc-gateway-braintree.php:
|
540 |
msgid "Questions? We are a phone call away: 1-855-489-0345."
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: includes/class-wc-gateway-braintree.php:
|
544 |
msgid "Disconnect from Braintree for WooCommerce"
|
545 |
msgstr ""
|
546 |
|
547 |
-
#: includes/class-wc-gateway-braintree.php:
|
548 |
msgid "Braintree for WooCommerce"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: includes/class-wc-gateway-braintree.php:
|
552 |
msgid "Close modal panel and cancel"
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: includes/class-wc-gateway-braintree.php:
|
556 |
#. translators: Placeholders %1$s - opening HTML <a> link tag, closing HTML
|
557 |
#. </a> link tag
|
558 |
msgid ""
|
@@ -560,35 +631,35 @@ msgid ""
|
|
560 |
"keys%2$s to reconnect. Do you want to proceed with disconnecting?"
|
561 |
msgstr ""
|
562 |
|
563 |
-
#: includes/class-wc-gateway-braintree.php:
|
564 |
msgid "Disconnect"
|
565 |
msgstr ""
|
566 |
|
567 |
-
#: includes/class-wc-gateway-braintree.php:
|
568 |
msgid "Add merchant account ID for %s"
|
569 |
msgstr ""
|
570 |
|
571 |
-
#: includes/class-wc-gateway-braintree.php:
|
572 |
msgid "Add merchant account ID"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: includes/class-wc-gateway-braintree.php:
|
576 |
msgid "Add merchant account ID for "
|
577 |
msgstr ""
|
578 |
|
579 |
-
#: includes/class-wc-gateway-braintree.php:
|
580 |
msgid "Merchant Account ID (%s)"
|
581 |
msgstr ""
|
582 |
|
583 |
-
#: includes/class-wc-gateway-braintree.php:
|
584 |
msgid "Enter merchant account ID"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: includes/class-wc-gateway-braintree.php:
|
588 |
msgid "Remove this merchant account ID"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: includes/class-wc-gateway-braintree.php:
|
592 |
msgid "Production"
|
593 |
msgstr ""
|
594 |
|
@@ -617,7 +688,7 @@ msgstr ""
|
|
617 |
msgid "Authorization only transaction"
|
618 |
msgstr ""
|
619 |
|
620 |
-
#: includes/integrations/Pre_Orders.php:
|
621 |
msgid "Pre-Order Release Payment Failed: %s"
|
622 |
msgstr ""
|
623 |
|
@@ -633,29 +704,29 @@ msgstr ""
|
|
633 |
msgid "Expiration (MMYY)"
|
634 |
msgstr ""
|
635 |
|
636 |
-
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:
|
637 |
msgid ""
|
638 |
"Please click the \"PayPal\" button below to log into your PayPal account "
|
639 |
"before placing your order."
|
640 |
msgstr ""
|
641 |
|
642 |
-
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:
|
643 |
msgid ""
|
644 |
"Please click the \"PayPal\" button below to log into your PayPal account "
|
645 |
"before adding your payment method."
|
646 |
msgstr ""
|
647 |
|
648 |
-
#: woocommerce-gateway-paypal-powered-by-braintree.php:
|
649 |
msgid ""
|
650 |
"Braintree for WooCommerce is inactive. Please deactivate the retired "
|
651 |
"WooCommerce Braintree plugin."
|
652 |
msgstr ""
|
653 |
|
654 |
-
#: woocommerce-gateway-paypal-powered-by-braintree.php:
|
655 |
msgid "Braintree for WooCommerce is inactive because WooCommerce is not installed."
|
656 |
msgstr ""
|
657 |
|
658 |
-
#: woocommerce-gateway-paypal-powered-by-braintree.php:
|
659 |
msgid ""
|
660 |
"The minimum PHP version required for this plugin is %1$s. You are running "
|
661 |
"%2$s."
|
@@ -682,17 +753,17 @@ msgstr ""
|
|
682 |
msgid "http://woocommerce.com/"
|
683 |
msgstr ""
|
684 |
|
685 |
-
#: includes/class-wc-braintree-frontend.php:
|
686 |
msgctxt "Payment Method Type"
|
687 |
msgid "Type"
|
688 |
msgstr ""
|
689 |
|
690 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
691 |
msgctxt "button shape option"
|
692 |
msgid "Pill"
|
693 |
msgstr ""
|
694 |
|
695 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
696 |
msgctxt "button shape option"
|
697 |
msgid "Rectangle"
|
698 |
msgstr ""
|
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.5.0\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://woocommerce.com/my-account/marketplace-ticket-form/\n"
|
8 |
+
"POT-Creation-Date: 2021-03-18 22:57:40+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
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 |
|
78 |
msgid "Configure PayPal"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: includes/PayPal/Buttons/Abstract_Button.php:566
|
82 |
+
#: includes/class-wc-gateway-braintree.php:601
|
83 |
msgid "Cancel"
|
84 |
msgstr ""
|
85 |
|
138 |
msgid "Required PayPal token is missing or empty!"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: includes/class-wc-braintree-frontend.php:107
|
142 |
#. translators: %s - last four digits of a card/account
|
143 |
msgid "ending in %s"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: includes/class-wc-braintree-frontend.php:113
|
147 |
msgid "(default)"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: includes/class-wc-braintree-payment-method-handler.php:97
|
151 |
#. translators: Placeholders: %1$s - payment gateway title (PayPal), %2$s -
|
152 |
#. PayPal account email address
|
153 |
msgid "%1$s Account Saved: %2$s"
|
248 |
msgid "Display and Require the Card Security Code (CVV/CID) field on checkout"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:953
|
252 |
#: includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php:151
|
253 |
msgid ""
|
254 |
"We cannot process your order with the payment information that you "
|
255 |
"provided. Please use an alternate payment method."
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:961
|
259 |
+
#: includes/class-wc-gateway-braintree.php:224
|
260 |
msgid ""
|
261 |
"Oops, there was a temporary payment error. Please try another payment "
|
262 |
"method or contact us to complete your transaction."
|
270 |
msgid "Allow customers to securely pay using their PayPal account via Braintree."
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: includes/class-wc-gateway-braintree-paypal.php:188
|
274 |
msgid "Token ID"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: includes/class-wc-gateway-braintree-paypal.php:193
|
278 |
msgid "Email"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: includes/class-wc-gateway-braintree-paypal.php:233
|
282 |
msgid "Use a new PayPal account"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: includes/class-wc-gateway-braintree-paypal.php:237
|
286 |
msgid "PayPal Accounts"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: includes/class-wc-gateway-braintree-paypal.php:262
|
290 |
msgid "Unlink"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: includes/class-wc-gateway-braintree-paypal.php:284
|
294 |
msgid "Button Appearance"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: includes/class-wc-gateway-braintree-paypal.php:289
|
298 |
msgid "Button Color"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: includes/class-wc-gateway-braintree-paypal.php:291
|
302 |
msgid "Gold"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: includes/class-wc-gateway-braintree-paypal.php:292
|
306 |
msgid "Blue"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: includes/class-wc-gateway-braintree-paypal.php:293
|
310 |
msgid "Silver"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: includes/class-wc-gateway-braintree-paypal.php:294
|
314 |
msgid "White"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: includes/class-wc-gateway-braintree-paypal.php:295
|
318 |
msgid "Black"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: includes/class-wc-gateway-braintree-paypal.php:302
|
322 |
msgid "Button Size"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: includes/class-wc-gateway-braintree-paypal.php:304
|
326 |
msgid "Medium"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: includes/class-wc-gateway-braintree-paypal.php:305
|
330 |
msgid "Large"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: includes/class-wc-gateway-braintree-paypal.php:306
|
334 |
msgid "Responsive"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: includes/class-wc-gateway-braintree-paypal.php:313
|
338 |
msgid "Button Shape"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: includes/class-wc-gateway-braintree-paypal.php:324
|
342 |
+
msgid "PayPal Pay Later offers"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: includes/class-wc-gateway-braintree-paypal.php:326
|
346 |
+
msgid "Show the Pay Later button beneath the standard PayPal button"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: includes/class-wc-gateway-braintree-paypal.php:327
|
350 |
+
msgid "Pay Later buttons and messaging are only shown to eligible buyers"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#: includes/class-wc-gateway-braintree-paypal.php:333
|
354 |
+
msgid "Pay Later Messaging Logo Type"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: includes/class-wc-gateway-braintree-paypal.php:336
|
358 |
+
msgid "Single-line PayPal logo"
|
359 |
+
msgstr ""
|
360 |
+
|
361 |
+
#: includes/class-wc-gateway-braintree-paypal.php:337
|
362 |
+
msgid "\"PP\" monogram logo"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: includes/class-wc-gateway-braintree-paypal.php:338
|
366 |
+
msgid "PayPal logo inline with the content"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: includes/class-wc-gateway-braintree-paypal.php:339
|
370 |
+
msgid "No logo, text only"
|
371 |
+
msgstr ""
|
372 |
+
|
373 |
+
#: includes/class-wc-gateway-braintree-paypal.php:346
|
374 |
+
msgid "Pay Later Messaging Logo Position"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: includes/class-wc-gateway-braintree-paypal.php:349
|
378 |
+
msgid "Logo left of the text"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: includes/class-wc-gateway-braintree-paypal.php:350
|
382 |
+
msgid "Logo right of the text"
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: includes/class-wc-gateway-braintree-paypal.php:351
|
386 |
+
msgid "Logo above the text"
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: includes/class-wc-gateway-braintree-paypal.php:358
|
390 |
+
msgid "Pay Later Messaging Text Color"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: includes/class-wc-gateway-braintree-paypal.php:361
|
394 |
+
msgid "Black text with colored logo"
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: includes/class-wc-gateway-braintree-paypal.php:362
|
398 |
+
msgid "White text with a white logo"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: includes/class-wc-gateway-braintree-paypal.php:363
|
402 |
+
msgid "Black text with a black logo"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: includes/class-wc-gateway-braintree-paypal.php:364
|
406 |
+
msgid "Black text with a grayscale logo"
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: includes/class-wc-gateway-braintree-paypal.php:376
|
410 |
msgid "Buy Now on Product Pages"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: includes/class-wc-gateway-braintree-paypal.php:377
|
414 |
msgid "Add the PayPal Buy Now button to product pages."
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: includes/class-wc-gateway-braintree-paypal.php:383
|
418 |
msgid "Enable Cart Checkout"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: includes/class-wc-gateway-braintree-paypal.php:385
|
422 |
msgid "Allow customers to check out with PayPal from the Cart page"
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: includes/class-wc-gateway-braintree-paypal.php:408
|
426 |
msgid "Preview"
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: includes/class-wc-gateway-braintree-paypal.php:565
|
430 |
#. translators: Placeholders: %1$s - payment method title (e.g. PayPal), %2$s -
|
431 |
#. transaction environment (either Sandbox or blank string), %3$s - type of
|
432 |
#. transaction (either Authorization or Payment)
|
433 |
msgid "%1$s %2$s %3$s Approved"
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: includes/class-wc-gateway-braintree-paypal.php:567
|
437 |
+
#: includes/class-wc-gateway-braintree.php:1464
|
438 |
msgid "Sandbox"
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: includes/class-wc-gateway-braintree-paypal.php:568
|
442 |
msgid "Authorization"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: includes/class-wc-gateway-braintree-paypal.php:568
|
446 |
msgid "Payment"
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: includes/class-wc-gateway-braintree-paypal.php:574
|
450 |
#: includes/integrations/Pre_Orders.php:109
|
451 |
#. translators: Placeholders: %s - transaction ID
|
452 |
msgid "(Transaction ID %s)"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: includes/class-wc-gateway-braintree-paypal.php:595
|
456 |
msgid "PayPal Account Saved: %s"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: includes/class-wc-gateway-braintree-paypal.php:702
|
460 |
msgid "PayPal"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/class-wc-gateway-braintree-paypal.php:716
|
464 |
msgid ""
|
465 |
"Click the PayPal icon below to sign into your PayPal account and pay "
|
466 |
"securely."
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: includes/class-wc-gateway-braintree-paypal.php:1137
|
470 |
+
msgid ""
|
471 |
+
"Displays Pay Later messaging for available offers. Vaulted payment/billing "
|
472 |
+
"agreement integrations and some merchant categories are not eligible to "
|
473 |
+
"promote Pay in 4X. You may not add additional content, wording, marketing "
|
474 |
+
"or other material to encourage use. PayPal reserves the right to take "
|
475 |
+
"action in accordance with the User agreement."
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: includes/class-wc-gateway-braintree-paypal.php:1147
|
479 |
+
msgid ""
|
480 |
+
"Displays Pay Later messaging for available offers. Restrictions apply. "
|
481 |
+
"%1$sClick here to learn more.%2$s"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: includes/class-wc-gateway-braintree.php:394
|
485 |
msgid "Merchant ID"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: includes/class-wc-gateway-braintree.php:397
|
489 |
msgid "The Merchant ID for your Braintree account."
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: includes/class-wc-gateway-braintree.php:401
|
493 |
msgid "Public Key"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: includes/class-wc-gateway-braintree.php:404
|
497 |
msgid "The Public Key for your Braintree account."
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: includes/class-wc-gateway-braintree.php:408
|
501 |
msgid "Private Key"
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: includes/class-wc-gateway-braintree.php:411
|
505 |
msgid "The Private Key for your Braintree account."
|
506 |
msgstr ""
|
507 |
|
508 |
+
#: includes/class-wc-gateway-braintree.php:416
|
509 |
msgid "Sandbox Merchant ID"
|
510 |
msgstr ""
|
511 |
|
512 |
+
#: includes/class-wc-gateway-braintree.php:419
|
513 |
msgid "The Merchant ID for your Braintree sandbox account."
|
514 |
msgstr ""
|
515 |
|
516 |
+
#: includes/class-wc-gateway-braintree.php:423
|
517 |
msgid "Sandbox Public Key"
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: includes/class-wc-gateway-braintree.php:426
|
521 |
msgid "The Public Key for your Braintree sandbox account."
|
522 |
msgstr ""
|
523 |
|
524 |
+
#: includes/class-wc-gateway-braintree.php:430
|
525 |
msgid "Sandbox Private Key"
|
526 |
msgstr ""
|
527 |
|
528 |
+
#: includes/class-wc-gateway-braintree.php:433
|
529 |
msgid "The Private Key for your Braintree sandbox account."
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: includes/class-wc-gateway-braintree.php:438
|
533 |
msgid "Merchant Account IDs"
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: includes/class-wc-gateway-braintree.php:441
|
537 |
msgid ""
|
538 |
"Enter additional merchant account IDs if you do not want to use your "
|
539 |
"Braintree account default. %1$sLearn more about merchant account IDs%2$s"
|
540 |
msgstr ""
|
541 |
|
542 |
+
#: includes/class-wc-gateway-braintree.php:450
|
543 |
msgid "Dynamic Descriptors"
|
544 |
msgstr ""
|
545 |
|
546 |
+
#: includes/class-wc-gateway-braintree.php:453
|
547 |
#. translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag,
|
548 |
#. %4$s - </a> tag
|
549 |
msgid ""
|
553 |
"dynamic descriptors%4$s and are using an accepted format.%2$s"
|
554 |
msgstr ""
|
555 |
|
556 |
+
#: includes/class-wc-gateway-braintree.php:457
|
557 |
msgid "Name"
|
558 |
msgstr ""
|
559 |
|
560 |
+
#: includes/class-wc-gateway-braintree.php:460
|
561 |
msgid ""
|
562 |
"The value in the business name field of a customer's statement. Company "
|
563 |
"name/DBA section must be either 3, 7 or 12 characters and the product "
|
565 |
"between for a total descriptor name of 22 characters)."
|
566 |
msgstr ""
|
567 |
|
568 |
+
#: includes/class-wc-gateway-braintree.php:465
|
569 |
msgid "Phone"
|
570 |
msgstr ""
|
571 |
|
572 |
+
#: includes/class-wc-gateway-braintree.php:468
|
573 |
msgid ""
|
574 |
"The value in the phone number field of a customer's statement. Phone must "
|
575 |
"be exactly 10 characters and can only contain numbers, dashes, parentheses "
|
576 |
"and periods."
|
577 |
msgstr ""
|
578 |
|
579 |
+
#: includes/class-wc-gateway-braintree.php:473
|
580 |
msgid "URL"
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: includes/class-wc-gateway-braintree.php:476
|
584 |
msgid ""
|
585 |
"The value in the URL/web address field of a customer's statement. The URL "
|
586 |
"must be 13 characters or less."
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: includes/class-wc-gateway-braintree.php:516
|
590 |
msgid "Enter connection credentials manually"
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: includes/class-wc-gateway-braintree.php:558
|
594 |
msgid "Connect/Disconnect"
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: includes/class-wc-gateway-braintree.php:562
|
598 |
msgid ""
|
599 |
"You just connected your Braintree account to WooCommerce. You can start "
|
600 |
"taking payments now."
|
601 |
msgstr ""
|
602 |
|
603 |
+
#: includes/class-wc-gateway-braintree.php:563
|
604 |
msgid ""
|
605 |
"Once you have processed a payment, PayPal will review your application for "
|
606 |
"final approval. Before you ship any goods make sure you have received a "
|
607 |
"final approval for your Braintree account."
|
608 |
msgstr ""
|
609 |
|
610 |
+
#: includes/class-wc-gateway-braintree.php:564
|
611 |
msgid "Questions? We are a phone call away: 1-855-489-0345."
|
612 |
msgstr ""
|
613 |
|
614 |
+
#: includes/class-wc-gateway-braintree.php:575
|
615 |
msgid "Disconnect from Braintree for WooCommerce"
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: includes/class-wc-gateway-braintree.php:585
|
619 |
msgid "Braintree for WooCommerce"
|
620 |
msgstr ""
|
621 |
|
622 |
+
#: includes/class-wc-gateway-braintree.php:587
|
623 |
msgid "Close modal panel and cancel"
|
624 |
msgstr ""
|
625 |
|
626 |
+
#: includes/class-wc-gateway-braintree.php:593
|
627 |
#. translators: Placeholders %1$s - opening HTML <a> link tag, closing HTML
|
628 |
#. </a> link tag
|
629 |
msgid ""
|
631 |
"keys%2$s to reconnect. Do you want to proceed with disconnecting?"
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: includes/class-wc-gateway-braintree.php:605
|
635 |
msgid "Disconnect"
|
636 |
msgstr ""
|
637 |
|
638 |
+
#: includes/class-wc-gateway-braintree.php:735
|
639 |
msgid "Add merchant account ID for %s"
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: includes/class-wc-gateway-braintree.php:742
|
643 |
msgid "Add merchant account ID"
|
644 |
msgstr ""
|
645 |
|
646 |
+
#: includes/class-wc-gateway-braintree.php:840
|
647 |
msgid "Add merchant account ID for "
|
648 |
msgstr ""
|
649 |
|
650 |
+
#: includes/class-wc-gateway-braintree.php:938
|
651 |
msgid "Merchant Account ID (%s)"
|
652 |
msgstr ""
|
653 |
|
654 |
+
#: includes/class-wc-gateway-braintree.php:949
|
655 |
msgid "Enter merchant account ID"
|
656 |
msgstr ""
|
657 |
|
658 |
+
#: includes/class-wc-gateway-braintree.php:950
|
659 |
msgid "Remove this merchant account ID"
|
660 |
msgstr ""
|
661 |
|
662 |
+
#: includes/class-wc-gateway-braintree.php:1464
|
663 |
msgid "Production"
|
664 |
msgstr ""
|
665 |
|
688 |
msgid "Authorization only transaction"
|
689 |
msgstr ""
|
690 |
|
691 |
+
#: includes/integrations/Pre_Orders.php:146
|
692 |
msgid "Pre-Order Release Payment Failed: %s"
|
693 |
msgstr ""
|
694 |
|
704 |
msgid "Expiration (MMYY)"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:113
|
708 |
msgid ""
|
709 |
"Please click the \"PayPal\" button below to log into your PayPal account "
|
710 |
"before placing your order."
|
711 |
msgstr ""
|
712 |
|
713 |
+
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:114
|
714 |
msgid ""
|
715 |
"Please click the \"PayPal\" button below to log into your PayPal account "
|
716 |
"before adding your payment method."
|
717 |
msgstr ""
|
718 |
|
719 |
+
#: woocommerce-gateway-paypal-powered-by-braintree.php:127
|
720 |
msgid ""
|
721 |
"Braintree for WooCommerce is inactive. Please deactivate the retired "
|
722 |
"WooCommerce Braintree plugin."
|
723 |
msgstr ""
|
724 |
|
725 |
+
#: woocommerce-gateway-paypal-powered-by-braintree.php:149
|
726 |
msgid "Braintree for WooCommerce is inactive because WooCommerce is not installed."
|
727 |
msgstr ""
|
728 |
|
729 |
+
#: woocommerce-gateway-paypal-powered-by-braintree.php:266
|
730 |
msgid ""
|
731 |
"The minimum PHP version required for this plugin is %1$s. You are running "
|
732 |
"%2$s."
|
753 |
msgid "http://woocommerce.com/"
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: includes/class-wc-braintree-frontend.php:55
|
757 |
msgctxt "Payment Method Type"
|
758 |
msgid "Type"
|
759 |
msgstr ""
|
760 |
|
761 |
+
#: includes/class-wc-gateway-braintree-paypal.php:315
|
762 |
msgctxt "button shape option"
|
763 |
msgid "Pill"
|
764 |
msgstr ""
|
765 |
|
766 |
+
#: includes/class-wc-gateway-braintree-paypal.php:316
|
767 |
msgctxt "button shape option"
|
768 |
msgid "Rectangle"
|
769 |
msgstr ""
|
includes/PayPal/Buttons/Abstract_Button.php
CHANGED
@@ -24,7 +24,8 @@
|
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
|
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
@@ -290,9 +291,16 @@ abstract class Abstract_Button extends Framework\Handlers\Script_Handler {
|
|
290 |
* @since 2.3.0
|
291 |
*/
|
292 |
public function render_button() {
|
|
|
|
|
|
|
293 |
?>
|
294 |
|
295 |
-
|
|
|
|
|
|
|
|
|
296 |
|
297 |
<?php foreach ( $this->get_button_params() as $key => $value ) : ?>
|
298 |
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
+
use WC_Braintree_PayPal_Payment_Form;
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
291 |
* @since 2.3.0
|
292 |
*/
|
293 |
public function render_button() {
|
294 |
+
|
295 |
+
$container_style = $this->get_gateway()->get_button_container_style();
|
296 |
+
|
297 |
?>
|
298 |
|
299 |
+
<?php if ( $this->get_gateway()->is_paypal_pay_later_enabled() ) : ?>
|
300 |
+
<div id="wc_braintree_paypal_pay_later_messaging_container" <?php echo $container_style; ?> <?php echo $this->get_gateway()->get_pay_later_messaging_style_attributes(); ?>></div>
|
301 |
+
<?php endif; ?>
|
302 |
+
|
303 |
+
<div id="<?php echo esc_attr( 'wc_' . $this->get_gateway()->get_id() . '_container' ); ?>" <?php echo $container_style; ?>></div>
|
304 |
|
305 |
<?php foreach ( $this->get_button_params() as $key => $value ) : ?>
|
306 |
|
includes/PayPal/Buttons/Cart.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
includes/PayPal/Buttons/Product.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
@@ -228,7 +228,36 @@ class Product extends Abstract_Button {
|
|
228 |
*/
|
229 |
$is_valid = (bool) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_product_button_validate_product_data', true, $this );
|
230 |
|
231 |
-
wp_send_json_success( [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
|
234 |
|
24 |
|
25 |
namespace WC_Braintree\PayPal\Buttons;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
228 |
*/
|
229 |
$is_valid = (bool) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_product_button_validate_product_data', true, $this );
|
230 |
|
231 |
+
wp_send_json_success( [
|
232 |
+
'order_amount' => $this->get_order_amount_from_form( Framework\SV_WC_Helper::get_posted_value( 'cart_form', '' ) ),
|
233 |
+
'is_valid' => $is_valid,
|
234 |
+
] );
|
235 |
+
}
|
236 |
+
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Gets the order amount for the product and quantity specified in the given form data.
|
240 |
+
*
|
241 |
+
* @since 2.5.0
|
242 |
+
*
|
243 |
+
* @return float
|
244 |
+
*/
|
245 |
+
protected function get_order_amount_from_form( $form ) {
|
246 |
+
|
247 |
+
$form = wp_parse_args( $form, [
|
248 |
+
'variation_id' => null,
|
249 |
+
'quantity' => 1,
|
250 |
+
] );
|
251 |
+
|
252 |
+
if ( ( $variation = wc_get_product( (int) $form['variation_id'] ) ) && $variation instanceof \WC_Product ) {
|
253 |
+
return (float) $variation->get_price() * (int) $form['quantity'];
|
254 |
+
}
|
255 |
+
|
256 |
+
if ( ( $product = wc_get_product( (int) Framework\SV_WC_Helper::get_posted_value( 'product_id' ) ) ) && $product instanceof \WC_Product ) {
|
257 |
+
return (float) $product->get_price() * (int) $form['quantity'];
|
258 |
+
}
|
259 |
+
|
260 |
+
return 0.0;
|
261 |
}
|
262 |
|
263 |
|
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\
|
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_5 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\
|
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_5 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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
@@ -187,8 +187,7 @@ abstract class WC_Braintree_API_Request implements Framework\SV_WC_Payment_Gatew
|
|
187 |
|
188 |
|
189 |
/**
|
190 |
-
*
|
191 |
-
* set
|
192 |
*
|
193 |
* @since 3.0.0
|
194 |
* @deprecated 2.2.0
|
@@ -197,7 +196,7 @@ abstract class WC_Braintree_API_Request implements Framework\SV_WC_Payment_Gatew
|
|
197 |
*/
|
198 |
public function get_request_data() {
|
199 |
|
200 |
-
|
201 |
|
202 |
return $this->get_data();
|
203 |
}
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
187 |
|
188 |
|
189 |
/**
|
190 |
+
* Gets the request data which is the 1st parameter passed to the static callback set.
|
|
|
191 |
*
|
192 |
* @since 3.0.0
|
193 |
* @deprecated 2.2.0
|
196 |
*/
|
197 |
public function get_request_data() {
|
198 |
|
199 |
+
wc_deprecated_function( __METHOD__, '2.2.0', __CLASS__ . '::get_data()' );
|
200 |
|
201 |
return $this->get_data();
|
202 |
}
|
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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
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_5 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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
@@ -55,11 +55,12 @@ class WC_Braintree_API_Payment_Method_Response extends WC_Braintree_API_Vault_Re
|
|
55 |
* @link https://developers.braintreepayments.com/reference/response/payment-method/php
|
56 |
*
|
57 |
* @since 3.0.0
|
|
|
58 |
* @return \WC_Braintree_Payment_Method
|
59 |
*/
|
60 |
public function get_payment_token() {
|
61 |
|
62 |
-
return new WC_Braintree_Payment_Method( $this->response->paymentMethod->token, $this->get_payment_token_data( $this->response->paymentMethod ) );
|
63 |
}
|
64 |
|
65 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
55 |
* @link https://developers.braintreepayments.com/reference/response/payment-method/php
|
56 |
*
|
57 |
* @since 3.0.0
|
58 |
+
*
|
59 |
* @return \WC_Braintree_Payment_Method
|
60 |
*/
|
61 |
public function get_payment_token() {
|
62 |
|
63 |
+
return new \WC_Braintree_Payment_Method( $this->response->paymentMethod->token, $this->get_payment_token_data( $this->response->paymentMethod ) );
|
64 |
}
|
65 |
|
66 |
|
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\
|
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_5 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\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
24 |
|
25 |
namespace WC_Braintree\Apple_Pay\API;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
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\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
24 |
|
25 |
namespace WC_Braintree\Apple_Pay;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
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\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
24 |
|
25 |
namespace WC_Braintree;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 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\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
24 |
|
25 |
namespace WC_Braintree;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
includes/class-wc-braintree-frontend.php
CHANGED
@@ -24,6 +24,8 @@
|
|
24 |
|
25 |
defined( 'ABSPATH' ) or exit;
|
26 |
|
|
|
|
|
27 |
/**
|
28 |
* Braintree Frontend class
|
29 |
*
|
@@ -63,17 +65,20 @@ class WC_Braintree_Frontend {
|
|
63 |
* @since 2.0.0
|
64 |
* @deprecated 2.2.0
|
65 |
*
|
66 |
-
* @param string[] $
|
67 |
* @type string $title payment method title
|
68 |
* @type string $expiry payment method expiry
|
69 |
* @type string $actions actions for payment method
|
70 |
* }
|
71 |
-
* @param \SV_WC_Payment_Gateway_Payment_Token $token token
|
72 |
* @return string[] updated method data
|
73 |
*/
|
74 |
public function add_card_icon_cell( $method, $token ) {
|
75 |
|
|
|
|
|
76 |
$method['icon'] = $this->get_payment_token_icon( $token );
|
|
|
77 |
return $method;
|
78 |
}
|
79 |
|
@@ -113,16 +118,18 @@ class WC_Braintree_Frontend {
|
|
113 |
|
114 |
|
115 |
/**
|
116 |
-
*
|
117 |
*
|
118 |
* @since 2.0.0
|
119 |
* @deprecated 2.2.0
|
120 |
*
|
121 |
-
* @param \SV_WC_Payment_Gateway_Payment_Token $token token
|
122 |
* @return string payment method icon html
|
123 |
*/
|
124 |
protected function get_payment_token_icon( $token ) {
|
125 |
|
|
|
|
|
126 |
$image_url = $token->get_image_url();
|
127 |
$type = $token->get_type_full();
|
128 |
|
@@ -143,8 +150,9 @@ class WC_Braintree_Frontend {
|
|
143 |
* Allow actors to modify the table payment method icon.
|
144 |
*
|
145 |
* @since 2.0.0
|
|
|
146 |
* @param string $image_html payment method icon html
|
147 |
-
* @param \SV_WC_Payment_Gateway_Payment_Token $token token object
|
148 |
*/
|
149 |
return apply_filters( 'wc_braintree_my_payment_methods_table_method_icon', $image_html, $token );
|
150 |
}
|
24 |
|
25 |
defined( 'ABSPATH' ) or exit;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
+
|
29 |
/**
|
30 |
* Braintree Frontend class
|
31 |
*
|
65 |
* @since 2.0.0
|
66 |
* @deprecated 2.2.0
|
67 |
*
|
68 |
+
* @param string[] $method {
|
69 |
* @type string $title payment method title
|
70 |
* @type string $expiry payment method expiry
|
71 |
* @type string $actions actions for payment method
|
72 |
* }
|
73 |
+
* @param Framework\SV_WC_Payment_Gateway_Payment_Token $token token
|
74 |
* @return string[] updated method data
|
75 |
*/
|
76 |
public function add_card_icon_cell( $method, $token ) {
|
77 |
|
78 |
+
wc_deprecated_function( __METHOD__, '2.2.0' );
|
79 |
+
|
80 |
$method['icon'] = $this->get_payment_token_icon( $token );
|
81 |
+
|
82 |
return $method;
|
83 |
}
|
84 |
|
118 |
|
119 |
|
120 |
/**
|
121 |
+
* Gets the payment method icon for a given token, e.g.: the Amex logo.
|
122 |
*
|
123 |
* @since 2.0.0
|
124 |
* @deprecated 2.2.0
|
125 |
*
|
126 |
+
* @param Framework\SV_WC_Payment_Gateway_Payment_Token $token token
|
127 |
* @return string payment method icon html
|
128 |
*/
|
129 |
protected function get_payment_token_icon( $token ) {
|
130 |
|
131 |
+
wc_deprecated_function( __METHOD__, '2.2.0' );
|
132 |
+
|
133 |
$image_url = $token->get_image_url();
|
134 |
$type = $token->get_type_full();
|
135 |
|
150 |
* Allow actors to modify the table payment method icon.
|
151 |
*
|
152 |
* @since 2.0.0
|
153 |
+
*
|
154 |
* @param string $image_html payment method icon html
|
155 |
+
* @param Framework\SV_WC_Payment_Gateway_Payment_Token $token token object
|
156 |
*/
|
157 |
return apply_filters( 'wc_braintree_my_payment_methods_table_method_icon', $image_html, $token );
|
158 |
}
|
includes/class-wc-braintree-lifecycle.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
|
25 |
namespace WC_Braintree;
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
@@ -170,6 +170,12 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
|
|
170 |
|
171 |
$this->get_plugin()->log( 'Completed upgrade for 2.0.2' );
|
172 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
}
|
174 |
|
175 |
|
@@ -289,4 +295,25 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
|
|
289 |
}
|
290 |
|
291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
}
|
24 |
|
25 |
namespace WC_Braintree;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
170 |
|
171 |
$this->get_plugin()->log( 'Completed upgrade for 2.0.2' );
|
172 |
}
|
173 |
+
|
174 |
+
// upgrade to v2.5.0
|
175 |
+
if ( version_compare( $installed_version, '2.5.0', '<' ) ) {
|
176 |
+
|
177 |
+
$this->upgrade_to_2_5_0();
|
178 |
+
}
|
179 |
}
|
180 |
|
181 |
|
295 |
}
|
296 |
|
297 |
|
298 |
+
/**
|
299 |
+
* Updates to version 2.5.0.
|
300 |
+
*
|
301 |
+
* Adds an option to indicate whether the PayPal Pay Later button settings must be unchecked by default.
|
302 |
+
*
|
303 |
+
* @since 2.5.0
|
304 |
+
*/
|
305 |
+
protected function upgrade_to_2_5_0() {
|
306 |
+
|
307 |
+
$paypal_settings = get_option( 'woocommerce_braintree_paypal_settings', [] );
|
308 |
+
|
309 |
+
if ( isset( $paypal_settings['enable_paypal_credit'] ) ) {
|
310 |
+
|
311 |
+
// if enable_paypal_credit was previously set, the pay later button must also be set when upgraded
|
312 |
+
$paypal_settings['enable_paypal_pay_later'] = $paypal_settings['enable_paypal_credit'];
|
313 |
+
}
|
314 |
+
|
315 |
+
update_option( 'woocommerce_braintree_paypal_settings', $paypal_settings );
|
316 |
+
}
|
317 |
+
|
318 |
+
|
319 |
}
|
includes/class-wc-braintree-payment-method-handler.php
CHANGED
@@ -22,15 +22,14 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
/**
|
30 |
-
* Braintree
|
31 |
*
|
32 |
-
* Extends the framework payment tokens handler class to provide Braintree-specific
|
33 |
-
* functionality
|
34 |
*
|
35 |
* @since 3.2.0
|
36 |
*/
|
@@ -38,27 +37,30 @@ class WC_Braintree_Payment_Method_Handler extends Framework\SV_WC_Payment_Gatewa
|
|
38 |
|
39 |
|
40 |
/**
|
41 |
-
*
|
|
|
|
|
42 |
*
|
43 |
* @since 3.0.0
|
44 |
-
*
|
45 |
-
* @param string $
|
46 |
-
* @param array $data token data
|
47 |
* @return \WC_Braintree_Payment_Method
|
48 |
*/
|
49 |
-
public function build_token( $
|
50 |
|
51 |
-
return new WC_Braintree_Payment_Method( $
|
52 |
}
|
53 |
|
54 |
|
55 |
/**
|
56 |
-
*
|
57 |
-
*
|
58 |
-
* the
|
59 |
-
* the credit card token meta entry, and vice versa.
|
60 |
*
|
61 |
* @since 3.0.0
|
|
|
62 |
* @param int $user_id WP user ID
|
63 |
* @param array $tokens array of tokens
|
64 |
* @param string $environment_id optional environment id, defaults to plugin current environment
|
@@ -67,7 +69,6 @@ class WC_Braintree_Payment_Method_Handler extends Framework\SV_WC_Payment_Gatewa
|
|
67 |
public function update_tokens( $user_id, $tokens, $environment_id = null ) {
|
68 |
|
69 |
foreach ( $tokens as $token_id => $token ) {
|
70 |
-
|
71 |
if ( ( $this->get_gateway()->is_credit_card_gateway() && ! $token->is_credit_card() ) || ( $this->get_gateway()->is_paypal_gateway() && ! $token->is_paypal_account() ) ) {
|
72 |
unset( $tokens[ $token_id ] );
|
73 |
}
|
@@ -78,11 +79,11 @@ class WC_Braintree_Payment_Method_Handler extends Framework\SV_WC_Payment_Gatewa
|
|
78 |
|
79 |
|
80 |
/**
|
81 |
-
* Gets the order note message when a customer saves their payment method
|
82 |
-
* to their account.
|
83 |
*
|
84 |
* @since 2.0.1
|
85 |
-
*
|
|
|
86 |
* @return string
|
87 |
*/
|
88 |
protected function get_order_note( $token ) {
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
/**
|
30 |
+
* Braintree payment method handler.
|
31 |
*
|
32 |
+
* Extends the framework payment tokens handler class to provide Braintree-specific functionality.
|
|
|
33 |
*
|
34 |
* @since 3.2.0
|
35 |
*/
|
37 |
|
38 |
|
39 |
/**
|
40 |
+
* Gets a payment token instance.
|
41 |
+
*
|
42 |
+
* @see Framework\SV_WC_Payment_Gateway_Payment_Tokens_Handler::build_token()
|
43 |
*
|
44 |
* @since 3.0.0
|
45 |
+
*
|
46 |
+
* @param string $token token ID
|
47 |
+
* @param array|\WC_Payment_Token $data token data or object
|
48 |
* @return \WC_Braintree_Payment_Method
|
49 |
*/
|
50 |
+
public function build_token( $token, $data ) {
|
51 |
|
52 |
+
return new \WC_Braintree_Payment_Method( $token, $data );
|
53 |
}
|
54 |
|
55 |
|
56 |
/**
|
57 |
+
* Update payment tokens.
|
58 |
+
*
|
59 |
+
* When retrieving payment methods via the Braintree API, it returns both credit/debit card *and* PayPal methods from a single call.
|
60 |
+
* Overriding the core framework update method ensures that PayPal accounts are not saved to the credit card token meta entry, and vice versa.
|
61 |
*
|
62 |
* @since 3.0.0
|
63 |
+
*
|
64 |
* @param int $user_id WP user ID
|
65 |
* @param array $tokens array of tokens
|
66 |
* @param string $environment_id optional environment id, defaults to plugin current environment
|
69 |
public function update_tokens( $user_id, $tokens, $environment_id = null ) {
|
70 |
|
71 |
foreach ( $tokens as $token_id => $token ) {
|
|
|
72 |
if ( ( $this->get_gateway()->is_credit_card_gateway() && ! $token->is_credit_card() ) || ( $this->get_gateway()->is_paypal_gateway() && ! $token->is_paypal_account() ) ) {
|
73 |
unset( $tokens[ $token_id ] );
|
74 |
}
|
79 |
|
80 |
|
81 |
/**
|
82 |
+
* Gets the order note message when a customer saves their payment method to their account.
|
|
|
83 |
*
|
84 |
* @since 2.0.1
|
85 |
+
*
|
86 |
+
* @param Framework\SV_WC_Payment_Gateway_Payment_Token $token the payment token being saved
|
87 |
* @return string
|
88 |
*/
|
89 |
protected function get_order_note( $token ) {
|
includes/class-wc-braintree-payment-method.php
CHANGED
@@ -22,15 +22,14 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
/**
|
30 |
-
* Braintree Payment Method Class
|
31 |
*
|
32 |
-
* Extends the framework Payment Token class to provide Braintree-specific
|
33 |
-
* functionality like billing addresses and PayPal support
|
34 |
*
|
35 |
* @since 3.0.0
|
36 |
*/
|
@@ -45,23 +44,7 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
45 |
|
46 |
|
47 |
/**
|
48 |
-
*
|
49 |
-
*
|
50 |
-
* @since 3.0.0
|
51 |
-
* @param string $id token ID
|
52 |
-
* @param array $data token data
|
53 |
-
*/
|
54 |
-
public function __construct( $id, array $data ) {
|
55 |
-
|
56 |
-
parent::__construct( $id, $data );
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
/** Credit Card methods ***************************************************/
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Get the billing address ID associated with this credit card
|
65 |
*
|
66 |
* @since 3.0.0
|
67 |
* @return string|null
|
@@ -72,13 +55,11 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
72 |
}
|
73 |
|
74 |
|
75 |
-
/** PayPal account methods ************************************************/
|
76 |
-
|
77 |
-
|
78 |
/**
|
79 |
-
*
|
80 |
*
|
81 |
* @since 3.0.0
|
|
|
82 |
* @return bool
|
83 |
*/
|
84 |
public function is_paypal_account() {
|
@@ -88,10 +69,10 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
88 |
|
89 |
|
90 |
/**
|
91 |
-
*
|
92 |
-
* email address associated with the PayPal account
|
93 |
*
|
94 |
* @since 3.0.0
|
|
|
95 |
* @return string|void
|
96 |
*/
|
97 |
public function get_type_full() {
|
@@ -101,9 +82,10 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
101 |
|
102 |
|
103 |
/**
|
104 |
-
*
|
105 |
*
|
106 |
* @since 3.0.0
|
|
|
107 |
* @return string|null
|
108 |
*/
|
109 |
public function get_payer_email() {
|
@@ -113,9 +95,10 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
113 |
|
114 |
|
115 |
/**
|
116 |
-
*
|
117 |
*
|
118 |
* @since 3.0.0
|
|
|
119 |
* @return string|null
|
120 |
*/
|
121 |
public function get_payer_id() {
|
@@ -124,4 +107,40 @@ class WC_Braintree_Payment_Method extends Framework\SV_WC_Payment_Gateway_Paymen
|
|
124 |
}
|
125 |
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
/**
|
30 |
+
* Braintree Payment Method Class.
|
31 |
*
|
32 |
+
* Extends the framework Payment Token class to provide Braintree-specific functionality like billing addresses and PayPal support.
|
|
|
33 |
*
|
34 |
* @since 3.0.0
|
35 |
*/
|
44 |
|
45 |
|
46 |
/**
|
47 |
+
* Gets the billing address ID associated with the credit card.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
*
|
49 |
* @since 3.0.0
|
50 |
* @return string|null
|
55 |
}
|
56 |
|
57 |
|
|
|
|
|
|
|
58 |
/**
|
59 |
+
* Determines if the payment method is for a PayPal account.
|
60 |
*
|
61 |
* @since 3.0.0
|
62 |
+
*
|
63 |
* @return bool
|
64 |
*/
|
65 |
public function is_paypal_account() {
|
69 |
|
70 |
|
71 |
/**
|
72 |
+
* Overrides the standard type full method to change the type text to the email address associated with the PayPal account.
|
|
|
73 |
*
|
74 |
* @since 3.0.0
|
75 |
+
*
|
76 |
* @return string|void
|
77 |
*/
|
78 |
public function get_type_full() {
|
82 |
|
83 |
|
84 |
/**
|
85 |
+
* Gets the email associated with the PayPal account
|
86 |
*
|
87 |
* @since 3.0.0
|
88 |
+
*
|
89 |
* @return string|null
|
90 |
*/
|
91 |
public function get_payer_email() {
|
95 |
|
96 |
|
97 |
/**
|
98 |
+
* Gets the payer ID associated with the PayPal account
|
99 |
*
|
100 |
* @since 3.0.0
|
101 |
+
*
|
102 |
* @return string|null
|
103 |
*/
|
104 |
public function get_payer_id() {
|
107 |
}
|
108 |
|
109 |
|
110 |
+
/**
|
111 |
+
* Gets the framework token type based on the type of the associated WooCommerce core token.
|
112 |
+
*
|
113 |
+
* @since 2.5.0
|
114 |
+
*
|
115 |
+
* @param \WC_Payment_Token $token WooCommerce core token
|
116 |
+
*
|
117 |
+
* @return string
|
118 |
+
*/
|
119 |
+
protected function get_type_from_woocommerce_payment_token( \WC_Payment_Token $token ) {
|
120 |
+
|
121 |
+
if ( $token instanceof \WC_Payment_Token_Braintree_PayPal ) {
|
122 |
+
return self::PAYPAL_TYPE;
|
123 |
+
}
|
124 |
+
|
125 |
+
return parent::get_type_from_woocommerce_payment_token( $token );
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Creates the WooCommerce core payment token object that store the data of this framework token.
|
131 |
+
*
|
132 |
+
* @since 2.5.0
|
133 |
+
*
|
134 |
+
* @return \WC_Payment_Token
|
135 |
+
*/
|
136 |
+
protected function make_new_woocommerce_payment_token() {
|
137 |
+
|
138 |
+
if ( $this->is_paypal_account() ) {
|
139 |
+
return new \WC_Payment_Token_Braintree_PayPal();
|
140 |
+
}
|
141 |
+
|
142 |
+
return parent::make_new_woocommerce_payment_token();
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
}
|
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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
@@ -712,15 +712,13 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
712 |
/**
|
713 |
* Determines if Kount is supported.
|
714 |
*
|
715 |
-
* Currently limited to non-US shops who are not using Braintree Auth.
|
716 |
-
*
|
717 |
* @since 2.1.0
|
718 |
*
|
719 |
* @return bool
|
720 |
*/
|
721 |
public function is_kount_supported() {
|
722 |
|
723 |
-
return $this->is_connected_manually()
|
724 |
}
|
725 |
|
726 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
712 |
/**
|
713 |
* Determines if Kount is supported.
|
714 |
*
|
|
|
|
|
715 |
* @since 2.1.0
|
716 |
*
|
717 |
* @return bool
|
718 |
*/
|
719 |
public function is_kount_supported() {
|
720 |
|
721 |
+
return $this->is_connected_manually();
|
722 |
}
|
723 |
|
724 |
|
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\
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
@@ -45,8 +45,8 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
45 |
/** @var bool whether buy now buttons should be added to product pages */
|
46 |
protected $enable_product_buy_now;
|
47 |
|
48 |
-
/** @var bool whether paypal
|
49 |
-
protected $
|
50 |
|
51 |
/** @var string button color */
|
52 |
protected $button_color;
|
@@ -102,7 +102,7 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
102 |
add_filter( 'gettext', array( $this, 'tweak_payment_methods_text' ), 10, 3 );
|
103 |
|
104 |
// tweak the "Delete" link text on the My Payment Methods table to "Unlink"
|
105 |
-
add_filter( '
|
106 |
|
107 |
// tweak the admin token editor to support PayPal accounts
|
108 |
add_filter( 'wc_payment_gateway_braintree_paypal_token_editor_fields', array( $this, 'adjust_token_editor_fields' ) );
|
@@ -153,8 +153,9 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
153 |
|
154 |
parent::enqueue_gateway_assets();
|
155 |
|
156 |
-
wp_enqueue_script( 'braintree-js-paypal', 'https://
|
157 |
-
wp_enqueue_script( 'braintree-js-paypal-checkout', 'https://js.braintreegateway.com/web/' . WC_Braintree::BRAINTREE_JS_SDK_VERSION . '/js/paypal-checkout.min.js',
|
|
|
158 |
}
|
159 |
}
|
160 |
|
@@ -246,18 +247,22 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
246 |
* which is more semantically correct (and less likely to cause customers
|
247 |
* to think they are deleting their actual PayPal account)
|
248 |
*
|
|
|
|
|
249 |
* @since 3.0.0
|
250 |
-
*
|
251 |
-
* @param
|
|
|
|
|
252 |
* @return array
|
253 |
*/
|
254 |
-
public function tweak_my_payment_methods_delete_text( $
|
255 |
|
256 |
-
if ( $
|
257 |
-
$actions['delete']['name'] = __( 'Unlink', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
258 |
}
|
259 |
|
260 |
-
return $
|
261 |
}
|
262 |
|
263 |
|
@@ -313,14 +318,55 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
313 |
'default' => 'pill',
|
314 |
];
|
315 |
|
316 |
-
$
|
317 |
-
|
318 |
-
'
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
$form_fields['button_preview'] = [
|
326 |
'type' => 'button_preview',
|
@@ -353,63 +399,7 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
353 |
*/
|
354 |
protected function generate_button_preview_html() {
|
355 |
|
356 |
-
wp_enqueue_script( 'braintree-js-paypal',
|
357 |
-
|
358 |
-
$button_js = '
|
359 |
-
|
360 |
-
var funding = {};
|
361 |
-
|
362 |
-
if ( offer_credit ) {
|
363 |
-
funding.allowed = [ paypal.FUNDING.CREDIT ];
|
364 |
-
} else {
|
365 |
-
funding.disallowed = [ paypal.FUNDING.CREDIT ];
|
366 |
-
}
|
367 |
-
|
368 |
-
paypal.Button.render( {
|
369 |
-
env: "sandbox",
|
370 |
-
style: {
|
371 |
-
label: "pay",
|
372 |
-
color: color,
|
373 |
-
size: size,
|
374 |
-
shape: shape,
|
375 |
-
layout: "vertical",
|
376 |
-
tagline: false,
|
377 |
-
},
|
378 |
-
funding: funding,
|
379 |
-
client: {
|
380 |
-
sandbox: "sandbox",
|
381 |
-
},
|
382 |
-
payment: function( data, actions ) {
|
383 |
-
return actions.payment.create( {
|
384 |
-
payment: {
|
385 |
-
transactions: [
|
386 |
-
{
|
387 |
-
amount: { total: "0.01", currency: "USD" }
|
388 |
-
}
|
389 |
-
]
|
390 |
-
}
|
391 |
-
} );
|
392 |
-
},
|
393 |
-
onAuthorize: function( data, actions ) {}
|
394 |
-
}, "#wc_braintree_paypal_button_preview" );
|
395 |
-
';
|
396 |
-
|
397 |
-
wc_enqueue_js( '
|
398 |
-
|
399 |
-
$( "#woocommerce_braintree_paypal_button_color, #woocommerce_braintree_paypal_button_size, #woocommerce_braintree_paypal_button_shape, #woocommerce_braintree_paypal_enable_paypal_credit" ).on( "change", function() {
|
400 |
-
|
401 |
-
$( "#wc_braintree_paypal_button_preview" ).empty();
|
402 |
-
|
403 |
-
var color = $( "#woocommerce_braintree_paypal_button_color" ).val();
|
404 |
-
var size = $( "#woocommerce_braintree_paypal_button_size" ).val();
|
405 |
-
var shape = $( "#woocommerce_braintree_paypal_button_shape" ).val();
|
406 |
-
var offer_credit = $( "#woocommerce_braintree_paypal_enable_paypal_credit" ).is( ":checked" );
|
407 |
-
|
408 |
-
' . $button_js . '
|
409 |
-
|
410 |
-
} ).change();
|
411 |
-
|
412 |
-
' );
|
413 |
|
414 |
ob_start();
|
415 |
?>
|
@@ -418,7 +408,13 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
418 |
<?php esc_html_e( 'Preview', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
419 |
</th>
|
420 |
<td class="forminp">
|
421 |
-
<div id="
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
</td>
|
423 |
</tr>
|
424 |
<?php
|
@@ -427,6 +423,33 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
427 |
}
|
428 |
|
429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
/**
|
431 |
* Add PayPal method specific form fields, currently:
|
432 |
*
|
@@ -788,28 +811,133 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
788 |
|
789 |
|
790 |
/**
|
791 |
-
* Determines
|
792 |
*
|
793 |
-
* @since 2.
|
794 |
*
|
795 |
* @return bool
|
796 |
*/
|
797 |
-
public function
|
798 |
|
799 |
-
return $this->
|
800 |
}
|
801 |
|
802 |
|
803 |
/**
|
804 |
-
* Determines
|
805 |
*
|
806 |
-
* @since 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
807 |
*
|
808 |
* @return bool
|
809 |
*/
|
810 |
-
public function
|
811 |
|
812 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
}
|
814 |
|
815 |
|
@@ -852,4 +980,201 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
852 |
}
|
853 |
|
854 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
855 |
}
|
23 |
*/
|
24 |
|
25 |
use WC_Braintree\PayPal\Buttons;
|
26 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
45 |
/** @var bool whether buy now buttons should be added to product pages */
|
46 |
protected $enable_product_buy_now;
|
47 |
|
48 |
+
/** @var bool whether paypal pay later is enabled */
|
49 |
+
protected $enable_paypal_pay_later;
|
50 |
|
51 |
/** @var string button color */
|
52 |
protected $button_color;
|
102 |
add_filter( 'gettext', array( $this, 'tweak_payment_methods_text' ), 10, 3 );
|
103 |
|
104 |
// tweak the "Delete" link text on the My Payment Methods table to "Unlink"
|
105 |
+
add_filter( 'woocommerce_payment_methods_list_item', [ $this, 'tweak_my_payment_methods_delete_text' ], 10, 2 );
|
106 |
|
107 |
// tweak the admin token editor to support PayPal accounts
|
108 |
add_filter( 'wc_payment_gateway_braintree_paypal_token_editor_fields', array( $this, 'adjust_token_editor_fields' ) );
|
153 |
|
154 |
parent::enqueue_gateway_assets();
|
155 |
|
156 |
+
wp_enqueue_script( 'braintree-js-paypal-client', 'https://js.braintreegateway.com/web/' . WC_Braintree::BRAINTREE_JS_SDK_VERSION . '/js/client.min.js', [], WC_Braintree::VERSION, true );
|
157 |
+
wp_enqueue_script( 'braintree-js-paypal-checkout', 'https://js.braintreegateway.com/web/' . WC_Braintree::BRAINTREE_JS_SDK_VERSION . '/js/paypal-checkout.min.js', [], WC_Braintree::VERSION, true );
|
158 |
+
wp_enqueue_script( 'braintree-js-paypal-data-collector', 'https://js.braintreegateway.com/web/' . WC_Braintree::BRAINTREE_JS_SDK_VERSION . '/js/data-collector.min.js', [], WC_Braintree::VERSION, true );
|
159 |
}
|
160 |
}
|
161 |
|
247 |
* which is more semantically correct (and less likely to cause customers
|
248 |
* to think they are deleting their actual PayPal account)
|
249 |
*
|
250 |
+
* @internal
|
251 |
+
*
|
252 |
* @since 3.0.0
|
253 |
+
*
|
254 |
+
* @param array $item individual list item from woocommerce_saved_payment_methods_list
|
255 |
+
* @param \WC_Payment_Token $core_token payment token associated with this method entry
|
256 |
+
*
|
257 |
* @return array
|
258 |
*/
|
259 |
+
public function tweak_my_payment_methods_delete_text( $item, $core_token ) {
|
260 |
|
261 |
+
if ( isset( $item['actions']['delete'] ) && $core_token instanceof \WC_Payment_Token_Braintree_PayPal ) {
|
262 |
+
$item['actions']['delete']['name'] = __( 'Unlink', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
263 |
}
|
264 |
|
265 |
+
return $item;
|
266 |
}
|
267 |
|
268 |
|
318 |
'default' => 'pill',
|
319 |
];
|
320 |
|
321 |
+
if( $this->is_paypal_pay_later_supported() ) {
|
322 |
+
|
323 |
+
$form_fields['enable_paypal_pay_later'] = [
|
324 |
+
'title' => __( 'PayPal Pay Later offers', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
325 |
+
'type' => 'checkbox',
|
326 |
+
'label' => __( 'Show the Pay Later button beneath the standard PayPal button', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
327 |
+
'desc_tip' => __( 'Pay Later buttons and messaging are only shown to eligible buyers', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
328 |
+
'description' => $this->get_settings_description_text(),
|
329 |
+
'default' => 'yes',
|
330 |
+
];
|
331 |
+
|
332 |
+
$form_fields['pay_later_messaging_logo_type'] = [
|
333 |
+
'title' => __( 'Pay Later Messaging Logo Type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
334 |
+
'type' => 'select',
|
335 |
+
'options' => [
|
336 |
+
'primary' => __( 'Single-line PayPal logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
337 |
+
'alternative' => __( '"PP" monogram logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
338 |
+
'inline' => __( 'PayPal logo inline with the content', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
339 |
+
'none' => __( 'No logo, text only', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
340 |
+
],
|
341 |
+
'default' => 'inline',
|
342 |
+
'class' => 'pay-later-field',
|
343 |
+
];
|
344 |
+
|
345 |
+
$form_fields['pay_later_messaging_logo_position'] = [
|
346 |
+
'title' => __( 'Pay Later Messaging Logo Position', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
347 |
+
'type' => 'select',
|
348 |
+
'options' => [
|
349 |
+
'left' => __( 'Logo left of the text', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
350 |
+
'right' => __( 'Logo right of the text', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
351 |
+
'top' => __( 'Logo above the text', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
352 |
+
],
|
353 |
+
'default' => 'left',
|
354 |
+
'class' => 'pay-later-field',
|
355 |
+
];
|
356 |
+
|
357 |
+
$form_fields['pay_later_messaging_text_color'] = [
|
358 |
+
'title' => __( 'Pay Later Messaging Text Color', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
359 |
+
'type' => 'select',
|
360 |
+
'options' => [
|
361 |
+
'black' => __( 'Black text with colored logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
362 |
+
'white' => __( 'White text with a white logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
363 |
+
'monochrome' => __( 'Black text with a black logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
364 |
+
'grayscale' => __( 'Black text with a grayscale logo', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
365 |
+
],
|
366 |
+
'default' => 'black',
|
367 |
+
'class' => 'pay-later-field',
|
368 |
+
];
|
369 |
+
}
|
370 |
|
371 |
$form_fields['button_preview'] = [
|
372 |
'type' => 'button_preview',
|
399 |
*/
|
400 |
protected function generate_button_preview_html() {
|
401 |
|
402 |
+
wp_enqueue_script( 'braintree-js-paypal-sdk', $this->get_paypal_sdk_url(), array(), null, true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
ob_start();
|
405 |
?>
|
408 |
<?php esc_html_e( 'Preview', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
409 |
</th>
|
410 |
<td class="forminp">
|
411 |
+
<div id="wc_braintree_paypal_button_preview_container" style="max-width: 400px; pointer-events: none;">
|
412 |
+
<?php if ( $this->is_paypal_pay_later_supported() ) : ?>
|
413 |
+
<div id="wc_braintree_paypal_pay_later_message_preview" data-pp-layout="text" <?php echo $this->get_pay_later_messaging_style_attributes(); ?>></div>
|
414 |
+
<?php endif; ?>
|
415 |
+
<div id="wc_braintree_paypal_button_preview" style="max-width:400px; pointer-events:none;"></div>
|
416 |
+
<div id="wc_braintree_paypal_button_preview_paylater" style="max-width:400px; pointer-events:none;"></div>
|
417 |
+
</div>
|
418 |
</td>
|
419 |
</tr>
|
420 |
<?php
|
423 |
}
|
424 |
|
425 |
|
426 |
+
/**
|
427 |
+
* Gets the URL used to load the PayPal SDK for the button preview.
|
428 |
+
*
|
429 |
+
* @since 2.5.0
|
430 |
+
*
|
431 |
+
* @return string
|
432 |
+
*/
|
433 |
+
protected function get_paypal_sdk_url() {
|
434 |
+
|
435 |
+
// gets the store country
|
436 |
+
$buyer_country = WC()->countries->get_base_country();
|
437 |
+
|
438 |
+
$args = [
|
439 |
+
'client-id' => $this->get_sandbox_sdk_client_id( $buyer_country ),
|
440 |
+
'components' => 'buttons,messages,funding-eligibility',
|
441 |
+
'buyer-country' => $buyer_country,
|
442 |
+
'currency' => get_woocommerce_currency(),
|
443 |
+
];
|
444 |
+
|
445 |
+
if ( $this->should_force_buyer_country_on_loading_sdk() && ( $buyer_country = get_user_meta( wp_get_current_user()->ID, 'billing_country', true ) ) ) {
|
446 |
+
$args['buyer-country'] = $buyer_country;
|
447 |
+
}
|
448 |
+
|
449 |
+
return add_query_arg( rawurlencode_deep( $args ), 'https://www.paypal.com/sdk/js' );
|
450 |
+
}
|
451 |
+
|
452 |
+
|
453 |
/**
|
454 |
* Add PayPal method specific form fields, currently:
|
455 |
*
|
811 |
|
812 |
|
813 |
/**
|
814 |
+
* Determines whether the PayPal Pay Later button is enabled.
|
815 |
*
|
816 |
+
* @since 2.5.0
|
817 |
*
|
818 |
* @return bool
|
819 |
*/
|
820 |
+
public function is_paypal_pay_later_enabled() {
|
821 |
|
822 |
+
return 'no' !== $this->enable_paypal_pay_later && $this->is_paypal_pay_later_supported();
|
823 |
}
|
824 |
|
825 |
|
826 |
/**
|
827 |
+
* Determines whether PayPal Pay Later is supported.
|
828 |
*
|
829 |
+
* @since 2.5.0
|
830 |
+
*
|
831 |
+
* @return bool
|
832 |
+
*/
|
833 |
+
public function is_paypal_pay_later_supported() {
|
834 |
+
|
835 |
+
// pay later buttons can only be enabled by merchants with the following store base locations and currencies
|
836 |
+
$supported_settings = [
|
837 |
+
'US' => 'USD',
|
838 |
+
'GB' => 'GBP',
|
839 |
+
'FR' => 'EUR',
|
840 |
+
'DE' => 'EUR',
|
841 |
+
'AU' => 'AUD',
|
842 |
+
];
|
843 |
+
|
844 |
+
// gets the store base country
|
845 |
+
$base_country = strtoupper( isset( WC()->countries ) ? WC()->countries->get_base_country() : null );
|
846 |
+
|
847 |
+
// gets the store currency
|
848 |
+
$currency = strtoupper( get_woocommerce_currency() );
|
849 |
+
|
850 |
+
return isset( $supported_settings[ $base_country ] ) && $currency === $supported_settings[ $base_country ];
|
851 |
+
}
|
852 |
+
|
853 |
+
|
854 |
+
/**
|
855 |
+
* Gets the configured logo type for the Pay Later messaging component.
|
856 |
+
*
|
857 |
+
* @since 2.5.0
|
858 |
+
*
|
859 |
+
* @return string
|
860 |
+
*/
|
861 |
+
public function get_pay_later_messaging_logo_type() {
|
862 |
+
|
863 |
+
return $this->get_option( 'pay_later_messaging_logo_type' );
|
864 |
+
}
|
865 |
+
|
866 |
+
|
867 |
+
/**
|
868 |
+
* Gets the configured logo position for the Pay Later messaging component.
|
869 |
+
*
|
870 |
+
* @since 2.5.0
|
871 |
+
*
|
872 |
+
* @return string
|
873 |
+
*/
|
874 |
+
public function get_pay_later_messaging_logo_postion() {
|
875 |
+
|
876 |
+
return $this->get_option( 'pay_later_messaging_logo_position' );
|
877 |
+
}
|
878 |
+
|
879 |
+
|
880 |
+
/**
|
881 |
+
* Gets the configured text color for the Pay Later messaging component.
|
882 |
+
*
|
883 |
+
* @since 2.5.0
|
884 |
+
*
|
885 |
+
* @return string
|
886 |
+
*/
|
887 |
+
public function get_pay_later_messaging_text_color() {
|
888 |
+
|
889 |
+
return $this->get_option( 'pay_later_messaging_text_color' );
|
890 |
+
}
|
891 |
+
|
892 |
+
|
893 |
+
/**
|
894 |
+
* Determines whether PayPal Debit/Credit Card option should be offered to customers.
|
895 |
+
*
|
896 |
+
* The Debit/Credit Card should only be shown if the merchant has not enabled Credit Card via Braintree.
|
897 |
+
*
|
898 |
+
* @since 2.5.0
|
899 |
+
*
|
900 |
+
* @return bool
|
901 |
+
*/
|
902 |
+
public function is_paypal_card_enabled() {
|
903 |
+
|
904 |
+
if ( $credit_card = $this->get_plugin()->get_gateway( WC_Braintree::CREDIT_CARD_GATEWAY_ID ) ) {
|
905 |
+
return ! $credit_card->is_enabled();
|
906 |
+
}
|
907 |
+
|
908 |
+
return true;
|
909 |
+
}
|
910 |
+
|
911 |
+
|
912 |
+
/**
|
913 |
+
* Determines whether the buyer country must be programmatically set or not.
|
914 |
+
*
|
915 |
+
* When this method returns true, the PayPal SDK will force the buyer country param, which
|
916 |
+
* is retrieved automatically by PayPal by default.
|
917 |
+
*
|
918 |
+
* @since 2.5.0
|
919 |
*
|
920 |
* @return bool
|
921 |
*/
|
922 |
+
public function should_force_buyer_country_on_loading_sdk() {
|
923 |
|
924 |
+
$force_buyer_country =
|
925 |
+
defined( 'WP_DEBUG' ) &&
|
926 |
+
WP_DEBUG &&
|
927 |
+
$this->is_test_environment();
|
928 |
+
|
929 |
+
/**
|
930 |
+
* Allows overriding the buyer's country parameter when loading the PayPal SDK.
|
931 |
+
*
|
932 |
+
* This filter must be used for testing purposes only! If it returns true, the PayPal SDK will
|
933 |
+
* load with the buyer country param explicitly declared and picking the logged user's billing country.
|
934 |
+
*
|
935 |
+
* @since 2.5.0
|
936 |
+
*
|
937 |
+
* @param bool $force_buyer_country whether the buyer country will be set programmatically or not
|
938 |
+
* @param WC_Gateway_Braintree_PayPal $this instance
|
939 |
+
*/
|
940 |
+
return apply_filters( 'wc_braintree_should_force_buyer_country_on_loading_sdk', $force_buyer_country, $this );
|
941 |
}
|
942 |
|
943 |
|
980 |
}
|
981 |
|
982 |
|
983 |
+
/**
|
984 |
+
* Add Braintree-specific data to the order prior to processing, currently:
|
985 |
+
*
|
986 |
+
* @since 2.5.0
|
987 |
+
|
988 |
+
* @see SV_WC_Payment_Gateway_Direct::get_order()
|
989 |
+
|
990 |
+
* @param int $order order ID being processed
|
991 |
+
* @return \WC_Order object with payment and transaction information attached
|
992 |
+
*/
|
993 |
+
public function get_order( $order ) {
|
994 |
+
|
995 |
+
$order = parent::get_order( $order );
|
996 |
+
|
997 |
+
// gets the PayPal specific device data
|
998 |
+
$device_data = Framework\SV_WC_Helper::get_posted_value( 'wc_' . wc_braintree()::PAYPAL_GATEWAY_ID . '_device_data' );
|
999 |
+
|
1000 |
+
if ( ! empty( $device_data ) ) {
|
1001 |
+
|
1002 |
+
// fraud tool data as a JSON string, unslashed as WP slashes $_POST data which breaks the JSON
|
1003 |
+
$order->payment->device_data = wp_unslash( $device_data );
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
return $order;
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
|
1010 |
+
/**
|
1011 |
+
* Gets the standard button sizes provided by the original Checkout.js customization options so that we can set the
|
1012 |
+
* height param and container width as expected by the new SDK.
|
1013 |
+
*
|
1014 |
+
* @see https://developer.paypal.com/docs/archive/checkout/how-to/customize-button/#size
|
1015 |
+
* @see https://developer.paypal.com/docs/checkout/integration-features/customize-button
|
1016 |
+
*
|
1017 |
+
* @since 2.5.0
|
1018 |
+
* @return array
|
1019 |
+
*/
|
1020 |
+
public function get_button_sizes() {
|
1021 |
+
|
1022 |
+
return [
|
1023 |
+
'small' => [
|
1024 |
+
'width' => 150,
|
1025 |
+
'height' => 25,
|
1026 |
+
],
|
1027 |
+
'medium' => [
|
1028 |
+
'width' => 250,
|
1029 |
+
'height' => 35,
|
1030 |
+
],
|
1031 |
+
'large' => [
|
1032 |
+
'width' => 350,
|
1033 |
+
'height' => 40,
|
1034 |
+
],
|
1035 |
+
];
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Gets the button height based on the configured button size.
|
1041 |
+
*
|
1042 |
+
* @since 2.5.0
|
1043 |
+
* @param string $size
|
1044 |
+
* @return int|null
|
1045 |
+
*/
|
1046 |
+
public function get_button_height( $size ) {
|
1047 |
+
|
1048 |
+
$button_sizes = $this->get_button_sizes();
|
1049 |
+
|
1050 |
+
return ! empty( $button_sizes[ $size ] ) ? $button_sizes[ $size ]['height'] : null;
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
|
1054 |
+
/**
|
1055 |
+
* Gets the button width based on the configured button size.
|
1056 |
+
*
|
1057 |
+
* @since 2.5.0
|
1058 |
+
* @param string $size
|
1059 |
+
* @return int|null
|
1060 |
+
*/
|
1061 |
+
protected function get_button_width( $size ) {
|
1062 |
+
|
1063 |
+
$button_sizes = $this->get_button_sizes();
|
1064 |
+
|
1065 |
+
return ! empty( $button_sizes[ $size ] ) ? $button_sizes[ $size ]['width'] : null;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
|
1069 |
+
/**
|
1070 |
+
* Gets the style tag for the button container HTML.
|
1071 |
+
*
|
1072 |
+
* @since 2.5.0
|
1073 |
+
* @return string
|
1074 |
+
*/
|
1075 |
+
public function get_button_container_style() {
|
1076 |
+
|
1077 |
+
$container_style = '';
|
1078 |
+
$container_width = $this->get_button_width( $this->get_button_size() );
|
1079 |
+
if ( ! empty( $container_width ) ) {
|
1080 |
+
$container_style = 'style="width:' . $container_width . 'px;"';
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
return $container_style;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
|
1087 |
+
/**
|
1088 |
+
* Gets the style attributes for the Pay Later Messaging container element.
|
1089 |
+
*
|
1090 |
+
* @since 2.5.0
|
1091 |
+
*
|
1092 |
+
* @return string
|
1093 |
+
*/
|
1094 |
+
public function get_pay_later_messaging_style_attributes() {
|
1095 |
+
|
1096 |
+
$attributes = [
|
1097 |
+
'data-pp-style-logo-type' => $this->get_pay_later_messaging_logo_type(),
|
1098 |
+
'data-pp-style-logo-position' => $this->get_pay_later_messaging_logo_postion(),
|
1099 |
+
'data-pp-style-text-color' => $this->get_pay_later_messaging_text_color(),
|
1100 |
+
];
|
1101 |
+
|
1102 |
+
return implode( ' ', array_map( function( $name, $value ) {
|
1103 |
+
return sprintf( '%s="%s"', $name, esc_attr( $value ) );
|
1104 |
+
}, array_keys( $attributes ), array_values( $attributes ) ) );
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
|
1108 |
+
/**
|
1109 |
+
* Gets admin params.
|
1110 |
+
*
|
1111 |
+
* @internal
|
1112 |
+
*
|
1113 |
+
* @since 2.5.0
|
1114 |
+
* @return array
|
1115 |
+
*/
|
1116 |
+
protected function get_admin_params() {
|
1117 |
+
|
1118 |
+
return [
|
1119 |
+
'button_sizes' => $this->get_button_sizes(),
|
1120 |
+
];
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
|
1124 |
+
/**
|
1125 |
+
* Gets the specific settings help text for a given country.
|
1126 |
+
*
|
1127 |
+
* @since 2.5.0
|
1128 |
+
*
|
1129 |
+
* @return string the best help text for the store's country
|
1130 |
+
*/
|
1131 |
+
protected function get_settings_description_text() {
|
1132 |
+
|
1133 |
+
// gets the store base country
|
1134 |
+
$country = WC()->countries->get_base_country();
|
1135 |
+
|
1136 |
+
if ( 'FR' === $country ) {
|
1137 |
+
return __( 'Displays Pay Later messaging for available offers. Vaulted payment/billing agreement integrations and some merchant categories are not eligible to promote Pay in 4X. You may not add additional content, wording, marketing or other material to encourage use. PayPal reserves the right to take action in accordance with the User agreement.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// replaces the United Kingdom country code to UK as accepted by the PayPal learn more link
|
1141 |
+
$country = 'GB' === $country ? 'UK' : $country;
|
1142 |
+
|
1143 |
+
if ( in_array( $country, [ 'US', 'UK', 'DE', 'AU' ] ) ) {
|
1144 |
+
|
1145 |
+
return sprintf(
|
1146 |
+
/** translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag */
|
1147 |
+
__( 'Displays Pay Later messaging for available offers. Restrictions apply. %1$sClick here to learn more.%2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1148 |
+
'<a href="https://developer.paypal.com/docs/commerce-platforms/admin-panel/woocommerce/' . strtolower( $country ) . '/" target="_blank">',
|
1149 |
+
'</a>'
|
1150 |
+
);
|
1151 |
+
}
|
1152 |
+
|
1153 |
+
return '';
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
|
1157 |
+
/**
|
1158 |
+
* Gets the specific client ID for a given country.
|
1159 |
+
*
|
1160 |
+
* @since 2.5.0
|
1161 |
+
*
|
1162 |
+
* @param string $country the country code to determine which client ID to be returned
|
1163 |
+
* @return string the best client ID for the given country
|
1164 |
+
*/
|
1165 |
+
protected function get_sandbox_sdk_client_id( $country ) {
|
1166 |
+
|
1167 |
+
$supported_countries = [
|
1168 |
+
'US' => 'AZ9MoAnROxNajqLdyqq6HOv1_DTLj1UL8Yr0Eav875FQvchaz4Xvqo53UwiQBWuSkfBcQj8PM3JsDU7c',
|
1169 |
+
'GB' => 'AYWNWViebHPcyXNmWe_W2zgXyicRmBpBU3QTs-wFa7I9tfeqYeYz5dShmRnDgE3UTjpzZy-_wEc4lzZE',
|
1170 |
+
'DE' => 'AdowVAtuU8-qDkQ36TGwtopX2Y2w6D3n42gc_w9bBWm2HieWyByc8-ugVHKY-xhESgAKdkLl-7XyHRJu',
|
1171 |
+
'FR' => 'AQX3zTYQapL1f3gomgwDM-5lzHJsGTEQ6-UnAo8cc9QsyweMQOtjE30f5tRuBxbDS9loctREppyZRXXH',
|
1172 |
+
'AU' => 'ATNkCFUvcxbsRysc_yrXH-mbAYlzvXsvayghKp3LPnX4uhgCHkX1MFv1Mj4Z3dYMvVgqeMwlAarYfXjB',
|
1173 |
+
];
|
1174 |
+
|
1175 |
+
// returns the client ID if defined for the country or a default one that will work as a generic client
|
1176 |
+
return isset( $supported_countries[ $country ] ) ? $supported_countries[ $country ] : 'sb';
|
1177 |
+
}
|
1178 |
+
|
1179 |
+
|
1180 |
}
|
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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
@@ -122,10 +122,31 @@ class WC_Gateway_Braintree extends Framework\SV_WC_Payment_Gateway_Direct {
|
|
122 |
if ( $this->get_plugin()->is_plugin_settings() ) {
|
123 |
|
124 |
wp_enqueue_script( 'wc-backbone-modal', null, [ 'backbone' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
}
|
127 |
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
/**
|
130 |
* Loads the plugin configuration settings
|
131 |
*
|
@@ -500,7 +521,7 @@ class WC_Gateway_Braintree extends Framework\SV_WC_Payment_Gateway_Direct {
|
|
500 |
|
501 |
} else {
|
502 |
|
503 |
-
$this->connect_manually =
|
504 |
}
|
505 |
|
506 |
return $form_fields;
|
@@ -1559,4 +1580,17 @@ class WC_Gateway_Braintree extends Framework\SV_WC_Payment_Gateway_Direct {
|
|
1559 |
}
|
1560 |
|
1561 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1562 |
}
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
122 |
if ( $this->get_plugin()->is_plugin_settings() ) {
|
123 |
|
124 |
wp_enqueue_script( 'wc-backbone-modal', null, [ 'backbone' ] );
|
125 |
+
|
126 |
+
wp_enqueue_script( 'wc-braintree-admin', $this->get_plugin()->get_plugin_url() . '/assets/js/admin/wc-braintree.min.js', [ 'jquery' ], $this->get_plugin()->get_version() );
|
127 |
+
|
128 |
+
if ( ! empty( $params = $this->get_admin_params() ) ) {
|
129 |
+
|
130 |
+
wp_localize_script( 'wc-braintree-admin', 'wc_braintree_admin_params', $params );
|
131 |
+
}
|
132 |
}
|
133 |
}
|
134 |
|
135 |
|
136 |
+
/**
|
137 |
+
* Gets admin params.
|
138 |
+
*
|
139 |
+
* @internal
|
140 |
+
*
|
141 |
+
* @since 2.5.0
|
142 |
+
* @return array
|
143 |
+
*/
|
144 |
+
protected function get_admin_params() {
|
145 |
+
|
146 |
+
return [];
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
/**
|
151 |
* Loads the plugin configuration settings
|
152 |
*
|
521 |
|
522 |
} else {
|
523 |
|
524 |
+
$this->connect_manually = 'yes';
|
525 |
}
|
526 |
|
527 |
return $form_fields;
|
1580 |
}
|
1581 |
|
1582 |
|
1583 |
+
/**
|
1584 |
+
* Gets the transaction type for the gateway.
|
1585 |
+
*
|
1586 |
+
* @since 2.5.0
|
1587 |
+
*
|
1588 |
+
* @return string
|
1589 |
+
*/
|
1590 |
+
public function get_transaction_type() {
|
1591 |
+
|
1592 |
+
return $this->get_option( 'transaction_type' );
|
1593 |
+
}
|
1594 |
+
|
1595 |
+
|
1596 |
}
|
includes/class-wc-payment-token-braintree-paypal.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Braintree Gateway
|
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@woocommerce.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 WooCommerce Braintree Gateway to newer
|
16 |
+
* versions in the future. If you wish to customize WooCommerce Braintree Gateway for your
|
17 |
+
* needs please refer to http://docs.woocommerce.com/document/braintree/
|
18 |
+
*
|
19 |
+
* @package WC-Braintree/Gateway
|
20 |
+
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2021, Automattic, Inc.
|
22 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
+
*/
|
24 |
+
|
25 |
+
defined( 'ABSPATH' ) or exit;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* WooCommerce PayPal Payment Token provided by Braintree.
|
29 |
+
*
|
30 |
+
* Representation of a payment token for PayPal accounts.
|
31 |
+
*
|
32 |
+
* @since 2.5.0
|
33 |
+
*/
|
34 |
+
class WC_Payment_Token_Braintree_PayPal extends WC_Payment_Token {
|
35 |
+
|
36 |
+
|
37 |
+
/** @var string Toke Type String */
|
38 |
+
protected $type = 'Braintree_PayPal';
|
39 |
+
|
40 |
+
/** @var array Stores PayPal payment token data */
|
41 |
+
protected $extra_data = [
|
42 |
+
'payer_email' => '',
|
43 |
+
'payer_id' => '',
|
44 |
+
];
|
45 |
+
|
46 |
+
|
47 |
+
}
|
includes/integrations/Pre_Orders.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
|
25 |
namespace WC_Braintree\Integrations;
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
@@ -125,10 +125,11 @@ class Pre_Orders extends Framework\SV_WC_Payment_Gateway_Integration_Pre_Orders
|
|
125 |
|
126 |
$this->get_gateway()->mark_order_as_held( $order, $this->get_gateway()->supports( Framework\SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ? __( 'Authorization only transaction', 'woocommerce-gateway-paypal-powered-by-braintree' ) : $response->get_status_message(), $response );
|
127 |
|
128 |
-
|
129 |
|
|
|
130 |
} else {
|
131 |
-
|
132 |
$order->payment_complete();
|
133 |
}
|
134 |
|
24 |
|
25 |
namespace WC_Braintree\Integrations;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
125 |
|
126 |
$this->get_gateway()->mark_order_as_held( $order, $this->get_gateway()->supports( Framework\SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ? __( 'Authorization only transaction', 'woocommerce-gateway-paypal-powered-by-braintree' ) : $response->get_status_message(), $response );
|
127 |
|
128 |
+
wc_reduce_stock_levels( $order->get_id() );
|
129 |
|
130 |
+
// otherwise complete the order
|
131 |
} else {
|
132 |
+
|
133 |
$order->payment_complete();
|
134 |
}
|
135 |
|
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\
|
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_5 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\
|
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_5 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\
|
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\\
|
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_5 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_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $this->get_gateway()->get_card_types() );
|
192 |
|
193 |
// The Braintree SDK has its own strings for a few card types that we need to match
|
194 |
$types = str_replace( [
|
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\
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
@@ -63,23 +63,28 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
|
|
63 |
|
64 |
$default_button_styles = array(
|
65 |
'label' => 'pay',
|
66 |
-
'size' => $this->get_gateway()->get_button_size(),
|
67 |
'shape' => $this->get_gateway()->get_button_shape(),
|
68 |
'color' => $this->get_gateway()->get_button_color(),
|
69 |
'layout' => 'vertical',
|
70 |
'tagline' => false,
|
71 |
);
|
72 |
|
|
|
|
|
73 |
// tweak the styles a bit for better display on the Add Payment Method page
|
74 |
if ( is_add_payment_method_page() ) {
|
75 |
$default_button_styles['label'] = 'paypal';
|
76 |
-
$
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
* Filters the PayPal button style parameters.
|
81 |
*
|
82 |
-
*
|
83 |
*
|
84 |
* @since 2.1.0
|
85 |
*
|
@@ -92,13 +97,24 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
|
|
92 |
$button_styles['size'] = 'medium';
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
$params = array_merge( $params, [
|
96 |
'is_test_environment' => $this->get_gateway()->is_test_environment(),
|
97 |
-
'
|
|
|
|
|
98 |
'must_login_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
99 |
'must_login_add_method_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
100 |
'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
|
101 |
'cart_payment_nonce' => $this->get_cart_nonce(),
|
|
|
102 |
] );
|
103 |
|
104 |
return $params;
|
@@ -143,6 +159,8 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
|
|
143 |
if ( ! $this->is_checkout_confirmation() ) {
|
144 |
parent::render_payment_form_description();
|
145 |
}
|
|
|
|
|
146 |
}
|
147 |
|
148 |
|
@@ -227,11 +245,17 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
|
|
227 |
|
228 |
parent::render_payment_fields();
|
229 |
|
230 |
-
$order_total
|
|
|
231 |
|
232 |
?>
|
233 |
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
235 |
<input type="hidden" name="wc_braintree_paypal_amount" value="<?php echo esc_attr( Framework\SV_WC_Helper::number_format( $order_total, 2 ) ); ?>" />
|
236 |
<input type="hidden" name="wc_braintree_paypal_currency" value="<?php echo esc_attr( get_woocommerce_currency() ); ?>" />
|
237 |
<input type="hidden" name="wc_braintree_paypal_locale" value="<?php echo esc_attr( $this->get_gateway()->get_safe_locale() ); ?>" />
|
23 |
*/
|
24 |
|
25 |
use WC_Braintree\PayPal\Buttons\Abstract_Button;
|
26 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
63 |
|
64 |
$default_button_styles = array(
|
65 |
'label' => 'pay',
|
|
|
66 |
'shape' => $this->get_gateway()->get_button_shape(),
|
67 |
'color' => $this->get_gateway()->get_button_color(),
|
68 |
'layout' => 'vertical',
|
69 |
'tagline' => false,
|
70 |
);
|
71 |
|
72 |
+
$size = $this->get_gateway()->get_button_size();
|
73 |
+
|
74 |
// tweak the styles a bit for better display on the Add Payment Method page
|
75 |
if ( is_add_payment_method_page() ) {
|
76 |
$default_button_styles['label'] = 'paypal';
|
77 |
+
$size = 'medium';
|
78 |
+
}
|
79 |
+
|
80 |
+
if ( 'responsive' !== $size && ! empty( $button_sizes[ $size ] ) ) {
|
81 |
+
$default_button_styles['height'] = $this->get_gateway()->get_button_height( $size );
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
* Filters the PayPal button style parameters.
|
86 |
*
|
87 |
+
* @see https://developer.paypal.com/docs/checkout/integration-features/customize-button
|
88 |
*
|
89 |
* @since 2.1.0
|
90 |
*
|
97 |
$button_styles['size'] = 'medium';
|
98 |
}
|
99 |
|
100 |
+
if ( isset( $button_styles['size'] ) && ! isset( $button_styles['height'] ) ) {
|
101 |
+
$button_styles['height'] = $this->get_gateway()->get_button_height( $button_styles['size'] );
|
102 |
+
unset( $button_styles['size'] );
|
103 |
+
}
|
104 |
+
|
105 |
+
// allows the buyer country to be forced during the PayPal SDK loading on test environments
|
106 |
+
$force_buyer_country = $this->get_gateway()->should_force_buyer_country_on_loading_sdk() ? get_user_meta( wp_get_current_user()->ID, 'billing_country', true ) : null;
|
107 |
+
|
108 |
$params = array_merge( $params, [
|
109 |
'is_test_environment' => $this->get_gateway()->is_test_environment(),
|
110 |
+
'is_paypal_pay_later_enabled' => $this->get_gateway()->is_paypal_pay_later_enabled(),
|
111 |
+
'is_paypal_card_enabled' => $this->get_gateway()->is_paypal_card_enabled(),
|
112 |
+
'force_buyer_country' => $force_buyer_country,
|
113 |
'must_login_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
114 |
'must_login_add_method_message' => __( 'Please click the "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
115 |
'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
|
116 |
'cart_payment_nonce' => $this->get_cart_nonce(),
|
117 |
+
'paypal_intent' => WC_Gateway_Braintree_PayPal::TRANSACTION_TYPE_AUTHORIZATION === $this->get_gateway()->get_transaction_type() ? 'authorize' : 'capture',
|
118 |
] );
|
119 |
|
120 |
return $params;
|
159 |
if ( ! $this->is_checkout_confirmation() ) {
|
160 |
parent::render_payment_form_description();
|
161 |
}
|
162 |
+
|
163 |
+
?><input type="hidden" id="<?php echo esc_attr( 'wc_' . wc_braintree()::PAYPAL_GATEWAY_ID . '_device_data' ); ?>" name="<?php echo esc_attr( 'wc_' . wc_braintree()::PAYPAL_GATEWAY_ID . '_device_data' ); ?>" /><?php
|
164 |
}
|
165 |
|
166 |
|
245 |
|
246 |
parent::render_payment_fields();
|
247 |
|
248 |
+
$order_total = $this->get_order_total();
|
249 |
+
$container_style = $this->get_gateway()->get_button_container_style();
|
250 |
|
251 |
?>
|
252 |
|
253 |
+
<?php if ( $this->get_gateway()->is_paypal_pay_later_enabled() ) : ?>
|
254 |
+
<div id="wc_braintree_paypal_pay_later_messaging_container" <?php echo $container_style; ?> <?php echo $this->get_gateway()->get_pay_later_messaging_style_attributes(); ?>></div>
|
255 |
+
<?php endif; ?>
|
256 |
+
|
257 |
+
<div id="wc_braintree_paypal_container" <?php echo $container_style; ?>></div>
|
258 |
+
|
259 |
<input type="hidden" name="wc_braintree_paypal_amount" value="<?php echo esc_attr( Framework\SV_WC_Helper::number_format( $order_total, 2 ) ); ?>" />
|
260 |
<input type="hidden" name="wc_braintree_paypal_currency" value="<?php echo esc_attr( get_woocommerce_currency() ); ?>" />
|
261 |
<input type="hidden" name="wc_braintree_paypal_locale" value="<?php echo esc_attr( $this->get_gateway()->get_safe_locale() ); ?>" />
|
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.
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -107,6 +107,12 @@ If not, please get in touch with us through the [plugin forums](https://wordpres
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
= 2020.10.22 - version 2.4.3 =
|
111 |
* Fix - Fix a checkout error that removes the CSC field when a saved payment method is selected and the billing country is changed
|
112 |
|
2 |
Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, dsmithweb, fullysupportedphil, corsonr, zandyring, skyverge
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 5.7
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 2.5.0
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 2021.03.18 - version 2.5.0 =
|
111 |
+
* Feature - Upgrade to the latest Braintree JavaScript SDK and add support to show PayPal Pay Later offers to eligible buyers
|
112 |
+
* Tweak - Add Kount support for US based merchants who are using API keys to connect to Braintree
|
113 |
+
* Misc - Include device data for all customer-initiated PayPal transactions to increase the accuracy of the Advanced Fraud Management Tools in determining when a transaction is fraudulent
|
114 |
+
* Misc - Update the SkyVerge plugin framework to 5.10.5
|
115 |
+
|
116 |
= 2020.10.22 - version 2.4.3 =
|
117 |
* Fix - Fix a checkout error that removes the CSC field when a saved payment method is selected and the billing country is changed
|
118 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2::getLoader();
|
vendor/composer/ClassLoader.php
CHANGED
@@ -60,7 +60,7 @@ class ClassLoader
|
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
-
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
64 |
}
|
65 |
|
66 |
return array();
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
64 |
}
|
65 |
|
66 |
return array();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit4778c71b77d539e115031bbb3e913571
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitc9d19e2245094822df71c6d5f05869e2', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'B' =>
|
@@ -33,9 +33,9 @@ class ComposerStaticInit4778c71b77d539e115031bbb3e913571
|
|
33 |
public static function getInitializer(ClassLoader $loader)
|
34 |
{
|
35 |
return \Closure::bind(function () use ($loader) {
|
36 |
-
$loader->prefixLengthsPsr4 =
|
37 |
-
$loader->prefixDirsPsr4 =
|
38 |
-
$loader->prefixesPsr0 =
|
39 |
|
40 |
}, null, ClassLoader::class);
|
41 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitc9d19e2245094822df71c6d5f05869e2
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'B' =>
|
33 |
public static function getInitializer(ClassLoader $loader)
|
34 |
{
|
35 |
return \Closure::bind(function () use ($loader) {
|
36 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixLengthsPsr4;
|
37 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixDirsPsr4;
|
38 |
+
$loader->prefixesPsr0 = ComposerStaticInitc9d19e2245094822df71c6d5f05869e2::$prefixesPsr0;
|
39 |
|
40 |
}, null, ClassLoader::class);
|
41 |
}
|
vendor/composer/installed.json
CHANGED
@@ -50,28 +50,32 @@
|
|
50 |
},
|
51 |
{
|
52 |
"name": "skyverge/wc-plugin-framework",
|
53 |
-
"version": "5.
|
54 |
-
"version_normalized": "5.
|
55 |
"source": {
|
56 |
"type": "git",
|
57 |
"url": "https://github.com/skyverge/wc-plugin-framework.git",
|
58 |
-
"reference": "
|
59 |
},
|
60 |
"dist": {
|
61 |
"type": "zip",
|
62 |
-
"url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/
|
63 |
-
"reference": "
|
64 |
"shasum": ""
|
65 |
},
|
66 |
"require-dev": {
|
67 |
-
"
|
|
|
|
|
|
|
|
|
68 |
},
|
69 |
-
"time": "
|
70 |
"type": "library",
|
71 |
"installation-source": "dist",
|
72 |
"description": "The official SkyVerge WooCommerce plugin framework",
|
73 |
"support": {
|
74 |
-
"source": "https://github.com/skyverge/wc-plugin-framework/tree/5.
|
75 |
"issues": "https://github.com/skyverge/wc-plugin-framework/issues"
|
76 |
}
|
77 |
}
|
50 |
},
|
51 |
{
|
52 |
"name": "skyverge/wc-plugin-framework",
|
53 |
+
"version": "5.10.5",
|
54 |
+
"version_normalized": "5.10.5.0",
|
55 |
"source": {
|
56 |
"type": "git",
|
57 |
"url": "https://github.com/skyverge/wc-plugin-framework.git",
|
58 |
+
"reference": "fffd186167f39f85b48d20a47cdd10bdc59780a4"
|
59 |
},
|
60 |
"dist": {
|
61 |
"type": "zip",
|
62 |
+
"url": "https://api.github.com/repos/skyverge/wc-plugin-framework/zipball/fffd186167f39f85b48d20a47cdd10bdc59780a4",
|
63 |
+
"reference": "fffd186167f39f85b48d20a47cdd10bdc59780a4",
|
64 |
"shasum": ""
|
65 |
},
|
66 |
"require-dev": {
|
67 |
+
"codeception/module-asserts": "^1.3",
|
68 |
+
"codeception/module-db": "^1.0",
|
69 |
+
"codeception/module-phpbrowser": "^1.0",
|
70 |
+
"lucatume/wp-browser": "3.0.5",
|
71 |
+
"phpcompatibility/php-compatibility": "9.3.5"
|
72 |
},
|
73 |
+
"time": "2021-03-04T14:25:29+00:00",
|
74 |
"type": "library",
|
75 |
"installation-source": "dist",
|
76 |
"description": "The official SkyVerge WooCommerce plugin framework",
|
77 |
"support": {
|
78 |
+
"source": "https://github.com/skyverge/wc-plugin-framework/tree/5.10.5",
|
79 |
"issues": "https://github.com/skyverge/wc-plugin-framework/issues"
|
80 |
}
|
81 |
}
|
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Address.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Addresses;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Addresses\\Address' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/Addresses/Customer_Address.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Addresses;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Addresses\\Customer_Address' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/Country_Helper.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Country_Helper' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/Handlers/Script_Handler.php
CHANGED
@@ -22,14 +22,14 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
32 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
33 |
|
34 |
|
35 |
/**
|
@@ -79,7 +79,7 @@ abstract class Script_Handler {
|
|
79 |
*/
|
80 |
protected function get_js_handler_class_name() {
|
81 |
|
82 |
-
return sprintf( '%
|
83 |
}
|
84 |
|
85 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Handlers;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin_Exception;
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
32 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Handlers\\Script_Handler' ) ) :
|
33 |
|
34 |
|
35 |
/**
|
79 |
*/
|
80 |
protected function get_js_handler_class_name() {
|
81 |
|
82 |
+
return sprintf( '%s_v5_10_5', $this->js_handler_base_class_name );
|
83 |
}
|
84 |
|
85 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/Lifecycle.php
CHANGED
@@ -22,16 +22,16 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
29 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
30 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
31 |
|
32 |
defined( 'ABSPATH' ) or exit;
|
33 |
|
34 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
35 |
|
36 |
|
37 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Plugin;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin\Notes_Helper;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
|
29 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin;
|
30 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Plugin_Compatibility;
|
31 |
|
32 |
defined( 'ABSPATH' ) or exit;
|
33 |
|
34 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Plugin\\Lifecycle' ) ) :
|
35 |
|
36 |
|
37 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Abstract_Settings.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
/**
|
34 |
* The base settings handler.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Abstract_Settings' ) ) :
|
32 |
|
33 |
/**
|
34 |
* The base settings handler.
|
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Control.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
/**
|
34 |
* The base control object.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Control' ) ) :
|
32 |
|
33 |
/**
|
34 |
* The base control object.
|
vendor/skyverge/wc-plugin-framework/woocommerce/Settings_API/Setting.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
/**
|
34 |
* The base setting object.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Settings_API\\Setting' ) ) :
|
32 |
|
33 |
/**
|
34 |
* The base setting object.
|
vendor/skyverge/wc-plugin-framework/woocommerce/admin/Notes_Helper.php
CHANGED
@@ -21,13 +21,13 @@
|
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
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\\
|
31 |
|
32 |
/**
|
33 |
* Helper class for WooCommerce enhanced admin notes.
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin;
|
25 |
|
26 |
use Automattic\WooCommerce\Admin\Notes as WooCommerce_Admin_Notes;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Admin\\Notes_Helper' ) ) :
|
31 |
|
32 |
/**
|
33 |
* Helper class for WooCommerce enhanced admin notes.
|
vendor/skyverge/wc-plugin-framework/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php
CHANGED
@@ -21,13 +21,13 @@
|
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
25 |
|
26 |
defined( 'ABSPATH' ) or exit;
|
27 |
|
28 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
29 |
|
30 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
31 |
|
32 |
|
33 |
/**
|
@@ -323,7 +323,6 @@ abstract class Setup_Wizard {
|
|
323 |
<?php wp_print_scripts( 'wc-setup' ); ?>
|
324 |
<?php do_action( 'admin_print_scripts' ); ?>
|
325 |
<?php do_action( 'admin_print_styles' ); ?>
|
326 |
-
<?php do_action( 'admin_head' ); ?>
|
327 |
</head>
|
328 |
<body class="wc-setup wp-core-ui <?php echo esc_attr( $this->get_slug() ); ?>">
|
329 |
<?php $this->render_header(); ?>
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Admin;
|
25 |
|
26 |
defined( 'ABSPATH' ) or exit;
|
27 |
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Admin\\Setup_Wizard' ) ) :
|
31 |
|
32 |
|
33 |
/**
|
323 |
<?php wp_print_scripts( 'wc-setup' ); ?>
|
324 |
<?php do_action( 'admin_print_scripts' ); ?>
|
325 |
<?php do_action( 'admin_print_styles' ); ?>
|
|
|
326 |
</head>
|
327 |
<body class="wc-setup wp-core-ui <?php echo esc_attr( $this->get_slug() ); ?>">
|
328 |
<?php $this->render_header(); ?>
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-request.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_JSON_Request' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-json-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_JSON_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-request.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_XML_Request' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/abstract-sv-wc-api-xml-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_XML_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-base.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Base' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/class-sv-wc-api-exception.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Exception' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-request.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Request' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/api/interface-sv-wc-api-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/assets/js/admin/sv-wc-plugin-admin-setup-wizard.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function() { "use strict"; /** * WooCommerce Plugin Framework Setup Wizard scripts. * * @since 5.3.0 */ jQuery(
|
1 |
+
(function() { "use strict"; /** * WooCommerce Plugin Framework Setup Wizard scripts. * * @since 5.3.0 */ jQuery(function($) { var blockWizardUI; blockWizardUI = function() { return $('.wc-setup-content').block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }; $('.sv-wc-plugin-admin-setup-control').on('change', '.enable input', function() { if ($(this).is(':checked')) { return $(this).closest('.toggle').removeClass('disabled'); } else { return $(this).closest('.toggle').addClass('disabled'); } }); return $('.sv-wc-plugin-admin-setup-control').on('click', '.enable', function(e) { var $checkbox; if ($(e.target).is('input')) { e.stopPropagation(); return; } $checkbox = $(this).find('input[type="checkbox"]'); return $checkbox.prop('checked', !$checkbox.is(':checked')).change(); }); });}).call(this);
|
vendor/skyverge/wc-plugin-framework/woocommerce/assets/js/admin/sv-wp-admin-job-batch-handler.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
/** * WordPress Batch Job Handler * * @since 4.8.0 */(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; jQuery(
|
1 |
+
/** * WordPress Batch Job Handler * * @since 4.8.0 */(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; jQuery(function($) { 'use strict'; return window.SV_WP_Job_Batch_Handler = (function() { function SV_WP_Job_Batch_Handler(args) { this.process_job = bind(this.process_job, this); this.id = args.id; this.process_nonce = args.process_nonce; this.cancel_nonce = args.cancel_nonce; this.cancelled = false; } SV_WP_Job_Batch_Handler.prototype.process_job = function(job_id) { return new Promise((function(_this) { return function(resolve, reject) { var data; if (_this.cancelled === job_id) { return _this.cancel_job(job_id); } data = { action: _this.id + "_process_batch", security: _this.process_nonce, job_id: job_id }; return $.post(ajaxurl, data).done(function(response) { if (!(response.success && (response.data != null))) { return reject(response); } if (response.data.status !== 'processing') { return resolve(response); } $(document).trigger(_this.id + "_batch_progress_" + response.data.id, { percentage: response.data.percentage, progress: response.data.progress, total: response.data.total }); return resolve(_this.process_job(response.data.id)); }).fail(function(jqXHR, textStatus, error) { return reject(error); }); }; })(this)); }; SV_WP_Job_Batch_Handler.prototype.cancel_job = function(job_id) { return new Promise((function(_this) { return function(resolve, reject) { var data; _this.cancelled = false; data = { action: _this.id + "_cancel_job", security: _this.cancel_nonce, job_id: job_id }; return $.post(ajaxurl, data).done(function(response) { if (!response.success) { return reject(response); } return resolve(response); }).fail(function(jqXHR, textStatus, error) { return reject(error); }); }; })(this)); }; return SV_WP_Job_Batch_Handler; })(); });}).call(this);
|
vendor/skyverge/wc-plugin-framework/woocommerce/changelog.txt
CHANGED
@@ -1,10 +1,46 @@
|
|
1 |
*** SkyVerge WooCommerce Plugin Framework Changelog ***
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
2020.05.15 - version 5.7.1
|
4 |
* Fix - Prevent JavaScript error triggered when different versions of the framework are used at the same time
|
5 |
* Fix - Fix URL for the Configure link in the admin notes shown for payment gateways that are not configured
|
6 |
|
7 |
-
2020.
|
8 |
* Feature - Add a Settings API for easily registering plugin settings for display and REST API handling
|
9 |
* Feature - Introduce a base script handler for enqueueing and loading JavaScript objects
|
10 |
* Tweak - Ensure payment gateway scripts can be used when certain script optimization plugins are delaying load
|
1 |
*** SkyVerge WooCommerce Plugin Framework Changelog ***
|
2 |
|
3 |
+
2021.03.04 - version 5.10.5
|
4 |
+
* Tweak - Add a class representation for Braintree PayPal tokens
|
5 |
+
|
6 |
+
2021.03.01 - version 5.10.4
|
7 |
+
* Fix - Prevent a Fatal error while editing the Checkout page using Elementor
|
8 |
+
|
9 |
+
2020.12.08 - version 5.10.3
|
10 |
+
* Fix - Fix enqueuing token editor JS
|
11 |
+
|
12 |
+
2020.12.03 - version 5.10.2
|
13 |
+
* Misc - Update deprecated jQuery usages
|
14 |
+
|
15 |
+
2020.11.24 - version 5.10.1
|
16 |
+
* Fix - Prevent a deprecated notice for SV_WC_Payment_Gateway_Hosted::do_invalid_transaction_response() in PHP 8
|
17 |
+
* Fix - Prevent PHP Notices and fatal errors on wizard steps
|
18 |
+
|
19 |
+
2020.11.06 - version 5.10.0
|
20 |
+
* Feature - Add Google Pay support
|
21 |
+
* Tweak - Improve multiple gateway settings inheritance to allow for more than two gateways
|
22 |
+
* Tweak - Add admin notices for tax configurations that are incompatible with Apple Pay
|
23 |
+
* Fix - Ensure blank settings inputs aren't added when a base abstract gateway defines shared settings that a child gateway doesn't support
|
24 |
+
|
25 |
+
2020.10.09 - version 5.9.0
|
26 |
+
* Feature - Add helper method to detect whether the current request is a REST API request
|
27 |
+
* Fix - Fix a Capture Charge button issue when adding items to an order
|
28 |
+
* Fix - Harden code to avoid a potential PHP warning at checkout if no card logos are configured for a gateway
|
29 |
+
* Fix - Update Pre-Orders and Subscriptions integrations to use 2 digits expiration years
|
30 |
+
|
31 |
+
2020.07.31 - version 5.8.1
|
32 |
+
* Fix - Ensure that some payment gateway scripts used for handling tokens reference the current version of the Framework
|
33 |
+
|
34 |
+
2020.07.29 - version 5.8.0
|
35 |
+
* Tweak - Migrate payment tokens to be compatible with WooCommerce core payment tokens
|
36 |
+
* Fix - Unblock the UI when removing a token from the admin token editor that was just added but not saved yet
|
37 |
+
* Dev - Deprecate some filter hooks in the payment methods table
|
38 |
+
|
39 |
2020.05.15 - version 5.7.1
|
40 |
* Fix - Prevent JavaScript error triggered when different versions of the framework are used at the same time
|
41 |
* Fix - Fix URL for the Configure link in the admin notes shown for payment gateways that are not configured
|
42 |
|
43 |
+
2020.05.07 - version 5.7.0
|
44 |
* Feature - Add a Settings API for easily registering plugin settings for display and REST API handling
|
45 |
* Feature - Introduce a base script handler for enqueueing and loading JavaScript objects
|
46 |
* Tweak - Ensure payment gateway scripts can be used when certain script optimization plugins are delaying load
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-admin-notice-handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -254,53 +254,56 @@ class SV_WC_Admin_Notice_Handler {
|
|
254 |
self::$admin_notice_js_rendered = true;
|
255 |
|
256 |
ob_start();
|
|
|
257 |
?>
|
|
|
258 |
|
259 |
-
|
260 |
-
|
261 |
|
262 |
-
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
|
269 |
-
|
270 |
|
271 |
-
|
272 |
-
|
273 |
|
274 |
-
|
275 |
|
276 |
-
|
277 |
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
|
283 |
-
|
284 |
|
285 |
-
|
286 |
|
287 |
-
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
297 |
|
298 |
-
|
299 |
-
$( '.js-wc-plugin-framework-admin-notice:hidden' ).insertAfter( '.js-wc-<?php echo esc_js( $plugin_slug ); ?>-admin-notice-placeholder' ).show();
|
300 |
<?php
|
301 |
-
$javascript = ob_get_clean();
|
302 |
|
303 |
-
wc_enqueue_js(
|
304 |
}
|
305 |
|
306 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Admin_Notice_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
254 |
self::$admin_notice_js_rendered = true;
|
255 |
|
256 |
ob_start();
|
257 |
+
|
258 |
?>
|
259 |
+
( function( $ ) {
|
260 |
|
261 |
+
// log dismissed notices
|
262 |
+
$( '.js-wc-plugin-framework-admin-notice' ).on( 'click.wp-dismiss-notice', '.notice-dismiss', function( e ) {
|
263 |
|
264 |
+
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
|
265 |
|
266 |
+
log_dismissed_notice(
|
267 |
+
$( $notice ).data( 'plugin-id' ),
|
268 |
+
$( $notice ).data( 'message-id' )
|
269 |
+
);
|
270 |
|
271 |
+
} );
|
272 |
|
273 |
+
// Log and hide legacy notices
|
274 |
+
$( 'a.js-wc-plugin-framework-notice-dismiss' ).click( function( e ) {
|
275 |
|
276 |
+
e.preventDefault();
|
277 |
|
278 |
+
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
|
279 |
|
280 |
+
log_dismissed_notice(
|
281 |
+
$( $notice ).data( 'plugin-id' ),
|
282 |
+
$( $notice ).data( 'message-id' )
|
283 |
+
);
|
284 |
|
285 |
+
$( $notice ).fadeOut();
|
286 |
|
287 |
+
} );
|
288 |
|
289 |
+
function log_dismissed_notice( pluginID, messageID ) {
|
290 |
|
291 |
+
$.get(
|
292 |
+
ajaxurl,
|
293 |
+
{
|
294 |
+
action: 'wc_plugin_framework_' + pluginID + '_dismiss_notice',
|
295 |
+
messageid: messageID
|
296 |
+
}
|
297 |
+
);
|
298 |
+
}
|
299 |
+
|
300 |
+
// move any delayed notices up into position .show();
|
301 |
+
$( '.js-wc-plugin-framework-admin-notice:hidden' ).insertAfter( '.js-wc-<?php echo esc_js( $plugin_slug ); ?>-admin-notice-placeholder' ).show();
|
302 |
|
303 |
+
} ) ( jQuery );
|
|
|
304 |
<?php
|
|
|
305 |
|
306 |
+
wc_enqueue_js( ob_get_clean() );
|
307 |
}
|
308 |
|
309 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-helper.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
use Automattic\WooCommerce\Admin\Loader;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
|
34 |
/**
|
@@ -548,6 +548,25 @@ class SV_WC_Helper {
|
|
548 |
}
|
549 |
|
550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
/**
|
552 |
* Safely gets and trims data from $_POST.
|
553 |
*
|
@@ -960,6 +979,33 @@ class SV_WC_Helper {
|
|
960 |
}
|
961 |
|
962 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
/**
|
964 |
* Convert a 2-character country code into its 3-character equivalent, or
|
965 |
* vice-versa, e.g.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
use Automattic\WooCommerce\Admin\Loader;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Helper' ) ) :
|
32 |
|
33 |
|
34 |
/**
|
548 |
}
|
549 |
|
550 |
|
551 |
+
/**
|
552 |
+
* Determines if a shop has any published virtual products.
|
553 |
+
*
|
554 |
+
* @since 5.10.0
|
555 |
+
*
|
556 |
+
* @return bool
|
557 |
+
*/
|
558 |
+
public static function shop_has_virtual_products() {
|
559 |
+
|
560 |
+
$virtual_products = wc_get_products( [
|
561 |
+
'virtual' => true,
|
562 |
+
'status' => 'publish',
|
563 |
+
'limit' => 1,
|
564 |
+
] );
|
565 |
+
|
566 |
+
return sizeof( $virtual_products ) > 0;
|
567 |
+
}
|
568 |
+
|
569 |
+
|
570 |
/**
|
571 |
* Safely gets and trims data from $_POST.
|
572 |
*
|
979 |
}
|
980 |
|
981 |
|
982 |
+
/**
|
983 |
+
* Determines if the current request is for a WC REST API endpoint.
|
984 |
+
*
|
985 |
+
* @see \WooCommerce::is_rest_api_request()
|
986 |
+
*
|
987 |
+
* @since 5.9.0
|
988 |
+
*
|
989 |
+
* @return bool
|
990 |
+
*/
|
991 |
+
public static function is_rest_api_request() {
|
992 |
+
|
993 |
+
if ( is_callable( 'WC' ) && is_callable( [ WC(), 'is_rest_api_request' ] ) ) {
|
994 |
+
return (bool) WC()->is_rest_api_request();
|
995 |
+
}
|
996 |
+
|
997 |
+
if ( empty( $_SERVER['REQUEST_URI'] ) || ! function_exists( 'rest_get_url_prefix' ) ) {
|
998 |
+
return false;
|
999 |
+
}
|
1000 |
+
|
1001 |
+
$rest_prefix = trailingslashit( rest_get_url_prefix() );
|
1002 |
+
$is_rest_api_request = false !== strpos( $_SERVER['REQUEST_URI'], $rest_prefix );
|
1003 |
+
|
1004 |
+
/* applies WooCommerce core filter */
|
1005 |
+
return (bool) apply_filters( 'woocommerce_is_rest_api_request', $is_rest_api_request );
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
|
1009 |
/**
|
1010 |
* Convert a 2-character country code into its 3-character equivalent, or
|
1011 |
* vice-versa, e.g.
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-hook-deprecator.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Hook_Deprecator' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-compatibility.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -318,11 +318,13 @@ class SV_WC_Plugin_Compatibility {
|
|
318 |
*
|
319 |
* This checks both for WooCommerce v4.0+ and the underlying package availability.
|
320 |
*
|
|
|
|
|
321 |
* @return bool
|
322 |
*/
|
323 |
public static function is_enhanced_admin_available() {
|
324 |
|
325 |
-
return self::is_wc_version_gte( '4.0' ) && function_exists( 'wc_admin_url' )
|
326 |
}
|
327 |
|
328 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Compatibility' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
318 |
*
|
319 |
* This checks both for WooCommerce v4.0+ and the underlying package availability.
|
320 |
*
|
321 |
+
* @since 5.6.0
|
322 |
+
*
|
323 |
* @return bool
|
324 |
*/
|
325 |
public static function is_enhanced_admin_available() {
|
326 |
|
327 |
+
return self::is_wc_version_gte( '4.0' ) && function_exists( 'wc_admin_url' );
|
328 |
}
|
329 |
|
330 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-dependencies.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Dependencies' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin-exception.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin_Exception' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -37,13 +37,13 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_7_1\\SV_WC_Pl
|
|
37 |
* plugin. This class handles all the "non-feature" support tasks such
|
38 |
* as verifying dependencies are met, loading the text domain, etc.
|
39 |
*
|
40 |
-
* @version 5.
|
41 |
*/
|
42 |
abstract class SV_WC_Plugin {
|
43 |
|
44 |
|
45 |
/** Plugin Framework Version */
|
46 |
-
const VERSION = '5.
|
47 |
|
48 |
/** @var object single instance of plugin */
|
49 |
protected static $instance;
|
@@ -221,7 +221,7 @@ abstract class SV_WC_Plugin {
|
|
221 |
*/
|
222 |
protected function init_hook_deprecator() {
|
223 |
|
224 |
-
$this->hook_deprecator = new SV_WC_Hook_Deprecator( $this->get_plugin_name(), $this->get_deprecated_hooks() );
|
225 |
}
|
226 |
|
227 |
|
@@ -466,8 +466,49 @@ abstract class SV_WC_Plugin {
|
|
466 |
|
467 |
|
468 |
/**
|
469 |
-
*
|
470 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
*
|
472 |
* $old_hook_name = array {
|
473 |
* @type string $version version the hook was deprecated/removed in
|
@@ -477,12 +518,13 @@ abstract class SV_WC_Plugin {
|
|
477 |
* }
|
478 |
*
|
479 |
* @since 4.3.0
|
|
|
480 |
* @return array
|
481 |
*/
|
482 |
protected function get_deprecated_hooks() {
|
483 |
|
484 |
// stub method
|
485 |
-
return
|
486 |
}
|
487 |
|
488 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Plugin' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
37 |
* plugin. This class handles all the "non-feature" support tasks such
|
38 |
* as verifying dependencies are met, loading the text domain, etc.
|
39 |
*
|
40 |
+
* @version 5.8.0
|
41 |
*/
|
42 |
abstract class SV_WC_Plugin {
|
43 |
|
44 |
|
45 |
/** Plugin Framework Version */
|
46 |
+
const VERSION = '5.10.5';
|
47 |
|
48 |
/** @var object single instance of plugin */
|
49 |
protected static $instance;
|
221 |
*/
|
222 |
protected function init_hook_deprecator() {
|
223 |
|
224 |
+
$this->hook_deprecator = new SV_WC_Hook_Deprecator( $this->get_plugin_name(), array_merge( $this->get_framework_deprecated_hooks(), $this->get_deprecated_hooks() ) );
|
225 |
}
|
226 |
|
227 |
|
466 |
|
467 |
|
468 |
/**
|
469 |
+
* Gets a list of framework deprecated/removed hooks.
|
470 |
+
*
|
471 |
+
* @see SV_WC_Plugin::init_hook_deprecator()
|
472 |
+
* @see SV_WC_Plugin::get_deprecated_hooks()
|
473 |
+
*
|
474 |
+
* @since 5.8.0
|
475 |
+
*
|
476 |
+
* @return array associative array
|
477 |
+
*/
|
478 |
+
private function get_framework_deprecated_hooks() {
|
479 |
+
|
480 |
+
$plugin_id = $this->get_id();
|
481 |
+
$deprecated_hooks = [];
|
482 |
+
$deprecated_filters = [
|
483 |
+
/** @see SV_WC_Payment_Gateway_My_Payment_Methods handler - once migrated to WC core tokens UI, we removed these and have no replacement */
|
484 |
+
// TODO: remove deprecated hooks handling by version 6.0.0 or by 2021-02-25 {FN 2020-02-25}
|
485 |
+
"wc_{$plugin_id}_my_payment_methods_table_html",
|
486 |
+
"wc_{$plugin_id}_my_payment_methods_table_head_html",
|
487 |
+
"wc_{$plugin_id}_my_payment_methods_table_title",
|
488 |
+
"wc_{$plugin_id}_my_payment_methods_table_title_html",
|
489 |
+
"wc_{$plugin_id}_my_payment_methods_table_row_html",
|
490 |
+
"wc_{$plugin_id}_my_payment_methods_table_body_html",
|
491 |
+
"wc_{$plugin_id}_my_payment_methods_table_body_row_data",
|
492 |
+
"wc_{$plugin_id}_my_payment_methods_table_method_expiry_html",
|
493 |
+
"wc_{$plugin_id}_my_payment_methods_table_actions_html",
|
494 |
+
];
|
495 |
+
|
496 |
+
foreach ( $deprecated_filters as $deprecated_filter ) {
|
497 |
+
$deprecated_hooks[ $deprecated_filter ] = [
|
498 |
+
'removed' => true,
|
499 |
+
'replacement' => false,
|
500 |
+
'version' => '5.8.1'
|
501 |
+
];
|
502 |
+
}
|
503 |
+
|
504 |
+
return $deprecated_hooks;
|
505 |
+
}
|
506 |
+
|
507 |
+
|
508 |
+
/**
|
509 |
+
* Gets a list of the plugin's deprecated/removed hooks.
|
510 |
+
*
|
511 |
+
* Implementing classes should override this and return an array of deprecated/removed hooks in the following format:
|
512 |
*
|
513 |
* $old_hook_name = array {
|
514 |
* @type string $version version the hook was deprecated/removed in
|
518 |
* }
|
519 |
*
|
520 |
* @since 4.3.0
|
521 |
+
*
|
522 |
* @return array
|
523 |
*/
|
524 |
protected function get_deprecated_hooks() {
|
525 |
|
526 |
// stub method
|
527 |
+
return [];
|
528 |
}
|
529 |
|
530 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wp-admin-message-handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Admin_Message_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Data_Compatibility' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-datetime.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
use DateTimeZone;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
|
34 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
use DateTimeZone;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_DateTime' ) ) :
|
32 |
|
33 |
|
34 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-order-compatibility.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Order_Compatibility' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/compatibility/class-sv-wc-product-compatibility.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Product_Compatibility' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.mo
CHANGED
Binary file
|
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework-et.po
CHANGED
@@ -68,72 +68,72 @@ msgstr ""
|
|
68 |
msgid "%s › Setup"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
72 |
#, fuzzy
|
73 |
msgid "Oops! An error occurred, please try again."
|
74 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
75 |
|
76 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
77 |
msgid "Ready!"
|
78 |
msgstr ""
|
79 |
|
80 |
#. translators: Placeholder: %s - plugin name
|
81 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
82 |
msgid "Welcome to %s!"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
86 |
msgid ""
|
87 |
"This quick setup wizard will help you configure the basic settings and get "
|
88 |
"you started."
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
92 |
msgid "%s is ready!"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
96 |
msgid "Next step"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
100 |
msgid "You can also:"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
104 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
105 |
msgid "View the Docs"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
109 |
msgid "See more setup options"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
113 |
msgid "Learn more about customizing the plugin"
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
117 |
msgid "Review Your Settings"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
121 |
msgid "Leave a Review"
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
125 |
msgid "Continue"
|
126 |
msgstr "Jätka"
|
127 |
|
128 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
129 |
msgid "Return to the WordPress Dashboard"
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
133 |
msgid "Not right now"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
137 |
msgid "Skip this step"
|
138 |
msgstr ""
|
139 |
|
@@ -184,7 +184,7 @@ msgstr "%1$s vajab WooCommerce'i versiooni %2$s või uuemat"
|
|
184 |
msgid "Please %1$supdate WooCommerce%2$s"
|
185 |
msgstr "Palun %1$suuenda WooCommerce'i%2$s"
|
186 |
|
187 |
-
#: class-sv-wc-plugin-compatibility.php:
|
188 |
msgid "WooCommerce"
|
189 |
msgstr ""
|
190 |
|
@@ -256,7 +256,7 @@ 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:
|
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 "
|
@@ -264,23 +264,251 @@ msgid ""
|
|
264 |
msgstr ""
|
265 |
|
266 |
#. translators: Docs as in Documentation
|
267 |
-
#: class-sv-wc-plugin.php:
|
268 |
msgid "Docs"
|
269 |
msgstr "Dokumentatsioon"
|
270 |
|
271 |
-
#: class-sv-wc-plugin.php:
|
272 |
msgid "%1$s - A minimum of %2$s is required."
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: class-sv-wc-plugin.php:
|
276 |
msgid "Set as %1$s - %2$s is required."
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: class-sv-wc-plugin.php:
|
280 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
281 |
msgid "Configure"
|
282 |
msgstr "Seadista"
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:179
|
285 |
#, fuzzy
|
286 |
msgid ""
|
@@ -291,15 +519,15 @@ msgstr ""
|
|
291 |
"meiega ühendust."
|
292 |
|
293 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:217
|
294 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
295 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
296 |
msgid ""
|
297 |
"An error occurred, please try again or try an alternate form of payment."
|
298 |
msgstr "Esines viga, palun proovi uuesti või kasuta teistsugust makseviisi."
|
299 |
|
300 |
#. translators: Placeholders: %s - a WooCommerce order ID
|
301 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
|
302 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
303 |
msgid "Could not find order %s"
|
304 |
msgstr ""
|
305 |
|
@@ -307,47 +535,47 @@ msgstr ""
|
|
307 |
#. translators: Placeholders: %1$s - payment request response status code, %2$s
|
308 |
#. - payment request response status message
|
309 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:152
|
310 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
311 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
312 |
msgid "Status code %1$s: %2$s"
|
313 |
msgstr "Staatuse kood %1$s: %2$s"
|
314 |
|
315 |
#. translators: Placeholders: %s - status code
|
316 |
#. translators: Placeholders: %s - payment request response status code
|
317 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:155
|
318 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
319 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
320 |
msgid "Status code: %s"
|
321 |
msgstr "Staatuse kood: %s"
|
322 |
|
323 |
#. translators: Placeholders; %s - status message
|
324 |
#. translators: Placeholders: %s - payment request response status message
|
325 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:158
|
326 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
327 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
328 |
msgid "Status message: %s"
|
329 |
msgstr "Staatuse teade: %s"
|
330 |
|
331 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:163
|
332 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
333 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
334 |
msgid "Transaction ID %s"
|
335 |
msgstr "Tehingu ID %s"
|
336 |
|
337 |
#. translators: Placeholders: %s - payment gateway title (such as
|
338 |
#. Authorize.net, Braintree, etc)
|
339 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
|
340 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
341 |
msgid "%s duplicate transaction received"
|
342 |
msgstr "%s: duplikaattehing"
|
343 |
|
344 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
|
345 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
346 |
msgid "Order %s is already paid for."
|
347 |
msgstr ""
|
348 |
|
349 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:267
|
350 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
351 |
msgid ""
|
352 |
"Your order has been received and is being reviewed. Thank you for your "
|
353 |
"business."
|
@@ -357,8 +585,8 @@ msgstr ""
|
|
357 |
#. translators: This is a message describing that the transaction in question
|
358 |
#. only performed a credit card authorization and did not capture any funds.
|
359 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:274
|
360 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
361 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
362 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:370
|
363 |
msgid "Authorization only transaction"
|
364 |
msgstr "Autoriseerimise tehing"
|
@@ -407,12 +635,12 @@ msgstr "%1$s: tasumine summas %2$s kinnitatud"
|
|
407 |
|
408 |
#. translators: Placeholders: %s - transaction ID
|
409 |
#: payment-gateway/Handlers/Capture.php:198
|
410 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
411 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
412 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
413 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
414 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
415 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
416 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:353
|
417 |
msgid "(Transaction ID %s)"
|
418 |
msgstr "(Tehingu ID %s)"
|
@@ -473,67 +701,67 @@ msgstr ""
|
|
473 |
msgid "An error occurred. Please try again."
|
474 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
475 |
|
476 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
477 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:305
|
478 |
msgid "(%s)"
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
482 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
483 |
msgid "Default"
|
484 |
msgstr ""
|
485 |
|
486 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
487 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
488 |
msgid "Token ID"
|
489 |
msgstr ""
|
490 |
|
491 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
492 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:300
|
493 |
msgid "Card Type"
|
494 |
msgstr "Kaardi tüüp"
|
495 |
|
496 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
497 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
498 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:192
|
499 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:298
|
500 |
msgid "Last Four"
|
501 |
msgstr "Viimased 4 numbrit"
|
502 |
|
503 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
504 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:358
|
505 |
msgid "Expiration (MM/YY)"
|
506 |
msgstr "Aegub (KK/AA)"
|
507 |
|
508 |
#. translators: e-check account type, HTML form field label
|
509 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
510 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:466
|
511 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
|
512 |
msgid "Account Type"
|
513 |
msgstr "Konto tüüp"
|
514 |
|
515 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
516 |
msgid "Checking"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
520 |
msgid "Savings"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
524 |
msgid "Refresh"
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
528 |
msgid "Add New"
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
532 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
533 |
msgid "Save"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
537 |
msgid "Remove"
|
538 |
msgstr ""
|
539 |
|
@@ -543,7 +771,7 @@ msgid "%s Payment Tokens"
|
|
543 |
msgstr "%s maksevahendid"
|
544 |
|
545 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:302
|
546 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
547 |
msgid "Customer ID"
|
548 |
msgstr "Kliendi ID"
|
549 |
|
@@ -553,7 +781,7 @@ msgstr ""
|
|
553 |
|
554 |
#. translators: environment as in a software environment (test/production)
|
555 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:53
|
556 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
557 |
msgid "Environment"
|
558 |
msgstr "Keskkond"
|
559 |
|
@@ -570,7 +798,7 @@ msgid "Displays whether or not tokenization is enabled for this gateway."
|
|
570 |
msgstr ""
|
571 |
|
572 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:75
|
573 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
574 |
msgid "Debug Mode"
|
575 |
msgstr "Veaotsingu režiim"
|
576 |
|
@@ -587,12 +815,12 @@ msgid "Display at Checkout"
|
|
587 |
msgstr ""
|
588 |
|
589 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:83
|
590 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
591 |
msgid "Save to Log"
|
592 |
msgstr "Salvesta logifaili"
|
593 |
|
594 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:85
|
595 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
596 |
msgid "Off"
|
597 |
msgstr "Välja lülitatud"
|
598 |
|
@@ -624,12 +852,12 @@ msgid "Capture %s"
|
|
624 |
msgstr "Teosta makse"
|
625 |
|
626 |
#: payment-gateway/admin/views/html-order-partial-capture.php:66
|
627 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
628 |
#, fuzzy
|
629 |
msgid "Cancel"
|
630 |
msgstr "Tühista tellimus"
|
631 |
|
632 |
-
#: payment-gateway/admin/views/html-user-payment-token-editor-token.php:
|
633 |
msgid "-- Select an option --"
|
634 |
msgstr ""
|
635 |
|
@@ -643,11 +871,6 @@ msgstr ""
|
|
643 |
"Kasutajale makseviisi poolt määratud kliendi tunnus. Muuda seda ainult siis, "
|
644 |
"kui tõesti vajalik."
|
645 |
|
646 |
-
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:99
|
647 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:186
|
648 |
-
msgid "An error occurred, please try again or try an alternate form of payment"
|
649 |
-
msgstr "Esines viga, palun proovi uuesti või kasuta teistsugust makseviisi"
|
650 |
-
|
651 |
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:100
|
652 |
msgid ""
|
653 |
"We cannot process your order with the payment information that you provided. "
|
@@ -790,166 +1013,6 @@ msgstr ""
|
|
790 |
"Antud aadress ei kattu kaardi omaniku aadressiga. Palun kontrolli, et "
|
791 |
"sisestaid õige aadressi ning proovi uuesti."
|
792 |
|
793 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:84
|
794 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:102
|
795 |
-
msgid "Apple Pay"
|
796 |
-
msgstr ""
|
797 |
-
|
798 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:108
|
799 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1189
|
800 |
-
msgid "Enable / Disable"
|
801 |
-
msgstr "Luba / Keela"
|
802 |
-
|
803 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:109
|
804 |
-
msgid "Accept Apple Pay"
|
805 |
-
msgstr ""
|
806 |
-
|
807 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:116
|
808 |
-
msgid "Allow Apple Pay on"
|
809 |
-
msgstr ""
|
810 |
-
|
811 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:126
|
812 |
-
msgid "Button Style"
|
813 |
-
msgstr ""
|
814 |
-
|
815 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:129
|
816 |
-
msgid "Black"
|
817 |
-
msgstr ""
|
818 |
-
|
819 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:130
|
820 |
-
msgid "White"
|
821 |
-
msgstr ""
|
822 |
-
|
823 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:131
|
824 |
-
msgid "White with outline"
|
825 |
-
msgstr ""
|
826 |
-
|
827 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:143
|
828 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1364
|
829 |
-
msgid "Connection Settings"
|
830 |
-
msgstr ""
|
831 |
-
|
832 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:152
|
833 |
-
msgid "Apple Merchant ID"
|
834 |
-
msgstr ""
|
835 |
-
|
836 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:156
|
837 |
-
msgid "This is found in your %1$sApple developer account%2$s"
|
838 |
-
msgstr ""
|
839 |
-
|
840 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:166
|
841 |
-
msgid "Certificate Path"
|
842 |
-
msgstr ""
|
843 |
-
|
844 |
-
#. translators: Placeholders: %s - the server's web root path
|
845 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:171
|
846 |
-
msgid "For reference, your current web root path is: %s"
|
847 |
-
msgstr ""
|
848 |
-
|
849 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:184
|
850 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:194
|
851 |
-
msgid "Processing Gateway"
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:202
|
855 |
-
#, fuzzy
|
856 |
-
msgid "Test Mode"
|
857 |
-
msgstr "Veaotsingu režiim"
|
858 |
-
|
859 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:203
|
860 |
-
msgid ""
|
861 |
-
"Enable to test Apple Pay functionality throughout your sites without "
|
862 |
-
"processing real payments."
|
863 |
-
msgstr ""
|
864 |
-
|
865 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:312
|
866 |
-
msgid "Your site must be served over HTTPS with a valid SSL certificate."
|
867 |
-
msgstr ""
|
868 |
-
|
869 |
-
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
870 |
-
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
871 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:322
|
872 |
-
msgid ""
|
873 |
-
"Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s "
|
874 |
-
"to enable Apple Pay."
|
875 |
-
msgid_plural ""
|
876 |
-
"Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to accept "
|
877 |
-
"one of %1$s to enable Apple Pay."
|
878 |
-
msgstr[0] ""
|
879 |
-
msgstr[1] ""
|
880 |
-
|
881 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:341
|
882 |
-
msgid ""
|
883 |
-
"Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check "
|
884 |
-
"your path configuration."
|
885 |
-
msgstr ""
|
886 |
-
|
887 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:348
|
888 |
-
msgid "Apple Pay is disabled."
|
889 |
-
msgstr ""
|
890 |
-
|
891 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:387
|
892 |
-
msgid "Single products"
|
893 |
-
msgstr ""
|
894 |
-
|
895 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:388
|
896 |
-
msgid "Cart"
|
897 |
-
msgstr ""
|
898 |
-
|
899 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:389
|
900 |
-
#, fuzzy
|
901 |
-
msgid "Checkout"
|
902 |
-
msgstr "E-tšekk"
|
903 |
-
|
904 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:300
|
905 |
-
msgid "Buy with"
|
906 |
-
msgstr ""
|
907 |
-
|
908 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:333
|
909 |
-
msgid ""
|
910 |
-
"By submitting your payment, you agree to our %1$sterms and conditions%2$s."
|
911 |
-
msgstr ""
|
912 |
-
|
913 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:558
|
914 |
-
msgid "or"
|
915 |
-
msgstr ""
|
916 |
-
|
917 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:123
|
918 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:136
|
919 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:140
|
920 |
-
msgid "Error %d: Unable to create order. Please try again."
|
921 |
-
msgstr ""
|
922 |
-
|
923 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:154
|
924 |
-
msgid "Apple Pay payment authorized."
|
925 |
-
msgstr ""
|
926 |
-
|
927 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:188
|
928 |
-
#, fuzzy
|
929 |
-
msgid "Apple Pay payment failed. %s"
|
930 |
-
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
931 |
-
|
932 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:566
|
933 |
-
msgid "Subtotal"
|
934 |
-
msgstr ""
|
935 |
-
|
936 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:576
|
937 |
-
#, fuzzy
|
938 |
-
msgid "Discount"
|
939 |
-
msgstr "Konto"
|
940 |
-
|
941 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:586
|
942 |
-
msgid "Shipping"
|
943 |
-
msgstr ""
|
944 |
-
|
945 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:596
|
946 |
-
msgid "Fees"
|
947 |
-
msgstr ""
|
948 |
-
|
949 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:606
|
950 |
-
msgid "Taxes"
|
951 |
-
msgstr ""
|
952 |
-
|
953 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:61
|
954 |
msgid ""
|
955 |
"Payment error, please try another payment method or contact us to complete "
|
@@ -958,82 +1021,82 @@ msgstr ""
|
|
958 |
"Viga maksega, palun proovi teistsugust makseviisi või võta meiega ühendust."
|
959 |
|
960 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:161
|
961 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
962 |
msgid "Card expiration date is invalid"
|
963 |
msgstr "Kaardi aegumiskuupäev ei ole korrektne"
|
964 |
|
965 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:185
|
966 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
967 |
msgid "Card number is missing"
|
968 |
msgstr "Kaardi number on puudu"
|
969 |
|
970 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:191
|
971 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
972 |
msgid "Card number is invalid (wrong length)"
|
973 |
msgstr "Kaardi number ei ole korrektne (pikkus on vale)"
|
974 |
|
975 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:196
|
976 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
977 |
msgid "Card number is invalid (only digits allowed)"
|
978 |
msgstr "Kaardi number ei ole korrektne (lubatud on ainult numbrid)"
|
979 |
|
980 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:201
|
981 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
982 |
msgid "Card number is invalid"
|
983 |
msgstr "Kaardi number ei ole korrektne"
|
984 |
|
985 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:228
|
986 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
987 |
msgid "Card security code is invalid (only digits are allowed)"
|
988 |
msgstr "Kaardi turvakood ei ole korrektne (lubatud on ainult numbrid)"
|
989 |
|
990 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:234
|
991 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
992 |
msgid "Card security code is invalid (must be 3 or 4 digits)"
|
993 |
msgstr "Kaardi turvakood ei ole korrektne (peab olema 3 või 4 numbrit)"
|
994 |
|
995 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:240
|
996 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
997 |
msgid "Card security code is missing"
|
998 |
msgstr "Kaardi turvakood on puudu"
|
999 |
|
1000 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:267
|
1001 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1002 |
msgid "Routing Number is missing"
|
1003 |
msgstr "Suunakood on puudu"
|
1004 |
|
1005 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:274
|
1006 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1007 |
msgid "Routing Number is invalid (only digits are allowed)"
|
1008 |
msgstr "Suunakood ei ole korrektne (lubatud on ainult numbrid)"
|
1009 |
|
1010 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:280
|
1011 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1012 |
msgid "Routing number is invalid (must be 9 digits)"
|
1013 |
msgstr "Suunakood ei ole korrektne (peab olemas 9 numbrit)"
|
1014 |
|
1015 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:289
|
1016 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1017 |
msgid "Account Number is missing"
|
1018 |
msgstr "Konto number on puudu"
|
1019 |
|
1020 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:296
|
1021 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1022 |
msgid "Account Number is invalid (only digits are allowed)"
|
1023 |
msgstr "Konto number ei ole korrektne (lubatud on ainult numbrid)"
|
1024 |
|
1025 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:302
|
1026 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1027 |
msgid "Account number is invalid (must be between 5 and 17 digits)"
|
1028 |
msgstr "Konto number ei ole korrektne (peab olemas 5-17 numbrit)"
|
1029 |
|
1030 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:309
|
1031 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1032 |
msgid "Drivers license number is invalid"
|
1033 |
msgstr "Juhiloa number ei ole korrektne"
|
1034 |
|
1035 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:315
|
1036 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1037 |
msgid "Check Number is invalid (only digits are allowed)"
|
1038 |
msgstr "Tšeki number ei ole korrektne (lubatud on ainult numbrid)"
|
1039 |
|
@@ -1050,53 +1113,53 @@ msgstr "Maksevahend kustutatud."
|
|
1050 |
#. translators: Placeholders: %1$s - payment method title, %2$s - payment
|
1051 |
#. account type (savings/checking) (may or may not be available), %3$s - last
|
1052 |
#. four digits of the account
|
1053 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1054 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1055 |
msgid "%1$s Check Transaction Approved: %2$s account ending in %3$s"
|
1056 |
msgstr "%1$s: tšeki tehing vastu võetud: %2$s konto, lõpeb numbritega %3$s"
|
1057 |
|
1058 |
#. translators: Placeholders: %s - check number
|
1059 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1060 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1061 |
msgid "Check number %s"
|
1062 |
msgstr "Tšeki number %s"
|
1063 |
|
1064 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1065 |
#. ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type
|
1066 |
#. (mastercard, visa, ...), %5$s - last four digits of the card
|
1067 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1068 |
#, fuzzy
|
1069 |
msgid "%1$s %2$s %3$s Approved: %4$s ending in %5$s"
|
1070 |
msgstr "%1$s %2$s: %3$s kinnitatud: %4$s lõpeb numbritega %5$s (aegub %6$s)"
|
1071 |
|
1072 |
#. translators: Placeholders: %s - expiry date
|
1073 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1074 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:714
|
1075 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1076 |
msgid "(expires %s)"
|
1077 |
msgstr "(aegub %s)"
|
1078 |
|
1079 |
#. translators: Placeholders: %s - failure message
|
1080 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1081 |
msgid "Tokenization Request Failed: %s"
|
1082 |
msgstr "Maksevahendi salvestamise päring ebaõnnestus: %s"
|
1083 |
|
1084 |
#. translators: Placeholders: %1$s - payment method title, %2$s - failure
|
1085 |
#. message
|
1086 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1087 |
msgid "%1$s Tokenization Request Failed: %2$s"
|
1088 |
msgstr "%1$s: maksevahendi salvestamise päring ebaõnnestus: %2$s"
|
1089 |
|
1090 |
#. translators: Placeholders: %s - failure message. Payment method as in a
|
1091 |
#. specific credit card, e-check or bank account
|
1092 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1093 |
msgid "Oops, adding your new payment method failed: %s"
|
1094 |
msgstr "Oih, sinu maksevahendi lisamine ebaõnnestus: %s"
|
1095 |
|
1096 |
#. translators: Payment method as in a specific credit card. Placeholders: %1$s
|
1097 |
#. - card type (visa, mastercard, ...), %2$s - last four digits of the card,
|
1098 |
#. %3$s - card expiry date
|
1099 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1100 |
msgid "Nice! New payment method added: %1$s ending in %2$s (expires %3$s)"
|
1101 |
msgstr ""
|
1102 |
"Lahe! Uus maksevahend lisatud: %1$s, lõpeb numbritega %2$s (aegub %3$s)"
|
@@ -1104,19 +1167,19 @@ msgstr ""
|
|
1104 |
#. translators: Payment method as in a specific e-check account. Placeholders:
|
1105 |
#. %1$s - account type (checking/savings), %2$s - last four digits of the
|
1106 |
#. account
|
1107 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1108 |
msgid "Nice! New payment method added: %1$s account ending in %2$s"
|
1109 |
msgstr "Lahe! Uus maksevahend lisatud: %1$s konto, lõpeb numbritega %2$s"
|
1110 |
|
1111 |
#. translators: Payment method as in a specific credit card, e-check or bank
|
1112 |
#. account
|
1113 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1114 |
msgid "Nice! New payment method added."
|
1115 |
msgstr "Lahe! Uus maksevahend lisatud."
|
1116 |
|
1117 |
#. translators: Placeholders: %1$s - site title, %2$s - customer email. Payment
|
1118 |
#. method as in a specific credit card, e-check or bank account
|
1119 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1120 |
msgid "%1$s - Add Payment Method for %2$s"
|
1121 |
msgstr "%1$s - Lisa maksevahend kliendile %2$s"
|
1122 |
|
@@ -1140,20 +1203,20 @@ msgstr "Deebet- või krediitkaart"
|
|
1140 |
msgid "Bank Account"
|
1141 |
msgstr "Pangakonto"
|
1142 |
|
1143 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1144 |
msgid "Thank you for your order, please click the button below to pay."
|
1145 |
msgstr "Aitäh tellimuse eest. Palun kliki maksmiseks alloleval nupul."
|
1146 |
|
1147 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1148 |
msgid ""
|
1149 |
"Thank you for your order. We are now redirecting you to complete payment."
|
1150 |
msgstr "Aitäh tellimuse eest. Makse teostamiseks suunatakse sind nüüd edasi."
|
1151 |
|
1152 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1153 |
msgid "Pay Now"
|
1154 |
msgstr "Maksa"
|
1155 |
|
1156 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1157 |
msgid "Cancel Order"
|
1158 |
msgstr "Tühista tellimus"
|
1159 |
|
@@ -1161,8 +1224,8 @@ msgstr "Tühista tellimus"
|
|
1161 |
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
|
1162 |
#. account, etc), %3$s - last four digits of the card/account, %4$s -
|
1163 |
#. card/account expiry date
|
1164 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1165 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1166 |
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
|
1167 |
msgstr ""
|
1168 |
"%1$s: maksevahend salvestatud: %2$s lõpeb numbritega in %3$s (aegub %4$s)"
|
@@ -1170,120 +1233,73 @@ msgstr ""
|
|
1170 |
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
|
1171 |
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
|
1172 |
#. available), %3$s - last four digits of the account
|
1173 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1174 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1175 |
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
|
1176 |
msgstr ""
|
1177 |
"%1$s: e-tšeki maksevahend salvestatud: %2$s konto, lõpeb numbritega %3$s"
|
1178 |
|
1179 |
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
|
1180 |
#. NETbilling, etc)
|
1181 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1182 |
#, fuzzy
|
1183 |
msgid "%s Payment Method Saved"
|
1184 |
msgstr "Minu maksevahendid."
|
1185 |
|
1186 |
#. translators: Placeholders: %s - a failed tokenization API error
|
1187 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1188 |
#, fuzzy
|
1189 |
msgid "Tokenization failed. %s"
|
1190 |
msgstr "Maksevahendi salvestamise päring ebaõnnestus: %s"
|
1191 |
|
1192 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1193 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1194 |
msgid "Edit"
|
1195 |
msgstr ""
|
1196 |
|
1197 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1198 |
#, fuzzy
|
1199 |
msgid ""
|
1200 |
"Oops, there was an error updating your payment method. Please try again."
|
1201 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
1202 |
|
1203 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1204 |
msgid "Are you sure you want to delete this payment method?"
|
1205 |
msgstr "Oled sa kindel, et soovid selle maksevahendi kustutada?"
|
1206 |
|
1207 |
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1208 |
#. account
|
1209 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1210 |
msgid "You do not have any saved payment methods."
|
1211 |
msgstr "Sul ei ole salvestatud maksevahendeid."
|
1212 |
|
1213 |
-
|
1214 |
-
#. account
|
1215 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:416
|
1216 |
-
msgid "My Payment Methods"
|
1217 |
-
msgstr "Minu maksevahendid."
|
1218 |
-
|
1219 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1220 |
-
#. account
|
1221 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:424
|
1222 |
-
msgid "Add New Payment Method"
|
1223 |
-
msgstr "Lisa uus maksevahend"
|
1224 |
-
|
1225 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:512
|
1226 |
-
msgid "Method"
|
1227 |
-
msgstr "Maksevahend"
|
1228 |
-
|
1229 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:513
|
1230 |
-
msgid "Details"
|
1231 |
-
msgstr ""
|
1232 |
-
|
1233 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:514
|
1234 |
-
msgid "Expires"
|
1235 |
-
msgstr "Aegub"
|
1236 |
-
|
1237 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:515
|
1238 |
-
#, fuzzy
|
1239 |
-
msgid "Default?"
|
1240 |
-
msgstr "(vaikimisi)"
|
1241 |
-
|
1242 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:516
|
1243 |
-
msgid "Actions"
|
1244 |
-
msgstr ""
|
1245 |
-
|
1246 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:552
|
1247 |
-
msgid "Credit/Debit Cards"
|
1248 |
-
msgstr "Deebet- ja krediitkaardid"
|
1249 |
-
|
1250 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:561
|
1251 |
-
msgid "Bank Accounts"
|
1252 |
-
msgstr "Pangakontod"
|
1253 |
-
|
1254 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:616
|
1255 |
-
msgid "N/A"
|
1256 |
-
msgstr "-"
|
1257 |
-
|
1258 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:728
|
1259 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:200
|
1260 |
msgid "Nickname"
|
1261 |
msgstr ""
|
1262 |
|
1263 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1264 |
-
msgid "Delete"
|
1265 |
-
msgstr "Kustuta"
|
1266 |
-
|
1267 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1063
|
1268 |
msgid "Oops, you took too long, please try again."
|
1269 |
msgstr "Oih, sul läks liiga kaua aega - palun proovi uuesti."
|
1270 |
|
1271 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1272 |
msgid "There was an error with your request, please try again."
|
1273 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
1274 |
|
1275 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1276 |
-
#. account
|
1277 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1089
|
1278 |
-
msgid "Error removing payment method"
|
1279 |
-
msgstr "Viga maksevahendi eemaldamisel"
|
1280 |
-
|
1281 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1282 |
-
#. account
|
1283 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1094
|
1284 |
-
msgid "Payment method deleted."
|
1285 |
-
msgstr "Maksevahend kustutatud."
|
1286 |
-
|
1287 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:340
|
1288 |
msgid "Card Number"
|
1289 |
msgstr "Kaardi number"
|
@@ -1351,7 +1367,7 @@ msgstr "Maksevahendid"
|
|
1351 |
|
1352 |
#. translators: Placeholders: %1$s - plugin name, %2$s - <a> tag, %3$s - </a>
|
1353 |
#. tag
|
1354 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1355 |
#, fuzzy
|
1356 |
msgid ""
|
1357 |
"%1$s: WooCommerce is not being forced over SSL; your customers' payment data "
|
@@ -1361,7 +1377,7 @@ msgstr ""
|
|
1361 |
"olla ohus."
|
1362 |
|
1363 |
#. translators: Placeholders: %s - payment gateway name
|
1364 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1365 |
msgid ""
|
1366 |
"%s will soon require TLS 1.2 support to process transactions and your server "
|
1367 |
"environment may need to be updated. Please contact your hosting provider to "
|
@@ -1371,7 +1387,7 @@ msgstr ""
|
|
1371 |
|
1372 |
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
1373 |
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
1374 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1375 |
msgid ""
|
1376 |
"%1$s accepts payment in %2$s only. %3$sConfigure%4$s WooCommerce to accept "
|
1377 |
"%2$s to enable this gateway for checkout."
|
@@ -1383,7 +1399,7 @@ msgstr[1] ""
|
|
1383 |
|
1384 |
#. translators: Placeholders: %1$s - payment gateway name, %2$s - opening <a>
|
1385 |
#. tag, %3$s - closing </a> tag
|
1386 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1387 |
msgid ""
|
1388 |
"Heads up! %1$s is currently configured to log transaction data for debugging "
|
1389 |
"purposes. If you are not experiencing any problems with payment processing, "
|
@@ -1391,25 +1407,33 @@ msgid ""
|
|
1391 |
msgstr ""
|
1392 |
|
1393 |
#. translators: Placeholders: %s - gateway name
|
1394 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1395 |
msgid "%s is not configured"
|
1396 |
msgstr ""
|
1397 |
|
1398 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1399 |
msgid "Dismiss"
|
1400 |
msgstr "Loobu"
|
1401 |
|
1402 |
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1403 |
#. tag, %3$s - closing </a> HTML link tag
|
1404 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1405 |
msgid ""
|
1406 |
"Heads up! Apple Pay for %1$s requires WooCommerce version 3.2 or greater. "
|
1407 |
"Please %2$supdate WooCommerce%3$s."
|
1408 |
msgstr ""
|
1409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1410 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1411 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1412 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1413 |
msgid ""
|
1414 |
"%1$s is inactive for subscription transactions. Please %2$senable "
|
1415 |
"tokenization%3$s to activate %1$s for Subscriptions."
|
@@ -1420,7 +1444,7 @@ msgstr ""
|
|
1420 |
|
1421 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1422 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1423 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1424 |
msgid ""
|
1425 |
"%1$s is inactive for pre-order transactions. Please %2$senable tokenization"
|
1426 |
"%3$s to activate %1$s for Pre-Orders."
|
@@ -1429,13 +1453,13 @@ msgstr ""
|
|
1429 |
"maksevahendite salvestamine%3$s sisse, et aktiveerida %1$s Eeltellimuste "
|
1430 |
"(Pre-Orders) jaoks."
|
1431 |
|
1432 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1433 |
msgid ""
|
1434 |
"You must enable tokenization for this gateway in order to support automatic "
|
1435 |
"renewal payments with the WooCommerce Subscriptions extension."
|
1436 |
msgstr ""
|
1437 |
|
1438 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1439 |
msgid "Inactive"
|
1440 |
msgstr ""
|
1441 |
|
@@ -1458,79 +1482,75 @@ msgstr ""
|
|
1458 |
msgid "Expiry Date"
|
1459 |
msgstr "Aegumiskuupäev (01/%s)"
|
1460 |
|
1461 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1462 |
msgid "you successfully processed a payment!"
|
1463 |
msgstr ""
|
1464 |
|
1465 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1466 |
msgid "you successfully processed a refund!"
|
1467 |
msgstr ""
|
1468 |
|
1469 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1470 |
msgid "Check Number is missing"
|
1471 |
msgstr "Tšeki number on puudu"
|
1472 |
|
1473 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1474 |
msgid "Drivers license state is missing"
|
1475 |
msgstr "Juhiloa osariik on puudu"
|
1476 |
|
1477 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1478 |
msgid "Drivers license number is missing"
|
1479 |
msgstr "Juhiloa number on puudu"
|
1480 |
|
1481 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1482 |
msgid "Continue to Payment"
|
1483 |
msgstr ""
|
1484 |
|
1485 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1486 |
msgid "Place order"
|
1487 |
msgstr "Esita tellimus"
|
1488 |
|
1489 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1490 |
msgid "Thank you for your order."
|
1491 |
msgstr "Aitäh tellimuse eest."
|
1492 |
|
1493 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1494 |
msgid "Credit Card"
|
1495 |
msgstr "Krediitkaart"
|
1496 |
|
1497 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1498 |
msgid "eCheck"
|
1499 |
msgstr "E-tšekk"
|
1500 |
|
1501 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1502 |
msgid "Pay securely using your credit card."
|
1503 |
msgstr "Maksa turvaliselt oma krediitkaardiga."
|
1504 |
|
1505 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1506 |
msgid "Pay securely using your checking account."
|
1507 |
msgstr "Maksa turvaliselt oma tšekikontoga."
|
1508 |
|
1509 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1510 |
msgid "Enable this gateway"
|
1511 |
msgstr "Lülita see makseviis sisse"
|
1512 |
|
1513 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1514 |
-
msgid "Title"
|
1515 |
-
msgstr "Nimetus"
|
1516 |
-
|
1517 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1198
|
1518 |
msgid "Payment method title that the customer will see during checkout."
|
1519 |
msgstr "Kliendile kassas nähtav makseviisi nimetus."
|
1520 |
|
1521 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1522 |
msgid "Description"
|
1523 |
msgstr "Kirjeldus"
|
1524 |
|
1525 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1526 |
msgid "Payment method description that the customer will see during checkout."
|
1527 |
msgstr "Kliendile kassas nähtav makseviisi kirjeldus."
|
1528 |
|
1529 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1530 |
msgid "Detailed Decline Messages"
|
1531 |
msgstr "Täpsemad maksest keeldumise teated"
|
1532 |
|
1533 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1534 |
msgid ""
|
1535 |
"Check to enable detailed decline messages to the customer during checkout "
|
1536 |
"when possible, rather than a generic decline message."
|
@@ -1539,7 +1559,7 @@ msgstr ""
|
|
1539 |
"teate asemel näidata võimaluse korral täpsemaid põhjusi."
|
1540 |
|
1541 |
#. translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag
|
1542 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1543 |
msgid ""
|
1544 |
"Show Detailed Error Messages and API requests/responses on the checkout page "
|
1545 |
"and/or save them to the %1$sdebug log%2$s"
|
@@ -1547,90 +1567,90 @@ msgstr ""
|
|
1547 |
"Näita üksikasjalikke veateateud ja API päringuid/vastuseid kassas ja/või "
|
1548 |
"salvesta need %1$slogifaili%2$s"
|
1549 |
|
1550 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1551 |
msgid "Show on Checkout Page"
|
1552 |
msgstr "Näita kassas"
|
1553 |
|
1554 |
#. translators: show debugging information on both checkout page and in the log
|
1555 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1556 |
msgid "Both"
|
1557 |
msgstr "Mõlemad"
|
1558 |
|
1559 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1560 |
msgid "Select the gateway environment to use for transactions."
|
1561 |
msgstr "Vali makseviisi tehingute teostamise keskkond."
|
1562 |
|
1563 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1564 |
msgid "Share connection settings"
|
1565 |
msgstr "Jaga ühenduse andmeid"
|
1566 |
|
1567 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1568 |
msgid "Use connection/authentication settings from other gateway"
|
1569 |
msgstr "Kasuta teise makseviisi ühenduse/autentimise seadeid"
|
1570 |
|
1571 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1572 |
msgid "Disabled because the other gateway is using these settings"
|
1573 |
msgstr "Ei saa muuta, kuna teine makseviis kasutab neid seadeid"
|
1574 |
|
1575 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1576 |
msgid "Card Verification (CSC)"
|
1577 |
msgstr "Kaardi turvakood (CSC)"
|
1578 |
|
1579 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1580 |
msgid "Display the Card Security Code (CV2) field on checkout"
|
1581 |
msgstr "Näita kassas kaardi turvakoodi (CV2) välja"
|
1582 |
|
1583 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1584 |
#, fuzzy
|
1585 |
msgid "Saved Card Verification"
|
1586 |
msgstr "Kaardi turvakood (CSC)"
|
1587 |
|
1588 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1589 |
#, fuzzy
|
1590 |
msgid "Display the Card Security Code field when paying with a saved card"
|
1591 |
msgstr "Näita kassas kaardi turvakoodi (CV2) välja"
|
1592 |
|
1593 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1594 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1595 |
msgid "%1$s - Order %2$s"
|
1596 |
msgstr "%1$s - Tellimus %2$s"
|
1597 |
|
1598 |
#. translators: Placeholders: %1$s - site title, %2$s - order number.
|
1599 |
#. Definitions: Capture as in capture funds from a credit card.
|
1600 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1601 |
msgid "%1$s - Capture for Order %2$s"
|
1602 |
msgstr "%1$s - Tasumine tellimuse %2$s eest"
|
1603 |
|
1604 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1605 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1606 |
msgid "%1$s - Refund for Order %2$s"
|
1607 |
msgstr "%1$s - Tagasimakse tellimuse %2$s eest"
|
1608 |
|
1609 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1610 |
#. Authorize.net, Braintree, etc), %2$s - a monetary amount
|
1611 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1612 |
msgid "%1$s Refund in the amount of %2$s approved."
|
1613 |
msgstr "%1$s: tagasimakse summas %2$s kinnitatud."
|
1614 |
|
1615 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1616 |
#. Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message
|
1617 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1618 |
msgid "%1$s Refund Failed: %2$s - %3$s"
|
1619 |
msgstr "%1$s: tagasimakse ebaõnnestus: %2$s - %3$s"
|
1620 |
|
1621 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1622 |
#. Authorize.net, Braintree, etc), %2$s - error message
|
1623 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1624 |
msgid "%1$s Refund Failed: %2$s"
|
1625 |
msgstr "%1$s: tagasimakse ebaõnnestus: %2$s"
|
1626 |
|
1627 |
#. translators: Placeholders: %s - payment gateway title (such as
|
1628 |
#. Authorize.net, Braintree, etc)
|
1629 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1630 |
msgid "%s Order completely refunded."
|
1631 |
msgstr "%s: tellimus täielikult tagasi makstud."
|
1632 |
|
1633 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1634 |
msgid ""
|
1635 |
"Oops, you cannot partially void this order. Please use the full order amount."
|
1636 |
msgstr ""
|
@@ -1639,58 +1659,58 @@ msgstr ""
|
|
1639 |
|
1640 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error code,
|
1641 |
#. %3$s - error message. Void as in to void an order.
|
1642 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1643 |
msgid "%1$s Void Failed: %2$s - %3$s"
|
1644 |
msgstr "%1$s: tühistamine ebaõnnestus: %2$s - %3$s"
|
1645 |
|
1646 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1647 |
#. message. Void as in to void an order.
|
1648 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1649 |
msgid "%1$s Void Failed: %2$s"
|
1650 |
msgstr "%1$s: tühistamine ebaõnnestus: %2$s"
|
1651 |
|
1652 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary
|
1653 |
#. amount. Void as in to void an order.
|
1654 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1655 |
msgid "%1$s Void in the amount of %2$s approved."
|
1656 |
msgstr "%1$s: tühistamine summas %2$s kinnitatud."
|
1657 |
|
1658 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1659 |
#. ("Test"), %3$s - transaction type (authorization/charge)
|
1660 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1661 |
#, fuzzy
|
1662 |
msgid "%1$s %2$s %3$s Approved"
|
1663 |
msgstr "%1$s: %2$s tehing kinnitatud"
|
1664 |
|
1665 |
#. translators: Placeholders: %1$s - credit card type (MasterCard, Visa,
|
1666 |
#. etc...), %2$s - last four digits of the card
|
1667 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1668 |
msgid "%1$s ending in %2$s"
|
1669 |
msgstr ""
|
1670 |
|
1671 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - message
|
1672 |
#. (probably reason for the transaction being held for review)
|
1673 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1674 |
msgid "%1$s Transaction Held for Review (%2$s)"
|
1675 |
msgstr "%1$s: tehning pandi ülevaatuseks ootele (%2$s)"
|
1676 |
|
1677 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1678 |
#. message; e.g. Order Note: [Payment method] Payment failed [error]
|
1679 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1680 |
msgid "%1$s Payment Failed (%2$s)"
|
1681 |
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
1682 |
|
1683 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s -
|
1684 |
#. message/error
|
1685 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1686 |
msgid "%1$s Transaction Cancelled (%2$s)"
|
1687 |
msgstr "%1$s: tehing tühistatud (%2$s)"
|
1688 |
|
1689 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1690 |
msgid "Transaction Type"
|
1691 |
msgstr "Tehingu tüüp"
|
1692 |
|
1693 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1694 |
msgid ""
|
1695 |
"Select how transactions should be processed. Charge submits all transactions "
|
1696 |
"for settlement, Authorization simply authorizes the order total for capture "
|
@@ -1700,44 +1720,44 @@ msgstr ""
|
|
1700 |
"koheselt tasumisele, \"Autoriseerimine\" lihtsalt autoriseerib tellimuse "
|
1701 |
"summa hilisemaks tasumiseks."
|
1702 |
|
1703 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1704 |
msgid "Charge Virtual-Only Orders"
|
1705 |
msgstr ""
|
1706 |
|
1707 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1708 |
msgid ""
|
1709 |
"If the order contains exclusively virtual items, enable this to immediately "
|
1710 |
"charge, rather than authorize, the transaction."
|
1711 |
msgstr ""
|
1712 |
|
1713 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1714 |
#, fuzzy
|
1715 |
msgid "Enable Partial Capture"
|
1716 |
msgstr "Lülita see makseviis sisse"
|
1717 |
|
1718 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1719 |
msgid "Allow orders to be partially captured multiple times."
|
1720 |
msgstr ""
|
1721 |
|
1722 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1723 |
#, fuzzy
|
1724 |
msgid "Capture Paid Orders"
|
1725 |
msgstr "Teosta makse"
|
1726 |
|
1727 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1728 |
msgid "Automatically capture orders when they are changed to %s."
|
1729 |
msgstr ""
|
1730 |
|
1731 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1732 |
msgid "a paid status"
|
1733 |
msgstr ""
|
1734 |
|
1735 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1736 |
#, fuzzy
|
1737 |
msgid "Accepted Card Logos"
|
1738 |
msgstr "Vastuvõetavad kaardid"
|
1739 |
|
1740 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1741 |
#, fuzzy
|
1742 |
msgid ""
|
1743 |
"These are the card logos that are displayed to customers as accepted during "
|
@@ -1745,7 +1765,7 @@ msgid ""
|
|
1745 |
msgstr "Kliendile kassas nähtav makseviisi nimetus."
|
1746 |
|
1747 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag
|
1748 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1749 |
msgid ""
|
1750 |
"This setting %1$sdoes not%2$s change which card types the gateway will "
|
1751 |
"accept. Accepted cards are configured from your payment processor account."
|
@@ -1754,11 +1774,11 @@ msgstr ""
|
|
1754 |
#. translators:
|
1755 |
#. http:www.cybersource.com/products/payment_security/payment_tokenization/ and
|
1756 |
#. https:en.wikipedia.org/wiki/Tokenization_(data_security)
|
1757 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1758 |
msgid "Tokenization"
|
1759 |
msgstr "Maksevahendite salvestamine"
|
1760 |
|
1761 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1762 |
msgid ""
|
1763 |
"Allow customers to securely save their payment details for future checkout."
|
1764 |
msgstr ""
|
@@ -1767,7 +1787,7 @@ msgstr ""
|
|
1767 |
|
1768 |
#. translators: %1$s - gateway name, %2$s - <a> tag, %3$s - </a> tag, %4$s -
|
1769 |
#. <a> tag, %5$s - </a> tag
|
1770 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1771 |
msgid ""
|
1772 |
"Heads up! %1$s is not fully configured and cannot accept payments. Please "
|
1773 |
"%2$sreview the documentation%3$s and configure the %4$sgateway settings%5$s."
|
@@ -1797,45 +1817,43 @@ msgstr ""
|
|
1797 |
msgid "Pre-Order Release Payment Failed: %s"
|
1798 |
msgstr "Eeltellimuse väljastamise makse ebaõnnestus: %s"
|
1799 |
|
1800 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1801 |
msgid "Subscription Renewal: payment token is missing/invalid."
|
1802 |
msgstr ""
|
1803 |
|
1804 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1805 |
msgid "%1$s - Subscription Renewal Order %2$s"
|
1806 |
msgstr ""
|
1807 |
|
1808 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1809 |
#. message; e.g. Order Note: [Payment method] Payment Change failed [error]
|
1810 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1811 |
#, fuzzy
|
1812 |
msgid "%1$s Payment Change Failed (%2$s)"
|
1813 |
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
1814 |
|
1815 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1816 |
msgid "Via %s ending in %s"
|
1817 |
msgstr ""
|
1818 |
|
1819 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1820 |
msgid "Subscriptions"
|
1821 |
msgstr ""
|
1822 |
|
1823 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1824 |
-
msgid ""
|
1825 |
-
|
1826 |
-
"switch the subscription to another method first."
|
1827 |
-
msgstr ""
|
1828 |
|
1829 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1830 |
msgid "Payment Token"
|
1831 |
msgstr ""
|
1832 |
|
1833 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1834 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1835 |
msgid "%s is required."
|
1836 |
msgstr ""
|
1837 |
|
1838 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1839 |
msgid "Unknown Error"
|
1840 |
msgstr "Esines tundmatu viga"
|
1841 |
|
@@ -1953,52 +1971,52 @@ msgid ""
|
|
1953 |
"loopback connections enabled."
|
1954 |
msgstr ""
|
1955 |
|
1956 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1957 |
msgctxt "enhanced select"
|
1958 |
msgid "No matches found"
|
1959 |
msgstr ""
|
1960 |
|
1961 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1962 |
msgctxt "enhanced select"
|
1963 |
msgid "Loading failed"
|
1964 |
msgstr ""
|
1965 |
|
1966 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1967 |
msgctxt "enhanced select"
|
1968 |
msgid "Please enter 1 or more characters"
|
1969 |
msgstr ""
|
1970 |
|
1971 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1972 |
msgctxt "enhanced select"
|
1973 |
msgid "Please enter %qty% or more characters"
|
1974 |
msgstr ""
|
1975 |
|
1976 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1977 |
msgctxt "enhanced select"
|
1978 |
msgid "Please delete 1 character"
|
1979 |
msgstr ""
|
1980 |
|
1981 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1982 |
msgctxt "enhanced select"
|
1983 |
msgid "Please delete %qty% characters"
|
1984 |
msgstr ""
|
1985 |
|
1986 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1987 |
msgctxt "enhanced select"
|
1988 |
msgid "You can only select 1 item"
|
1989 |
msgstr ""
|
1990 |
|
1991 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1992 |
msgctxt "enhanced select"
|
1993 |
msgid "You can only select %qty% items"
|
1994 |
msgstr ""
|
1995 |
|
1996 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1997 |
msgctxt "enhanced select"
|
1998 |
msgid "Loading more results…"
|
1999 |
msgstr ""
|
2000 |
|
2001 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
2002 |
msgctxt "enhanced select"
|
2003 |
msgid "Searching…"
|
2004 |
msgstr ""
|
@@ -2008,32 +2026,32 @@ msgctxt "coordinating conjunction for a list of items: a, b, and c"
|
|
2008 |
msgid "and"
|
2009 |
msgstr ""
|
2010 |
|
2011 |
-
#: class-sv-wc-plugin.php:
|
2012 |
msgctxt "noun"
|
2013 |
msgid "Support"
|
2014 |
msgstr "Kasutajatugi"
|
2015 |
|
2016 |
-
#: class-sv-wc-plugin.php:
|
2017 |
msgctxt "verb"
|
2018 |
msgid "Review"
|
2019 |
msgstr ""
|
2020 |
|
2021 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
2022 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2023 |
msgctxt "noun, software environment"
|
2024 |
msgid "Test"
|
2025 |
msgstr "test"
|
2026 |
|
2027 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
2028 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2029 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2030 |
msgctxt "credit card transaction type"
|
2031 |
msgid "Authorization"
|
2032 |
msgstr "Autoriseerimine"
|
2033 |
|
2034 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
2035 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2036 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2037 |
msgctxt "noun, credit card transaction type"
|
2038 |
msgid "Charge"
|
2039 |
msgstr "Makse"
|
@@ -2044,19 +2062,19 @@ msgid "Account"
|
|
2044 |
msgstr "Konto"
|
2045 |
|
2046 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:229
|
2047 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2048 |
msgctxt "credit card type"
|
2049 |
msgid "Visa"
|
2050 |
msgstr "Visa"
|
2051 |
|
2052 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:233
|
2053 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2054 |
msgctxt "credit card type"
|
2055 |
msgid "MasterCard"
|
2056 |
msgstr "MasterCard"
|
2057 |
|
2058 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:237
|
2059 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2060 |
msgctxt "credit card type"
|
2061 |
msgid "American Express"
|
2062 |
msgstr "American Express"
|
@@ -2067,13 +2085,13 @@ msgid "Diners Club"
|
|
2067 |
msgstr ""
|
2068 |
|
2069 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:245
|
2070 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2071 |
msgctxt "credit card type"
|
2072 |
msgid "Discover"
|
2073 |
msgstr "Discover"
|
2074 |
|
2075 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:249
|
2076 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2077 |
msgctxt "credit card type"
|
2078 |
msgid "JCB"
|
2079 |
msgstr "JCB"
|
@@ -2093,7 +2111,7 @@ msgctxt "credit card type"
|
|
2093 |
msgid "Laser"
|
2094 |
msgstr ""
|
2095 |
|
2096 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2097 |
msgctxt "credit card type"
|
2098 |
msgid "Diners"
|
2099 |
msgstr "Diners"
|
@@ -2110,17 +2128,17 @@ msgctxt "account type"
|
|
2110 |
msgid "Savings"
|
2111 |
msgstr "Hoiuarve"
|
2112 |
|
2113 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2114 |
msgctxt "hash before order number"
|
2115 |
msgid "#"
|
2116 |
msgstr "#"
|
2117 |
|
2118 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
2119 |
msgctxt "hash before order number"
|
2120 |
msgid "#%s"
|
2121 |
msgstr ""
|
2122 |
|
2123 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2124 |
msgctxt ""
|
2125 |
"coordinating conjunction for a list of order statuses: on-hold, processing, "
|
2126 |
"or completed"
|
@@ -2128,11 +2146,38 @@ msgid "or"
|
|
2128 |
msgstr ""
|
2129 |
|
2130 |
#. translators: https:www.skyverge.com/for-translators-environments/
|
2131 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2132 |
msgctxt "software environment"
|
2133 |
msgid "Production"
|
2134 |
msgstr "Töö/avalik"
|
2135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2136 |
#, fuzzy
|
2137 |
#~ msgid "Pay with"
|
2138 |
#~ msgstr "Maksa"
|
68 |
msgid "%s › Setup"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:350
|
72 |
#, fuzzy
|
73 |
msgid "Oops! An error occurred, please try again."
|
74 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
75 |
|
76 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:488
|
77 |
msgid "Ready!"
|
78 |
msgstr ""
|
79 |
|
80 |
#. translators: Placeholder: %s - plugin name
|
81 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:581
|
82 |
msgid "Welcome to %s!"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:594
|
86 |
msgid ""
|
87 |
"This quick setup wizard will help you configure the basic settings and get "
|
88 |
"you started."
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:608
|
92 |
msgid "%s is ready!"
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:660
|
96 |
msgid "Next step"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:686
|
100 |
msgid "You can also:"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:730
|
104 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:760
|
105 |
msgid "View the Docs"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:731
|
109 |
msgid "See more setup options"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:732
|
113 |
msgid "Learn more about customizing the plugin"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:756
|
117 |
msgid "Review Your Settings"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:764
|
121 |
msgid "Leave a Review"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:788
|
125 |
msgid "Continue"
|
126 |
msgstr "Jätka"
|
127 |
|
128 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:948
|
129 |
msgid "Return to the WordPress Dashboard"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:950
|
133 |
msgid "Not right now"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:952
|
137 |
msgid "Skip this step"
|
138 |
msgstr ""
|
139 |
|
184 |
msgid "Please %1$supdate WooCommerce%2$s"
|
185 |
msgstr "Palun %1$suuenda WooCommerce'i%2$s"
|
186 |
|
187 |
+
#: class-sv-wc-plugin-compatibility.php:349
|
188 |
msgid "WooCommerce"
|
189 |
msgstr ""
|
190 |
|
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 "
|
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"
|
283 |
|
284 |
+
#: payment-gateway/External_Checkout/Admin.php:137
|
285 |
+
#: payment-gateway/External_Checkout/Admin.php:147
|
286 |
+
msgid "Processing Gateway"
|
287 |
+
msgstr ""
|
288 |
+
|
289 |
+
#: payment-gateway/External_Checkout/Admin.php:287
|
290 |
+
msgid "Single products"
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#: payment-gateway/External_Checkout/Admin.php:288
|
294 |
+
msgid "Cart"
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
#: payment-gateway/External_Checkout/Admin.php:289
|
298 |
+
#, fuzzy
|
299 |
+
msgid "Checkout"
|
300 |
+
msgstr "E-tšekk"
|
301 |
+
|
302 |
+
#. translators: Placeholder: %s - external checkout label
|
303 |
+
#: payment-gateway/External_Checkout/Admin.php:330
|
304 |
+
msgid "%s is disabled."
|
305 |
+
msgstr ""
|
306 |
+
|
307 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
308 |
+
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a>
|
309 |
+
#. tag, %5$s - external checkout label
|
310 |
+
#: payment-gateway/External_Checkout/Admin.php:394
|
311 |
+
msgid ""
|
312 |
+
"Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s "
|
313 |
+
"to enable %4$s."
|
314 |
+
msgid_plural ""
|
315 |
+
"Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to accept "
|
316 |
+
"one of %1$s to enable %4$s."
|
317 |
+
msgstr[0] ""
|
318 |
+
msgstr[1] ""
|
319 |
+
|
320 |
+
#: payment-gateway/External_Checkout/Admin.php:436
|
321 |
+
msgid ""
|
322 |
+
"%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the "
|
323 |
+
"shipping address, but %1$s %4$sdoes not%5$s share customer shipping "
|
324 |
+
"information with your store for orders with only virtual products. These "
|
325 |
+
"orders will have their taxes calculated based on the shop address instead."
|
326 |
+
msgstr ""
|
327 |
+
|
328 |
+
#: payment-gateway/External_Checkout/Admin.php:470
|
329 |
+
msgid ""
|
330 |
+
"%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the "
|
331 |
+
"billing address, but %1$s %4$sdoes not%5$s share the customer billing "
|
332 |
+
"address with your store before payment. These orders will have their taxes "
|
333 |
+
"calculated based on the shipping address (or shop address, for orders with "
|
334 |
+
"only virtual products)."
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: payment-gateway/External_Checkout/Frontend.php:259
|
338 |
+
msgid "or"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: payment-gateway/External_Checkout/Frontend.php:293
|
342 |
+
msgid ""
|
343 |
+
"By submitting your payment, you agree to our %1$sterms and conditions%2$s."
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:71
|
347 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:87
|
348 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:66
|
349 |
+
msgid "Google Pay"
|
350 |
+
msgstr ""
|
351 |
+
|
352 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:93
|
353 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:93
|
354 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1262
|
355 |
+
msgid "Enable / Disable"
|
356 |
+
msgstr "Luba / Keela"
|
357 |
+
|
358 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:94
|
359 |
+
msgid "Accept Google Pay"
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:101
|
363 |
+
msgid "Allow Google Pay on"
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:111
|
367 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:111
|
368 |
+
msgid "Button Style"
|
369 |
+
msgstr ""
|
370 |
+
|
371 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:114
|
372 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:114
|
373 |
+
msgid "Black"
|
374 |
+
msgstr ""
|
375 |
+
|
376 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:115
|
377 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:115
|
378 |
+
msgid "White"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:148
|
382 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:150
|
383 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1440
|
384 |
+
msgid "Connection Settings"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:157
|
388 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:188
|
389 |
+
#, fuzzy
|
390 |
+
msgid "Test Mode"
|
391 |
+
msgstr "Veaotsingu režiim"
|
392 |
+
|
393 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:158
|
394 |
+
msgid ""
|
395 |
+
"Enable to test Google Pay functionality throughout your sites without "
|
396 |
+
"processing real payments."
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
#: payment-gateway/External_Checkout/Google_Pay/Frontend.php:130
|
400 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:141
|
401 |
+
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:99
|
402 |
+
msgid "An error occurred, please try again or try an alternate form of payment"
|
403 |
+
msgstr "Esines viga, palun proovi uuesti või kasuta teistsugust makseviisi"
|
404 |
+
|
405 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:255
|
406 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:380
|
407 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:539
|
408 |
+
msgid "Subtotal"
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:390
|
412 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:549
|
413 |
+
#, fuzzy
|
414 |
+
msgid "Discount"
|
415 |
+
msgstr "Konto"
|
416 |
+
|
417 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:400
|
418 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:559
|
419 |
+
msgid "Shipping"
|
420 |
+
msgstr ""
|
421 |
+
|
422 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:410
|
423 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:569
|
424 |
+
msgid "Fees"
|
425 |
+
msgstr ""
|
426 |
+
|
427 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:420
|
428 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:579
|
429 |
+
msgid "Taxes"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:463
|
433 |
+
#, fuzzy
|
434 |
+
msgid "Google Pay payment authorized."
|
435 |
+
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
436 |
+
|
437 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:538
|
438 |
+
#, fuzzy
|
439 |
+
msgid "Google Pay payment failed. %s"
|
440 |
+
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
441 |
+
|
442 |
+
#: payment-gateway/External_Checkout/Orders.php:140
|
443 |
+
#: payment-gateway/External_Checkout/Orders.php:153
|
444 |
+
#: payment-gateway/External_Checkout/Orders.php:157
|
445 |
+
msgid "Error %d: Unable to create order. Please try again."
|
446 |
+
msgstr ""
|
447 |
+
|
448 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:71
|
449 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:87
|
450 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:65
|
451 |
+
msgid "Apple Pay"
|
452 |
+
msgstr ""
|
453 |
+
|
454 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:94
|
455 |
+
msgid "Accept Apple Pay"
|
456 |
+
msgstr ""
|
457 |
+
|
458 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:101
|
459 |
+
msgid "Allow Apple Pay on"
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:116
|
463 |
+
msgid "White with outline"
|
464 |
+
msgstr ""
|
465 |
+
|
466 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:159
|
467 |
+
msgid "Apple Merchant ID"
|
468 |
+
msgstr ""
|
469 |
+
|
470 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:163
|
471 |
+
msgid "This is found in your %1$sApple developer account%2$s"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:173
|
475 |
+
msgid "Certificate Path"
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#. translators: Placeholders: %s - the server's web root path
|
479 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:178
|
480 |
+
msgid "For reference, your current web root path is: %s"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:189
|
484 |
+
msgid ""
|
485 |
+
"Enable to test Apple Pay functionality throughout your sites without "
|
486 |
+
"processing real payments."
|
487 |
+
msgstr ""
|
488 |
+
|
489 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:228
|
490 |
+
msgid "Your site must be served over HTTPS with a valid SSL certificate."
|
491 |
+
msgstr ""
|
492 |
+
|
493 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:238
|
494 |
+
msgid ""
|
495 |
+
"Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check "
|
496 |
+
"your path configuration."
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:176
|
500 |
+
msgid "Buy with"
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:152
|
504 |
+
msgid "Apple Pay payment authorized."
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:186
|
508 |
+
#, fuzzy
|
509 |
+
msgid "Apple Pay payment failed. %s"
|
510 |
+
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
511 |
+
|
512 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:179
|
513 |
#, fuzzy
|
514 |
msgid ""
|
519 |
"meiega ühendust."
|
520 |
|
521 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:217
|
522 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2889
|
523 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:512
|
524 |
msgid ""
|
525 |
"An error occurred, please try again or try an alternate form of payment."
|
526 |
msgstr "Esines viga, palun proovi uuesti või kasuta teistsugust makseviisi."
|
527 |
|
528 |
#. translators: Placeholders: %s - a WooCommerce order ID
|
529 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
|
530 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:449
|
531 |
msgid "Could not find order %s"
|
532 |
msgstr ""
|
533 |
|
535 |
#. translators: Placeholders: %1$s - payment request response status code, %2$s
|
536 |
#. - payment request response status message
|
537 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:152
|
538 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2482
|
539 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:173
|
540 |
msgid "Status code %1$s: %2$s"
|
541 |
msgstr "Staatuse kood %1$s: %2$s"
|
542 |
|
543 |
#. translators: Placeholders: %s - status code
|
544 |
#. translators: Placeholders: %s - payment request response status code
|
545 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:155
|
546 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2485
|
547 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:176
|
548 |
msgid "Status code: %s"
|
549 |
msgstr "Staatuse kood: %s"
|
550 |
|
551 |
#. translators: Placeholders; %s - status message
|
552 |
#. translators: Placeholders: %s - payment request response status message
|
553 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:158
|
554 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2488
|
555 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:179
|
556 |
msgid "Status message: %s"
|
557 |
msgstr "Staatuse teade: %s"
|
558 |
|
559 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:163
|
560 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2493
|
561 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:186
|
562 |
msgid "Transaction ID %s"
|
563 |
msgstr "Tehingu ID %s"
|
564 |
|
565 |
#. translators: Placeholders: %s - payment gateway title (such as
|
566 |
#. Authorize.net, Braintree, etc)
|
567 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
|
568 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:513
|
569 |
msgid "%s duplicate transaction received"
|
570 |
msgstr "%s: duplikaattehing"
|
571 |
|
572 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
|
573 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:516
|
574 |
msgid "Order %s is already paid for."
|
575 |
msgstr ""
|
576 |
|
577 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:267
|
578 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2825
|
579 |
msgid ""
|
580 |
"Your order has been received and is being reviewed. Thank you for your "
|
581 |
"business."
|
585 |
#. translators: This is a message describing that the transaction in question
|
586 |
#. only performed a credit card authorization and did not capture any funds.
|
587 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:274
|
588 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:864
|
589 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1860
|
590 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:370
|
591 |
msgid "Authorization only transaction"
|
592 |
msgstr "Autoriseerimise tehing"
|
635 |
|
636 |
#. translators: Placeholders: %s - transaction ID
|
637 |
#: payment-gateway/Handlers/Capture.php:198
|
638 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:683
|
639 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:768
|
640 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2161
|
641 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2394
|
642 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2706
|
643 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2751
|
644 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:353
|
645 |
msgid "(Transaction ID %s)"
|
646 |
msgstr "(Tehingu ID %s)"
|
701 |
msgid "An error occurred. Please try again."
|
702 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
703 |
|
704 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:491
|
705 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:305
|
706 |
msgid "(%s)"
|
707 |
msgstr ""
|
708 |
|
709 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:521
|
710 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:900
|
711 |
msgid "Default"
|
712 |
msgstr ""
|
713 |
|
714 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:557
|
715 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:590
|
716 |
msgid "Token ID"
|
717 |
msgstr ""
|
718 |
|
719 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:562
|
720 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:300
|
721 |
msgid "Card Type"
|
722 |
msgstr "Kaardi tüüp"
|
723 |
|
724 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:567
|
725 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:603
|
726 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:192
|
727 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:298
|
728 |
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"
|
742 |
|
743 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:598
|
744 |
msgid "Checking"
|
745 |
msgstr ""
|
746 |
|
747 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:599
|
748 |
msgid "Savings"
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:700
|
752 |
msgid "Refresh"
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:702
|
756 |
msgid "Add New"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:705
|
760 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:297
|
761 |
msgid "Save"
|
762 |
msgstr ""
|
763 |
|
764 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:728
|
765 |
msgid "Remove"
|
766 |
msgstr ""
|
767 |
|
771 |
msgstr "%s maksevahendid"
|
772 |
|
773 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:302
|
774 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:841
|
775 |
msgid "Customer ID"
|
776 |
msgstr "Kliendi ID"
|
777 |
|
781 |
|
782 |
#. translators: environment as in a software environment (test/production)
|
783 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:53
|
784 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1389
|
785 |
msgid "Environment"
|
786 |
msgstr "Keskkond"
|
787 |
|
798 |
msgstr ""
|
799 |
|
800 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:75
|
801 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1316
|
802 |
msgid "Debug Mode"
|
803 |
msgstr "Veaotsingu režiim"
|
804 |
|
815 |
msgstr ""
|
816 |
|
817 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:83
|
818 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1324
|
819 |
msgid "Save to Log"
|
820 |
msgstr "Salvesta logifaili"
|
821 |
|
822 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:85
|
823 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1322
|
824 |
msgid "Off"
|
825 |
msgstr "Välja lülitatud"
|
826 |
|
852 |
msgstr "Teosta makse"
|
853 |
|
854 |
#: payment-gateway/admin/views/html-order-partial-capture.php:66
|
855 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:608
|
856 |
#, fuzzy
|
857 |
msgid "Cancel"
|
858 |
msgstr "Tühista tellimus"
|
859 |
|
860 |
+
#: payment-gateway/admin/views/html-user-payment-token-editor-token.php:57
|
861 |
msgid "-- Select an option --"
|
862 |
msgstr ""
|
863 |
|
871 |
"Kasutajale makseviisi poolt määratud kliendi tunnus. Muuda seda ainult siis, "
|
872 |
"kui tõesti vajalik."
|
873 |
|
|
|
|
|
|
|
|
|
|
|
874 |
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:100
|
875 |
msgid ""
|
876 |
"We cannot process your order with the payment information that you provided. "
|
1013 |
"Antud aadress ei kattu kaardi omaniku aadressiga. Palun kontrolli, et "
|
1014 |
"sisestaid õige aadressi ning proovi uuesti."
|
1015 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1016 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:61
|
1017 |
msgid ""
|
1018 |
"Payment error, please try another payment method or contact us to complete "
|
1021 |
"Viga maksega, palun proovi teistsugust makseviisi või võta meiega ühendust."
|
1022 |
|
1023 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:161
|
1024 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:503
|
1025 |
msgid "Card expiration date is invalid"
|
1026 |
msgstr "Kaardi aegumiskuupäev ei ole korrektne"
|
1027 |
|
1028 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:185
|
1029 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:496
|
1030 |
msgid "Card number is missing"
|
1031 |
msgstr "Kaardi number on puudu"
|
1032 |
|
1033 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:191
|
1034 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:499
|
1035 |
msgid "Card number is invalid (wrong length)"
|
1036 |
msgstr "Kaardi number ei ole korrektne (pikkus on vale)"
|
1037 |
|
1038 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:196
|
1039 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:498
|
1040 |
msgid "Card number is invalid (only digits allowed)"
|
1041 |
msgstr "Kaardi number ei ole korrektne (lubatud on ainult numbrid)"
|
1042 |
|
1043 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:201
|
1044 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:497
|
1045 |
msgid "Card number is invalid"
|
1046 |
msgstr "Kaardi number ei ole korrektne"
|
1047 |
|
1048 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:228
|
1049 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:501
|
1050 |
msgid "Card security code is invalid (only digits are allowed)"
|
1051 |
msgstr "Kaardi turvakood ei ole korrektne (lubatud on ainult numbrid)"
|
1052 |
|
1053 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:234
|
1054 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:502
|
1055 |
msgid "Card security code is invalid (must be 3 or 4 digits)"
|
1056 |
msgstr "Kaardi turvakood ei ole korrektne (peab olema 3 või 4 numbrit)"
|
1057 |
|
1058 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:240
|
1059 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:500
|
1060 |
msgid "Card security code is missing"
|
1061 |
msgstr "Kaardi turvakood on puudu"
|
1062 |
|
1063 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:267
|
1064 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:512
|
1065 |
msgid "Routing Number is missing"
|
1066 |
msgstr "Suunakood on puudu"
|
1067 |
|
1068 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:274
|
1069 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:513
|
1070 |
msgid "Routing Number is invalid (only digits are allowed)"
|
1071 |
msgstr "Suunakood ei ole korrektne (lubatud on ainult numbrid)"
|
1072 |
|
1073 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:280
|
1074 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:514
|
1075 |
msgid "Routing number is invalid (must be 9 digits)"
|
1076 |
msgstr "Suunakood ei ole korrektne (peab olemas 9 numbrit)"
|
1077 |
|
1078 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:289
|
1079 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:509
|
1080 |
msgid "Account Number is missing"
|
1081 |
msgstr "Konto number on puudu"
|
1082 |
|
1083 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:296
|
1084 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:510
|
1085 |
msgid "Account Number is invalid (only digits are allowed)"
|
1086 |
msgstr "Konto number ei ole korrektne (lubatud on ainult numbrid)"
|
1087 |
|
1088 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:302
|
1089 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:511
|
1090 |
msgid "Account number is invalid (must be between 5 and 17 digits)"
|
1091 |
msgstr "Konto number ei ole korrektne (peab olemas 5-17 numbrit)"
|
1092 |
|
1093 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:309
|
1094 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:508
|
1095 |
msgid "Drivers license number is invalid"
|
1096 |
msgstr "Juhiloa number ei ole korrektne"
|
1097 |
|
1098 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:315
|
1099 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:504
|
1100 |
msgid "Check Number is invalid (only digits are allowed)"
|
1101 |
msgstr "Tšeki number ei ole korrektne (lubatud on ainult numbrid)"
|
1102 |
|
1113 |
#. translators: Placeholders: %1$s - payment method title, %2$s - payment
|
1114 |
#. account type (savings/checking) (may or may not be available), %3$s - last
|
1115 |
#. four digits of the account
|
1116 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:673
|
1117 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2741
|
1118 |
msgid "%1$s Check Transaction Approved: %2$s account ending in %3$s"
|
1119 |
msgstr "%1$s: tšeki tehing vastu võetud: %2$s konto, lõpeb numbritega %3$s"
|
1120 |
|
1121 |
#. translators: Placeholders: %s - check number
|
1122 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:678
|
1123 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2746
|
1124 |
msgid "Check number %s"
|
1125 |
msgstr "Tšeki number %s"
|
1126 |
|
1127 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1128 |
#. ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type
|
1129 |
#. (mastercard, visa, ...), %5$s - last four digits of the card
|
1130 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:747
|
1131 |
#, fuzzy
|
1132 |
msgid "%1$s %2$s %3$s Approved: %4$s ending in %5$s"
|
1133 |
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)"
|
1141 |
|
1142 |
#. translators: Placeholders: %s - failure message
|
1143 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:832
|
1144 |
msgid "Tokenization Request Failed: %s"
|
1145 |
msgstr "Maksevahendi salvestamise päring ebaõnnestus: %s"
|
1146 |
|
1147 |
#. translators: Placeholders: %1$s - payment method title, %2$s - failure
|
1148 |
#. message
|
1149 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:843
|
1150 |
msgid "%1$s Tokenization Request Failed: %2$s"
|
1151 |
msgstr "%1$s: maksevahendi salvestamise päring ebaõnnestus: %2$s"
|
1152 |
|
1153 |
#. translators: Placeholders: %s - failure message. Payment method as in a
|
1154 |
#. specific credit card, e-check or bank account
|
1155 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:901
|
1156 |
msgid "Oops, adding your new payment method failed: %s"
|
1157 |
msgstr "Oih, sinu maksevahendi lisamine ebaõnnestus: %s"
|
1158 |
|
1159 |
#. translators: Payment method as in a specific credit card. Placeholders: %1$s
|
1160 |
#. - card type (visa, mastercard, ...), %2$s - last four digits of the card,
|
1161 |
#. %3$s - card expiry date
|
1162 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:946
|
1163 |
msgid "Nice! New payment method added: %1$s ending in %2$s (expires %3$s)"
|
1164 |
msgstr ""
|
1165 |
"Lahe! Uus maksevahend lisatud: %1$s, lõpeb numbritega %2$s (aegub %3$s)"
|
1167 |
#. translators: Payment method as in a specific e-check account. Placeholders:
|
1168 |
#. %1$s - account type (checking/savings), %2$s - last four digits of the
|
1169 |
#. account
|
1170 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:956
|
1171 |
msgid "Nice! New payment method added: %1$s account ending in %2$s"
|
1172 |
msgstr "Lahe! Uus maksevahend lisatud: %1$s konto, lõpeb numbritega %2$s"
|
1173 |
|
1174 |
#. translators: Payment method as in a specific credit card, e-check or bank
|
1175 |
#. account
|
1176 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:963
|
1177 |
msgid "Nice! New payment method added."
|
1178 |
msgstr "Lahe! Uus maksevahend lisatud."
|
1179 |
|
1180 |
#. translators: Placeholders: %1$s - site title, %2$s - customer email. Payment
|
1181 |
#. method as in a specific credit card, e-check or bank account
|
1182 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:1086
|
1183 |
msgid "%1$s - Add Payment Method for %2$s"
|
1184 |
msgstr "%1$s - Lisa maksevahend kliendile %2$s"
|
1185 |
|
1203 |
msgid "Bank Account"
|
1204 |
msgstr "Pangakonto"
|
1205 |
|
1206 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:301
|
1207 |
msgid "Thank you for your order, please click the button below to pay."
|
1208 |
msgstr "Aitäh tellimuse eest. Palun kliki maksmiseks alloleval nupul."
|
1209 |
|
1210 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:302
|
1211 |
msgid ""
|
1212 |
"Thank you for your order. We are now redirecting you to complete payment."
|
1213 |
msgstr "Aitäh tellimuse eest. Makse teostamiseks suunatakse sind nüüd edasi."
|
1214 |
|
1215 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:303
|
1216 |
msgid "Pay Now"
|
1217 |
msgstr "Maksa"
|
1218 |
|
1219 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:304
|
1220 |
msgid "Cancel Order"
|
1221 |
msgstr "Tühista tellimus"
|
1222 |
|
1224 |
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
|
1225 |
#. account, etc), %3$s - last four digits of the card/account, %4$s -
|
1226 |
#. card/account expiry date
|
1227 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:601
|
1228 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1115
|
1229 |
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
|
1230 |
msgstr ""
|
1231 |
"%1$s: maksevahend salvestatud: %2$s lõpeb numbritega in %3$s (aegub %4$s)"
|
1233 |
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
|
1234 |
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
|
1235 |
#. available), %3$s - last four digits of the account
|
1236 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:612
|
1237 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1126
|
1238 |
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
|
1239 |
msgstr ""
|
1240 |
"%1$s: e-tšeki maksevahend salvestatud: %2$s konto, lõpeb numbritega %3$s"
|
1241 |
|
1242 |
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
|
1243 |
#. NETbilling, etc)
|
1244 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:621
|
1245 |
#, fuzzy
|
1246 |
msgid "%s Payment Method Saved"
|
1247 |
msgstr "Minu maksevahendid."
|
1248 |
|
1249 |
#. translators: Placeholders: %s - a failed tokenization API error
|
1250 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:630
|
1251 |
#, fuzzy
|
1252 |
msgid "Tokenization failed. %s"
|
1253 |
msgstr "Maksevahendi salvestamise päring ebaõnnestus: %s"
|
1254 |
|
1255 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:293
|
1256 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:607
|
1257 |
msgid "Edit"
|
1258 |
msgstr ""
|
1259 |
|
1260 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:337
|
1261 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1269
|
1262 |
+
msgid "Title"
|
1263 |
+
msgstr "Nimetus"
|
1264 |
+
|
1265 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:340
|
1266 |
+
msgid "Details"
|
1267 |
+
msgstr ""
|
1268 |
+
|
1269 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:343
|
1270 |
+
#, fuzzy
|
1271 |
+
msgid "Default?"
|
1272 |
+
msgstr "(vaikimisi)"
|
1273 |
+
|
1274 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:609
|
1275 |
#, fuzzy
|
1276 |
msgid ""
|
1277 |
"Oops, there was an error updating your payment method. Please try again."
|
1278 |
msgstr "Sinu päringuga esines viga, palun proovi uuesti."
|
1279 |
|
1280 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:610
|
1281 |
msgid "Are you sure you want to delete this payment method?"
|
1282 |
msgstr "Oled sa kindel, et soovid selle maksevahendi kustutada?"
|
1283 |
|
1284 |
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1285 |
#. account
|
1286 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:697
|
1287 |
msgid "You do not have any saved payment methods."
|
1288 |
msgstr "Sul ei ole salvestatud maksevahendeid."
|
1289 |
|
1290 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1291 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:200
|
1292 |
msgid "Nickname"
|
1293 |
msgstr ""
|
1294 |
|
1295 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1118
|
|
|
|
|
|
|
|
|
1296 |
msgid "Oops, you took too long, please try again."
|
1297 |
msgstr "Oih, sul läks liiga kaua aega - palun proovi uuesti."
|
1298 |
|
1299 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1129
|
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"
|
1367 |
|
1368 |
#. translators: Placeholders: %1$s - plugin name, %2$s - <a> tag, %3$s - </a>
|
1369 |
#. tag
|
1370 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:706
|
1371 |
#, fuzzy
|
1372 |
msgid ""
|
1373 |
"%1$s: WooCommerce is not being forced over SSL; your customers' payment data "
|
1377 |
"olla ohus."
|
1378 |
|
1379 |
#. translators: Placeholders: %s - payment gateway name
|
1380 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:723
|
1381 |
msgid ""
|
1382 |
"%s will soon require TLS 1.2 support to process transactions and your server "
|
1383 |
"environment may need to be updated. Please contact your hosting provider to "
|
1387 |
|
1388 |
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
1389 |
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
1390 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:779
|
1391 |
msgid ""
|
1392 |
"%1$s accepts payment in %2$s only. %3$sConfigure%4$s WooCommerce to accept "
|
1393 |
"%2$s to enable this gateway for checkout."
|
1399 |
|
1400 |
#. translators: Placeholders: %1$s - payment gateway name, %2$s - opening <a>
|
1401 |
#. tag, %3$s - closing </a> tag
|
1402 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:814
|
1403 |
msgid ""
|
1404 |
"Heads up! %1$s is currently configured to log transaction data for debugging "
|
1405 |
"purposes. If you are not experiencing any problems with payment processing, "
|
1407 |
msgstr ""
|
1408 |
|
1409 |
#. translators: Placeholders: %s - gateway name
|
1410 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:865
|
1411 |
msgid "%s is not configured"
|
1412 |
msgstr ""
|
1413 |
|
1414 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:877
|
1415 |
msgid "Dismiss"
|
1416 |
msgstr "Loobu"
|
1417 |
|
1418 |
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1419 |
#. tag, %3$s - closing </a> HTML link tag
|
1420 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:914
|
1421 |
msgid ""
|
1422 |
"Heads up! Apple Pay for %1$s requires WooCommerce version 3.2 or greater. "
|
1423 |
"Please %2$supdate WooCommerce%3$s."
|
1424 |
msgstr ""
|
1425 |
|
1426 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1427 |
+
#. tag, %3$s - closing </a> HTML link tag
|
1428 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:938
|
1429 |
+
msgid ""
|
1430 |
+
"Heads up! Google Pay for %1$s requires WooCommerce version 3.2 or greater. "
|
1431 |
+
"Please %2$supdate WooCommerce%3$s."
|
1432 |
+
msgstr ""
|
1433 |
+
|
1434 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1435 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1436 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:974
|
1437 |
msgid ""
|
1438 |
"%1$s is inactive for subscription transactions. Please %2$senable "
|
1439 |
"tokenization%3$s to activate %1$s for Subscriptions."
|
1444 |
|
1445 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1446 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1447 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:992
|
1448 |
msgid ""
|
1449 |
"%1$s is inactive for pre-order transactions. Please %2$senable tokenization"
|
1450 |
"%3$s to activate %1$s for Pre-Orders."
|
1453 |
"maksevahendite salvestamine%3$s sisse, et aktiveerida %1$s Eeltellimuste "
|
1454 |
"(Pre-Orders) jaoks."
|
1455 |
|
1456 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:1029
|
1457 |
msgid ""
|
1458 |
"You must enable tokenization for this gateway in order to support automatic "
|
1459 |
"renewal payments with the WooCommerce Subscriptions extension."
|
1460 |
msgstr ""
|
1461 |
|
1462 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:1030
|
1463 |
msgid "Inactive"
|
1464 |
msgstr ""
|
1465 |
|
1482 |
msgid "Expiry Date"
|
1483 |
msgstr "Aegumiskuupäev (01/%s)"
|
1484 |
|
1485 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:350
|
1486 |
msgid "you successfully processed a payment!"
|
1487 |
msgstr ""
|
1488 |
|
1489 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:355
|
1490 |
msgid "you successfully processed a refund!"
|
1491 |
msgstr ""
|
1492 |
|
1493 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:505
|
1494 |
msgid "Check Number is missing"
|
1495 |
msgstr "Tšeki number on puudu"
|
1496 |
|
1497 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:506
|
1498 |
msgid "Drivers license state is missing"
|
1499 |
msgstr "Juhiloa osariik on puudu"
|
1500 |
|
1501 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:507
|
1502 |
msgid "Drivers license number is missing"
|
1503 |
msgstr "Juhiloa number on puudu"
|
1504 |
|
1505 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:720
|
1506 |
msgid "Continue to Payment"
|
1507 |
msgstr ""
|
1508 |
|
1509 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:720
|
1510 |
msgid "Place order"
|
1511 |
msgstr "Esita tellimus"
|
1512 |
|
1513 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:752
|
1514 |
msgid "Thank you for your order."
|
1515 |
msgstr "Aitäh tellimuse eest."
|
1516 |
|
1517 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1221
|
1518 |
msgid "Credit Card"
|
1519 |
msgstr "Krediitkaart"
|
1520 |
|
1521 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1223
|
1522 |
msgid "eCheck"
|
1523 |
msgstr "E-tšekk"
|
1524 |
|
1525 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1241
|
1526 |
msgid "Pay securely using your credit card."
|
1527 |
msgstr "Maksa turvaliselt oma krediitkaardiga."
|
1528 |
|
1529 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1243
|
1530 |
msgid "Pay securely using your checking account."
|
1531 |
msgstr "Maksa turvaliselt oma tšekikontoga."
|
1532 |
|
1533 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1263
|
1534 |
msgid "Enable this gateway"
|
1535 |
msgstr "Lülita see makseviis sisse"
|
1536 |
|
1537 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1271
|
|
|
|
|
|
|
|
|
1538 |
msgid "Payment method title that the customer will see during checkout."
|
1539 |
msgstr "Kliendile kassas nähtav makseviisi nimetus."
|
1540 |
|
1541 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1276
|
1542 |
msgid "Description"
|
1543 |
msgstr "Kirjeldus"
|
1544 |
|
1545 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1278
|
1546 |
msgid "Payment method description that the customer will see during checkout."
|
1547 |
msgstr "Kliendile kassas nähtav makseviisi kirjeldus."
|
1548 |
|
1549 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1307
|
1550 |
msgid "Detailed Decline Messages"
|
1551 |
msgstr "Täpsemad maksest keeldumise teated"
|
1552 |
|
1553 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1309
|
1554 |
msgid ""
|
1555 |
"Check to enable detailed decline messages to the customer during checkout "
|
1556 |
"when possible, rather than a generic decline message."
|
1559 |
"teate asemel näidata võimaluse korral täpsemaid põhjusi."
|
1560 |
|
1561 |
#. translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag
|
1562 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1319
|
1563 |
msgid ""
|
1564 |
"Show Detailed Error Messages and API requests/responses on the checkout page "
|
1565 |
"and/or save them to the %1$sdebug log%2$s"
|
1567 |
"Näita üksikasjalikke veateateud ja API päringuid/vastuseid kassas ja/või "
|
1568 |
"salvesta need %1$slogifaili%2$s"
|
1569 |
|
1570 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1323
|
1571 |
msgid "Show on Checkout Page"
|
1572 |
msgstr "Näita kassas"
|
1573 |
|
1574 |
#. translators: show debugging information on both checkout page and in the log
|
1575 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1326
|
1576 |
msgid "Both"
|
1577 |
msgstr "Mõlemad"
|
1578 |
|
1579 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1392
|
1580 |
msgid "Select the gateway environment to use for transactions."
|
1581 |
msgstr "Vali makseviisi tehingute teostamise keskkond."
|
1582 |
|
1583 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1446
|
1584 |
msgid "Share connection settings"
|
1585 |
msgstr "Jaga ühenduse andmeid"
|
1586 |
|
1587 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1448
|
1588 |
msgid "Use connection/authentication settings from other gateway"
|
1589 |
msgstr "Kasuta teise makseviisi ühenduse/autentimise seadeid"
|
1590 |
|
1591 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1451
|
1592 |
msgid "Disabled because the other gateway is using these settings"
|
1593 |
msgstr "Ei saa muuta, kuna teine makseviis kasutab neid seadeid"
|
1594 |
|
1595 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1468
|
1596 |
msgid "Card Verification (CSC)"
|
1597 |
msgstr "Kaardi turvakood (CSC)"
|
1598 |
|
1599 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1469
|
1600 |
msgid "Display the Card Security Code (CV2) field on checkout"
|
1601 |
msgstr "Näita kassas kaardi turvakoodi (CV2) välja"
|
1602 |
|
1603 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1477
|
1604 |
#, fuzzy
|
1605 |
msgid "Saved Card Verification"
|
1606 |
msgstr "Kaardi turvakood (CSC)"
|
1607 |
|
1608 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1478
|
1609 |
#, fuzzy
|
1610 |
msgid "Display the Card Security Code field when paying with a saved card"
|
1611 |
msgstr "Näita kassas kaardi turvakoodi (CV2) välja"
|
1612 |
|
1613 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1614 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1813
|
1615 |
msgid "%1$s - Order %2$s"
|
1616 |
msgstr "%1$s - Tellimus %2$s"
|
1617 |
|
1618 |
#. translators: Placeholders: %1$s - site title, %2$s - order number.
|
1619 |
#. Definitions: Capture as in capture funds from a credit card.
|
1620 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1942
|
1621 |
msgid "%1$s - Capture for Order %2$s"
|
1622 |
msgstr "%1$s - Tasumine tellimuse %2$s eest"
|
1623 |
|
1624 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1625 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2085
|
1626 |
msgid "%1$s - Refund for Order %2$s"
|
1627 |
msgstr "%1$s - Tagasimakse tellimuse %2$s eest"
|
1628 |
|
1629 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1630 |
#. Authorize.net, Braintree, etc), %2$s - a monetary amount
|
1631 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2152
|
1632 |
msgid "%1$s Refund in the amount of %2$s approved."
|
1633 |
msgstr "%1$s: tagasimakse summas %2$s kinnitatud."
|
1634 |
|
1635 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1636 |
#. Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message
|
1637 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2182
|
1638 |
msgid "%1$s Refund Failed: %2$s - %3$s"
|
1639 |
msgstr "%1$s: tagasimakse ebaõnnestus: %2$s - %3$s"
|
1640 |
|
1641 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1642 |
#. Authorize.net, Braintree, etc), %2$s - error message
|
1643 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2190
|
1644 |
msgid "%1$s Refund Failed: %2$s"
|
1645 |
msgstr "%1$s: tagasimakse ebaõnnestus: %2$s"
|
1646 |
|
1647 |
#. translators: Placeholders: %s - payment gateway title (such as
|
1648 |
#. Authorize.net, Braintree, etc)
|
1649 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2211
|
1650 |
msgid "%s Order completely refunded."
|
1651 |
msgstr "%s: tellimus täielikult tagasi makstud."
|
1652 |
|
1653 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2266
|
1654 |
msgid ""
|
1655 |
"Oops, you cannot partially void this order. Please use the full order amount."
|
1656 |
msgstr ""
|
1659 |
|
1660 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error code,
|
1661 |
#. %3$s - error message. Void as in to void an order.
|
1662 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2353
|
1663 |
msgid "%1$s Void Failed: %2$s - %3$s"
|
1664 |
msgstr "%1$s: tühistamine ebaõnnestus: %2$s - %3$s"
|
1665 |
|
1666 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1667 |
#. message. Void as in to void an order.
|
1668 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2361
|
1669 |
msgid "%1$s Void Failed: %2$s"
|
1670 |
msgstr "%1$s: tühistamine ebaõnnestus: %2$s"
|
1671 |
|
1672 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary
|
1673 |
#. amount. Void as in to void an order.
|
1674 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2385
|
1675 |
msgid "%1$s Void in the amount of %2$s approved."
|
1676 |
msgstr "%1$s: tühistamine summas %2$s kinnitatud."
|
1677 |
|
1678 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1679 |
#. ("Test"), %3$s - transaction type (authorization/charge)
|
1680 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2677
|
1681 |
#, fuzzy
|
1682 |
msgid "%1$s %2$s %3$s Approved"
|
1683 |
msgstr "%1$s: %2$s tehing kinnitatud"
|
1684 |
|
1685 |
#. translators: Placeholders: %1$s - credit card type (MasterCard, Visa,
|
1686 |
#. etc...), %2$s - last four digits of the card
|
1687 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2687
|
1688 |
msgid "%1$s ending in %2$s"
|
1689 |
msgstr ""
|
1690 |
|
1691 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - message
|
1692 |
#. (probably reason for the transaction being held for review)
|
1693 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2783
|
1694 |
msgid "%1$s Transaction Held for Review (%2$s)"
|
1695 |
msgstr "%1$s: tehning pandi ülevaatuseks ootele (%2$s)"
|
1696 |
|
1697 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1698 |
#. message; e.g. Order Note: [Payment method] Payment failed [error]
|
1699 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2872
|
1700 |
msgid "%1$s Payment Failed (%2$s)"
|
1701 |
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
1702 |
|
1703 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s -
|
1704 |
#. message/error
|
1705 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2907
|
1706 |
msgid "%1$s Transaction Cancelled (%2$s)"
|
1707 |
msgstr "%1$s: tehing tühistatud (%2$s)"
|
1708 |
|
1709 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3155
|
1710 |
msgid "Transaction Type"
|
1711 |
msgstr "Tehingu tüüp"
|
1712 |
|
1713 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3157
|
1714 |
msgid ""
|
1715 |
"Select how transactions should be processed. Charge submits all transactions "
|
1716 |
"for settlement, Authorization simply authorizes the order total for capture "
|
1720 |
"koheselt tasumisele, \"Autoriseerimine\" lihtsalt autoriseerib tellimuse "
|
1721 |
"summa hilisemaks tasumiseks."
|
1722 |
|
1723 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3168
|
1724 |
msgid "Charge Virtual-Only Orders"
|
1725 |
msgstr ""
|
1726 |
|
1727 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3170
|
1728 |
msgid ""
|
1729 |
"If the order contains exclusively virtual items, enable this to immediately "
|
1730 |
"charge, rather than authorize, the transaction."
|
1731 |
msgstr ""
|
1732 |
|
1733 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3178
|
1734 |
#, fuzzy
|
1735 |
msgid "Enable Partial Capture"
|
1736 |
msgstr "Lülita see makseviis sisse"
|
1737 |
|
1738 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3180
|
1739 |
msgid "Allow orders to be partially captured multiple times."
|
1740 |
msgstr ""
|
1741 |
|
1742 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3192
|
1743 |
#, fuzzy
|
1744 |
msgid "Capture Paid Orders"
|
1745 |
msgstr "Teosta makse"
|
1746 |
|
1747 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3195
|
1748 |
msgid "Automatically capture orders when they are changed to %s."
|
1749 |
msgstr ""
|
1750 |
|
1751 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3196
|
1752 |
msgid "a paid status"
|
1753 |
msgstr ""
|
1754 |
|
1755 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3386
|
1756 |
#, fuzzy
|
1757 |
msgid "Accepted Card Logos"
|
1758 |
msgstr "Vastuvõetavad kaardid"
|
1759 |
|
1760 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3388
|
1761 |
#, fuzzy
|
1762 |
msgid ""
|
1763 |
"These are the card logos that are displayed to customers as accepted during "
|
1765 |
msgstr "Kliendile kassas nähtav makseviisi nimetus."
|
1766 |
|
1767 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag
|
1768 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3391
|
1769 |
msgid ""
|
1770 |
"This setting %1$sdoes not%2$s change which card types the gateway will "
|
1771 |
"accept. Accepted cards are configured from your payment processor account."
|
1774 |
#. translators:
|
1775 |
#. http:www.cybersource.com/products/payment_security/payment_tokenization/ and
|
1776 |
#. https:en.wikipedia.org/wiki/Tokenization_(data_security)
|
1777 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3482
|
1778 |
msgid "Tokenization"
|
1779 |
msgstr "Maksevahendite salvestamine"
|
1780 |
|
1781 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3483
|
1782 |
msgid ""
|
1783 |
"Allow customers to securely save their payment details for future checkout."
|
1784 |
msgstr ""
|
1787 |
|
1788 |
#. translators: %1$s - gateway name, %2$s - <a> tag, %3$s - </a> tag, %4$s -
|
1789 |
#. <a> tag, %5$s - </a> tag
|
1790 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:4302
|
1791 |
msgid ""
|
1792 |
"Heads up! %1$s is not fully configured and cannot accept payments. Please "
|
1793 |
"%2$sreview the documentation%3$s and configure the %4$sgateway settings%5$s."
|
1817 |
msgid "Pre-Order Release Payment Failed: %s"
|
1818 |
msgstr "Eeltellimuse väljastamise makse ebaõnnestus: %s"
|
1819 |
|
1820 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:349
|
1821 |
msgid "Subscription Renewal: payment token is missing/invalid."
|
1822 |
msgstr ""
|
1823 |
|
1824 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:375
|
1825 |
msgid "%1$s - Subscription Renewal Order %2$s"
|
1826 |
msgstr ""
|
1827 |
|
1828 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1829 |
#. message; e.g. Order Note: [Payment method] Payment Change failed [error]
|
1830 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:507
|
1831 |
#, fuzzy
|
1832 |
msgid "%1$s Payment Change Failed (%2$s)"
|
1833 |
msgstr "%1$s: makse ebaõnnestus (%2$s)"
|
1834 |
|
1835 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:650
|
1836 |
msgid "Via %s ending in %s"
|
1837 |
msgstr ""
|
1838 |
|
1839 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:677
|
1840 |
msgid "Subscriptions"
|
1841 |
msgstr ""
|
1842 |
|
1843 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:738
|
1844 |
+
msgid "N/A"
|
1845 |
+
msgstr "-"
|
|
|
|
|
1846 |
|
1847 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:837
|
1848 |
msgid "Payment Token"
|
1849 |
msgstr ""
|
1850 |
|
1851 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:866
|
1852 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:871
|
1853 |
msgid "%s is required."
|
1854 |
msgstr ""
|
1855 |
|
1856 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:181
|
1857 |
msgid "Unknown Error"
|
1858 |
msgstr "Esines tundmatu viga"
|
1859 |
|
1971 |
"loopback connections enabled."
|
1972 |
msgstr ""
|
1973 |
|
1974 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:395
|
1975 |
msgctxt "enhanced select"
|
1976 |
msgid "No matches found"
|
1977 |
msgstr ""
|
1978 |
|
1979 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:396
|
1980 |
msgctxt "enhanced select"
|
1981 |
msgid "Loading failed"
|
1982 |
msgstr ""
|
1983 |
|
1984 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:397
|
1985 |
msgctxt "enhanced select"
|
1986 |
msgid "Please enter 1 or more characters"
|
1987 |
msgstr ""
|
1988 |
|
1989 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:398
|
1990 |
msgctxt "enhanced select"
|
1991 |
msgid "Please enter %qty% or more characters"
|
1992 |
msgstr ""
|
1993 |
|
1994 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:399
|
1995 |
msgctxt "enhanced select"
|
1996 |
msgid "Please delete 1 character"
|
1997 |
msgstr ""
|
1998 |
|
1999 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:400
|
2000 |
msgctxt "enhanced select"
|
2001 |
msgid "Please delete %qty% characters"
|
2002 |
msgstr ""
|
2003 |
|
2004 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:401
|
2005 |
msgctxt "enhanced select"
|
2006 |
msgid "You can only select 1 item"
|
2007 |
msgstr ""
|
2008 |
|
2009 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:402
|
2010 |
msgctxt "enhanced select"
|
2011 |
msgid "You can only select %qty% items"
|
2012 |
msgstr ""
|
2013 |
|
2014 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:403
|
2015 |
msgctxt "enhanced select"
|
2016 |
msgid "Loading more results…"
|
2017 |
msgstr ""
|
2018 |
|
2019 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:404
|
2020 |
msgctxt "enhanced select"
|
2021 |
msgid "Searching…"
|
2022 |
msgstr ""
|
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 ""
|
2038 |
|
2039 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:749
|
2040 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2679
|
2041 |
msgctxt "noun, software environment"
|
2042 |
msgid "Test"
|
2043 |
msgstr "test"
|
2044 |
|
2045 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:750
|
2046 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2680
|
2047 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3161
|
2048 |
msgctxt "credit card transaction type"
|
2049 |
msgid "Authorization"
|
2050 |
msgstr "Autoriseerimine"
|
2051 |
|
2052 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:750
|
2053 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2680
|
2054 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3160
|
2055 |
msgctxt "noun, credit card transaction type"
|
2056 |
msgid "Charge"
|
2057 |
msgstr "Makse"
|
2062 |
msgstr "Konto"
|
2063 |
|
2064 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:229
|
2065 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3419
|
2066 |
msgctxt "credit card type"
|
2067 |
msgid "Visa"
|
2068 |
msgstr "Visa"
|
2069 |
|
2070 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:233
|
2071 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3420
|
2072 |
msgctxt "credit card type"
|
2073 |
msgid "MasterCard"
|
2074 |
msgstr "MasterCard"
|
2075 |
|
2076 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:237
|
2077 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3421
|
2078 |
msgctxt "credit card type"
|
2079 |
msgid "American Express"
|
2080 |
msgstr "American Express"
|
2085 |
msgstr ""
|
2086 |
|
2087 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:245
|
2088 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3422
|
2089 |
msgctxt "credit card type"
|
2090 |
msgid "Discover"
|
2091 |
msgstr "Discover"
|
2092 |
|
2093 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:249
|
2094 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3424
|
2095 |
msgctxt "credit card type"
|
2096 |
msgid "JCB"
|
2097 |
msgstr "JCB"
|
2111 |
msgid "Laser"
|
2112 |
msgstr ""
|
2113 |
|
2114 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3423
|
2115 |
msgctxt "credit card type"
|
2116 |
msgid "Diners"
|
2117 |
msgstr "Diners"
|
2128 |
msgid "Savings"
|
2129 |
msgstr "Hoiuarve"
|
2130 |
|
2131 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2460
|
2132 |
msgctxt "hash before order number"
|
2133 |
msgid "#"
|
2134 |
msgstr "#"
|
2135 |
|
2136 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:732
|
2137 |
msgctxt "hash before order number"
|
2138 |
msgid "#%s"
|
2139 |
msgstr ""
|
2140 |
|
2141 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3189
|
2142 |
msgctxt ""
|
2143 |
"coordinating conjunction for a list of order statuses: on-hold, processing, "
|
2144 |
"or completed"
|
2146 |
msgstr ""
|
2147 |
|
2148 |
#. translators: https:www.skyverge.com/for-translators-environments/
|
2149 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:4028
|
2150 |
msgctxt "software environment"
|
2151 |
msgid "Production"
|
2152 |
msgstr "Töö/avalik"
|
2153 |
|
2154 |
+
#~ msgid "My Payment Methods"
|
2155 |
+
#~ msgstr "Minu maksevahendid."
|
2156 |
+
|
2157 |
+
#~ msgid "Add New Payment Method"
|
2158 |
+
#~ msgstr "Lisa uus maksevahend"
|
2159 |
+
|
2160 |
+
#~ msgid "Method"
|
2161 |
+
#~ msgstr "Maksevahend"
|
2162 |
+
|
2163 |
+
#~ msgid "Expires"
|
2164 |
+
#~ msgstr "Aegub"
|
2165 |
+
|
2166 |
+
#~ msgid "Credit/Debit Cards"
|
2167 |
+
#~ msgstr "Deebet- ja krediitkaardid"
|
2168 |
+
|
2169 |
+
#~ msgid "Bank Accounts"
|
2170 |
+
#~ msgstr "Pangakontod"
|
2171 |
+
|
2172 |
+
#~ msgid "Delete"
|
2173 |
+
#~ msgstr "Kustuta"
|
2174 |
+
|
2175 |
+
#~ msgid "Error removing payment method"
|
2176 |
+
#~ msgstr "Viga maksevahendi eemaldamisel"
|
2177 |
+
|
2178 |
+
#~ msgid "Payment method deleted."
|
2179 |
+
#~ msgstr "Maksevahend kustutatud."
|
2180 |
+
|
2181 |
#, fuzzy
|
2182 |
#~ msgid "Pay with"
|
2183 |
#~ msgstr "Maksa"
|
vendor/skyverge/wc-plugin-framework/woocommerce/i18n/languages/woocommerce-plugin-framework.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WooCommerce Plugin Framework 5.
|
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:
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
@@ -62,71 +62,71 @@ msgstr ""
|
|
62 |
msgid "%s › Setup"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
66 |
msgid "Oops! An error occurred, please try again."
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
70 |
msgid "Ready!"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
74 |
#. translators: Placeholder: %s - plugin name
|
75 |
msgid "Welcome to %s!"
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
79 |
msgid ""
|
80 |
"This quick setup wizard will help you configure the basic settings and get "
|
81 |
"you started."
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
85 |
msgid "%s is ready!"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
89 |
msgid "Next step"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
93 |
msgid "You can also:"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
97 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
98 |
msgid "View the Docs"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
102 |
msgid "See more setup options"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
106 |
msgid "Learn more about customizing the plugin"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
110 |
msgid "Review Your Settings"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
114 |
msgid "Leave a Review"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
118 |
msgid "Continue"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
122 |
msgid "Return to the WordPress Dashboard"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
126 |
msgid "Not right now"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
130 |
msgid "Skip this step"
|
131 |
msgstr ""
|
132 |
|
@@ -173,7 +173,7 @@ msgstr ""
|
|
173 |
msgid "Please %1$supdate WooCommerce%2$s"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: class-sv-wc-plugin-compatibility.php:
|
177 |
msgid "WooCommerce"
|
178 |
msgstr ""
|
179 |
|
@@ -244,7 +244,7 @@ msgstr ""
|
|
244 |
msgid "You cannot unserialize instances of %s."
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: class-sv-wc-plugin.php:
|
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 ""
|
@@ -253,24 +253,245 @@ msgid ""
|
|
253 |
"features."
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: class-sv-wc-plugin.php:
|
257 |
#. translators: Docs as in Documentation
|
258 |
msgid "Docs"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: class-sv-wc-plugin.php:
|
262 |
msgid "%1$s - A minimum of %2$s is required."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: class-sv-wc-plugin.php:
|
266 |
msgid "Set as %1$s - %2$s is required."
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: class-sv-wc-plugin.php:
|
270 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
271 |
msgid "Configure"
|
272 |
msgstr ""
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:179
|
275 |
msgid ""
|
276 |
"There was a problem processing your order and it is being placed on hold "
|
@@ -278,20 +499,20 @@ msgid ""
|
|
278 |
msgstr ""
|
279 |
|
280 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:217
|
281 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
282 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
283 |
msgid "An error occurred, please try again or try an alternate form of payment."
|
284 |
msgstr ""
|
285 |
|
286 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
|
287 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
288 |
#. translators: Placeholders: %s - a WooCommerce order ID
|
289 |
msgid "Could not find order %s"
|
290 |
msgstr ""
|
291 |
|
292 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:152
|
293 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
294 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
295 |
#. translators: Placeholders: %1$s - status code, %2$s - status message
|
296 |
#. translators: Placeholders: %1$s - payment request response status code, %2$s
|
297 |
#. - payment request response status message
|
@@ -299,49 +520,49 @@ msgid "Status code %1$s: %2$s"
|
|
299 |
msgstr ""
|
300 |
|
301 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:155
|
302 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
303 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
304 |
#. translators: Placeholders: %s - status code
|
305 |
#. translators: Placeholders: %s - payment request response status code
|
306 |
msgid "Status code: %s"
|
307 |
msgstr ""
|
308 |
|
309 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:158
|
310 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
311 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
312 |
#. translators: Placeholders; %s - status message
|
313 |
#. translators: Placeholders: %s - payment request response status message
|
314 |
msgid "Status message: %s"
|
315 |
msgstr ""
|
316 |
|
317 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:163
|
318 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
319 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
320 |
msgid "Transaction ID %s"
|
321 |
msgstr ""
|
322 |
|
323 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
|
324 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
325 |
#. translators: Placeholders: %s - payment gateway title (such as
|
326 |
#. Authorize.net, Braintree, etc)
|
327 |
msgid "%s duplicate transaction received"
|
328 |
msgstr ""
|
329 |
|
330 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
|
331 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
332 |
msgid "Order %s is already paid for."
|
333 |
msgstr ""
|
334 |
|
335 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:267
|
336 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
337 |
msgid ""
|
338 |
"Your order has been received and is being reviewed. Thank you for your "
|
339 |
"business."
|
340 |
msgstr ""
|
341 |
|
342 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:274
|
343 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
344 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
345 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:370
|
346 |
#. translators: This is a message describing that the transaction in question
|
347 |
#. only performed a credit card authorization and did not capture any funds.
|
@@ -387,12 +608,12 @@ msgid "%1$s Capture of %2$s Approved"
|
|
387 |
msgstr ""
|
388 |
|
389 |
#: payment-gateway/Handlers/Capture.php:198
|
390 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
391 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
392 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
393 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
394 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
395 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
396 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:353
|
397 |
#. translators: Placeholders: %s - transaction ID
|
398 |
msgid "(Transaction ID %s)"
|
@@ -449,67 +670,67 @@ msgstr ""
|
|
449 |
msgid "An error occurred. Please try again."
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
453 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:305
|
454 |
msgid "(%s)"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
458 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
459 |
msgid "Default"
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
463 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
464 |
msgid "Token ID"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
468 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:300
|
469 |
msgid "Card Type"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
473 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
474 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:192
|
475 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:298
|
476 |
msgid "Last Four"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
480 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:358
|
481 |
msgid "Expiration (MM/YY)"
|
482 |
msgstr ""
|
483 |
|
484 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
485 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:466
|
486 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:299
|
487 |
#. translators: e-check account type, HTML form field label
|
488 |
msgid "Account Type"
|
489 |
msgstr ""
|
490 |
|
491 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
492 |
msgid "Checking"
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
496 |
msgid "Savings"
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
500 |
msgid "Refresh"
|
501 |
msgstr ""
|
502 |
|
503 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
504 |
msgid "Add New"
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
508 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
509 |
msgid "Save"
|
510 |
msgstr ""
|
511 |
|
512 |
-
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:
|
513 |
msgid "Remove"
|
514 |
msgstr ""
|
515 |
|
@@ -519,7 +740,7 @@ msgid "%s Payment Tokens"
|
|
519 |
msgstr ""
|
520 |
|
521 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:302
|
522 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
523 |
msgid "Customer ID"
|
524 |
msgstr ""
|
525 |
|
@@ -528,7 +749,7 @@ msgid "This section contains configuration settings for this gateway."
|
|
528 |
msgstr ""
|
529 |
|
530 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:53
|
531 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
532 |
#. translators: environment as in a software environment (test/production)
|
533 |
msgid "Environment"
|
534 |
msgstr ""
|
@@ -546,7 +767,7 @@ msgid "Displays whether or not tokenization is enabled for this gateway."
|
|
546 |
msgstr ""
|
547 |
|
548 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:75
|
549 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
550 |
msgid "Debug Mode"
|
551 |
msgstr ""
|
552 |
|
@@ -563,12 +784,12 @@ msgid "Display at Checkout"
|
|
563 |
msgstr ""
|
564 |
|
565 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:83
|
566 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
567 |
msgid "Save to Log"
|
568 |
msgstr ""
|
569 |
|
570 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:85
|
571 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
572 |
msgid "Off"
|
573 |
msgstr ""
|
574 |
|
@@ -597,11 +818,11 @@ msgid "Capture %s"
|
|
597 |
msgstr ""
|
598 |
|
599 |
#: payment-gateway/admin/views/html-order-partial-capture.php:66
|
600 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
601 |
msgid "Cancel"
|
602 |
msgstr ""
|
603 |
|
604 |
-
#: payment-gateway/admin/views/html-user-payment-token-editor-token.php:
|
605 |
msgid "-- Select an option --"
|
606 |
msgstr ""
|
607 |
|
@@ -613,11 +834,6 @@ msgstr ""
|
|
613 |
msgid "The gateway customer ID for the user. Only edit this if necessary."
|
614 |
msgstr ""
|
615 |
|
616 |
-
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:99
|
617 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:186
|
618 |
-
msgid "An error occurred, please try again or try an alternate form of payment"
|
619 |
-
msgstr ""
|
620 |
-
|
621 |
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:100
|
622 |
msgid ""
|
623 |
"We cannot process your order with the payment information that you "
|
@@ -734,161 +950,6 @@ msgid ""
|
|
734 |
"Please verify the address and try again."
|
735 |
msgstr ""
|
736 |
|
737 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:84
|
738 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:102
|
739 |
-
msgid "Apple Pay"
|
740 |
-
msgstr ""
|
741 |
-
|
742 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:108
|
743 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1189
|
744 |
-
msgid "Enable / Disable"
|
745 |
-
msgstr ""
|
746 |
-
|
747 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:109
|
748 |
-
msgid "Accept Apple Pay"
|
749 |
-
msgstr ""
|
750 |
-
|
751 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:116
|
752 |
-
msgid "Allow Apple Pay on"
|
753 |
-
msgstr ""
|
754 |
-
|
755 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:126
|
756 |
-
msgid "Button Style"
|
757 |
-
msgstr ""
|
758 |
-
|
759 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:129
|
760 |
-
msgid "Black"
|
761 |
-
msgstr ""
|
762 |
-
|
763 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:130
|
764 |
-
msgid "White"
|
765 |
-
msgstr ""
|
766 |
-
|
767 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:131
|
768 |
-
msgid "White with outline"
|
769 |
-
msgstr ""
|
770 |
-
|
771 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:143
|
772 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1364
|
773 |
-
msgid "Connection Settings"
|
774 |
-
msgstr ""
|
775 |
-
|
776 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:152
|
777 |
-
msgid "Apple Merchant ID"
|
778 |
-
msgstr ""
|
779 |
-
|
780 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:156
|
781 |
-
msgid "This is found in your %1$sApple developer account%2$s"
|
782 |
-
msgstr ""
|
783 |
-
|
784 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:166
|
785 |
-
msgid "Certificate Path"
|
786 |
-
msgstr ""
|
787 |
-
|
788 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:171
|
789 |
-
#. translators: Placeholders: %s - the server's web root path
|
790 |
-
msgid "For reference, your current web root path is: %s"
|
791 |
-
msgstr ""
|
792 |
-
|
793 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:184
|
794 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:194
|
795 |
-
msgid "Processing Gateway"
|
796 |
-
msgstr ""
|
797 |
-
|
798 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:202
|
799 |
-
msgid "Test Mode"
|
800 |
-
msgstr ""
|
801 |
-
|
802 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:203
|
803 |
-
msgid ""
|
804 |
-
"Enable to test Apple Pay functionality throughout your sites without "
|
805 |
-
"processing real payments."
|
806 |
-
msgstr ""
|
807 |
-
|
808 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:312
|
809 |
-
msgid "Your site must be served over HTTPS with a valid SSL certificate."
|
810 |
-
msgstr ""
|
811 |
-
|
812 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:322
|
813 |
-
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
814 |
-
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
815 |
-
msgid ""
|
816 |
-
"Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s "
|
817 |
-
"to enable Apple Pay."
|
818 |
-
msgid_plural ""
|
819 |
-
"Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to "
|
820 |
-
"accept one of %1$s to enable Apple Pay."
|
821 |
-
msgstr[0] ""
|
822 |
-
msgstr[1] ""
|
823 |
-
|
824 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:341
|
825 |
-
msgid ""
|
826 |
-
"Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check "
|
827 |
-
"your path configuration."
|
828 |
-
msgstr ""
|
829 |
-
|
830 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:348
|
831 |
-
msgid "Apple Pay is disabled."
|
832 |
-
msgstr ""
|
833 |
-
|
834 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:387
|
835 |
-
msgid "Single products"
|
836 |
-
msgstr ""
|
837 |
-
|
838 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:388
|
839 |
-
msgid "Cart"
|
840 |
-
msgstr ""
|
841 |
-
|
842 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:389
|
843 |
-
msgid "Checkout"
|
844 |
-
msgstr ""
|
845 |
-
|
846 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:300
|
847 |
-
msgid "Buy with"
|
848 |
-
msgstr ""
|
849 |
-
|
850 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:333
|
851 |
-
msgid "By submitting your payment, you agree to our %1$sterms and conditions%2$s."
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:558
|
855 |
-
msgid "or"
|
856 |
-
msgstr ""
|
857 |
-
|
858 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:123
|
859 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:136
|
860 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php:140
|
861 |
-
msgid "Error %d: Unable to create order. Please try again."
|
862 |
-
msgstr ""
|
863 |
-
|
864 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:154
|
865 |
-
msgid "Apple Pay payment authorized."
|
866 |
-
msgstr ""
|
867 |
-
|
868 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:188
|
869 |
-
msgid "Apple Pay payment failed. %s"
|
870 |
-
msgstr ""
|
871 |
-
|
872 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:566
|
873 |
-
msgid "Subtotal"
|
874 |
-
msgstr ""
|
875 |
-
|
876 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:576
|
877 |
-
msgid "Discount"
|
878 |
-
msgstr ""
|
879 |
-
|
880 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:586
|
881 |
-
msgid "Shipping"
|
882 |
-
msgstr ""
|
883 |
-
|
884 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:596
|
885 |
-
msgid "Fees"
|
886 |
-
msgstr ""
|
887 |
-
|
888 |
-
#: payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:606
|
889 |
-
msgid "Taxes"
|
890 |
-
msgstr ""
|
891 |
-
|
892 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:61
|
893 |
msgid ""
|
894 |
"Payment error, please try another payment method or contact us to complete "
|
@@ -896,82 +957,82 @@ msgid ""
|
|
896 |
msgstr ""
|
897 |
|
898 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:161
|
899 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
900 |
msgid "Card expiration date is invalid"
|
901 |
msgstr ""
|
902 |
|
903 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:185
|
904 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
905 |
msgid "Card number is missing"
|
906 |
msgstr ""
|
907 |
|
908 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:191
|
909 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
910 |
msgid "Card number is invalid (wrong length)"
|
911 |
msgstr ""
|
912 |
|
913 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:196
|
914 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
915 |
msgid "Card number is invalid (only digits allowed)"
|
916 |
msgstr ""
|
917 |
|
918 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:201
|
919 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
920 |
msgid "Card number is invalid"
|
921 |
msgstr ""
|
922 |
|
923 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:228
|
924 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
925 |
msgid "Card security code is invalid (only digits are allowed)"
|
926 |
msgstr ""
|
927 |
|
928 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:234
|
929 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
930 |
msgid "Card security code is invalid (must be 3 or 4 digits)"
|
931 |
msgstr ""
|
932 |
|
933 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:240
|
934 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
935 |
msgid "Card security code is missing"
|
936 |
msgstr ""
|
937 |
|
938 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:267
|
939 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
940 |
msgid "Routing Number is missing"
|
941 |
msgstr ""
|
942 |
|
943 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:274
|
944 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
945 |
msgid "Routing Number is invalid (only digits are allowed)"
|
946 |
msgstr ""
|
947 |
|
948 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:280
|
949 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
950 |
msgid "Routing number is invalid (must be 9 digits)"
|
951 |
msgstr ""
|
952 |
|
953 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:289
|
954 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
955 |
msgid "Account Number is missing"
|
956 |
msgstr ""
|
957 |
|
958 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:296
|
959 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
960 |
msgid "Account Number is invalid (only digits are allowed)"
|
961 |
msgstr ""
|
962 |
|
963 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:302
|
964 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
965 |
msgid "Account number is invalid (must be between 5 and 17 digits)"
|
966 |
msgstr ""
|
967 |
|
968 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:309
|
969 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
970 |
msgid "Drivers license number is invalid"
|
971 |
msgstr ""
|
972 |
|
973 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:315
|
974 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
975 |
msgid "Check Number is invalid (only digits are allowed)"
|
976 |
msgstr ""
|
977 |
|
@@ -983,72 +1044,72 @@ msgstr ""
|
|
983 |
msgid "Payment method address could not be updated. %s"
|
984 |
msgstr ""
|
985 |
|
986 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
987 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
988 |
#. translators: Placeholders: %1$s - payment method title, %2$s - payment
|
989 |
#. account type (savings/checking) (may or may not be available), %3$s - last
|
990 |
#. four digits of the account
|
991 |
msgid "%1$s Check Transaction Approved: %2$s account ending in %3$s"
|
992 |
msgstr ""
|
993 |
|
994 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
995 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
996 |
#. translators: Placeholders: %s - check number
|
997 |
msgid "Check number %s"
|
998 |
msgstr ""
|
999 |
|
1000 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1001 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1002 |
#. ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type
|
1003 |
#. (mastercard, visa, ...), %5$s - last four digits of the card
|
1004 |
msgid "%1$s %2$s %3$s Approved: %4$s ending in %5$s"
|
1005 |
msgstr ""
|
1006 |
|
1007 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1008 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:714
|
1009 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1010 |
#. translators: Placeholders: %s - expiry date
|
1011 |
msgid "(expires %s)"
|
1012 |
msgstr ""
|
1013 |
|
1014 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1015 |
#. translators: Placeholders: %s - failure message
|
1016 |
msgid "Tokenization Request Failed: %s"
|
1017 |
msgstr ""
|
1018 |
|
1019 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1020 |
#. translators: Placeholders: %1$s - payment method title, %2$s - failure
|
1021 |
#. message
|
1022 |
msgid "%1$s Tokenization Request Failed: %2$s"
|
1023 |
msgstr ""
|
1024 |
|
1025 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1026 |
#. translators: Placeholders: %s - failure message. Payment method as in a
|
1027 |
#. specific credit card, e-check or bank account
|
1028 |
msgid "Oops, adding your new payment method failed: %s"
|
1029 |
msgstr ""
|
1030 |
|
1031 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1032 |
#. translators: Payment method as in a specific credit card. Placeholders: %1$s
|
1033 |
#. - card type (visa, mastercard, ...), %2$s - last four digits of the card,
|
1034 |
#. %3$s - card expiry date
|
1035 |
msgid "Nice! New payment method added: %1$s ending in %2$s (expires %3$s)"
|
1036 |
msgstr ""
|
1037 |
|
1038 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1039 |
#. translators: Payment method as in a specific e-check account. Placeholders:
|
1040 |
#. %1$s - account type (checking/savings), %2$s - last four digits of the
|
1041 |
#. account
|
1042 |
msgid "Nice! New payment method added: %1$s account ending in %2$s"
|
1043 |
msgstr ""
|
1044 |
|
1045 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1046 |
#. translators: Payment method as in a specific credit card, e-check or bank
|
1047 |
#. account
|
1048 |
msgid "Nice! New payment method added."
|
1049 |
msgstr ""
|
1050 |
|
1051 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1052 |
#. translators: Placeholders: %1$s - site title, %2$s - customer email. Payment
|
1053 |
#. method as in a specific credit card, e-check or bank account
|
1054 |
msgid "%1$s - Add Payment Method for %2$s"
|
@@ -1074,24 +1135,24 @@ msgstr ""
|
|
1074 |
msgid "Bank Account"
|
1075 |
msgstr ""
|
1076 |
|
1077 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1078 |
msgid "Thank you for your order, please click the button below to pay."
|
1079 |
msgstr ""
|
1080 |
|
1081 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1082 |
msgid "Thank you for your order. We are now redirecting you to complete payment."
|
1083 |
msgstr ""
|
1084 |
|
1085 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1086 |
msgid "Pay Now"
|
1087 |
msgstr ""
|
1088 |
|
1089 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1090 |
msgid "Cancel Order"
|
1091 |
msgstr ""
|
1092 |
|
1093 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1094 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1095 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1096 |
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
|
1097 |
#. account, etc), %3$s - last four digits of the card/account, %4$s -
|
@@ -1099,117 +1160,70 @@ msgstr ""
|
|
1099 |
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
|
1100 |
msgstr ""
|
1101 |
|
1102 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1103 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1104 |
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
|
1105 |
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
|
1106 |
#. available), %3$s - last four digits of the account
|
1107 |
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
|
1108 |
msgstr ""
|
1109 |
|
1110 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1111 |
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
|
1112 |
#. NETbilling, etc)
|
1113 |
msgid "%s Payment Method Saved"
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:
|
1117 |
#. translators: Placeholders: %s - a failed tokenization API error
|
1118 |
msgid "Tokenization failed. %s"
|
1119 |
msgstr ""
|
1120 |
|
1121 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1122 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1123 |
msgid "Edit"
|
1124 |
msgstr ""
|
1125 |
|
1126 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:290
|
1131 |
-
msgid "Are you sure you want to delete this payment method?"
|
1132 |
-
msgstr ""
|
1133 |
-
|
1134 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:377
|
1135 |
-
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1136 |
-
#. account
|
1137 |
-
msgid "You do not have any saved payment methods."
|
1138 |
-
msgstr ""
|
1139 |
-
|
1140 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:416
|
1141 |
-
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1142 |
-
#. account
|
1143 |
-
msgid "My Payment Methods"
|
1144 |
-
msgstr ""
|
1145 |
-
|
1146 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:424
|
1147 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1148 |
-
#. account
|
1149 |
-
msgid "Add New Payment Method"
|
1150 |
-
msgstr ""
|
1151 |
-
|
1152 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:512
|
1153 |
-
msgid "Method"
|
1154 |
msgstr ""
|
1155 |
|
1156 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1157 |
msgid "Details"
|
1158 |
msgstr ""
|
1159 |
|
1160 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1161 |
-
msgid "Expires"
|
1162 |
-
msgstr ""
|
1163 |
-
|
1164 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:515
|
1165 |
msgid "Default?"
|
1166 |
msgstr ""
|
1167 |
|
1168 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1169 |
-
msgid "
|
1170 |
-
msgstr ""
|
1171 |
-
|
1172 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:552
|
1173 |
-
msgid "Credit/Debit Cards"
|
1174 |
msgstr ""
|
1175 |
|
1176 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1177 |
-
msgid "
|
1178 |
msgstr ""
|
1179 |
|
1180 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1181 |
-
|
|
|
|
|
1182 |
msgstr ""
|
1183 |
|
1184 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1185 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:200
|
1186 |
msgid "Nickname"
|
1187 |
msgstr ""
|
1188 |
|
1189 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1190 |
-
msgid "Delete"
|
1191 |
-
msgstr ""
|
1192 |
-
|
1193 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1063
|
1194 |
msgid "Oops, you took too long, please try again."
|
1195 |
msgstr ""
|
1196 |
|
1197 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:
|
1198 |
msgid "There was an error with your request, please try again."
|
1199 |
msgstr ""
|
1200 |
|
1201 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1089
|
1202 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1203 |
-
#. account
|
1204 |
-
msgid "Error removing payment method"
|
1205 |
-
msgstr ""
|
1206 |
-
|
1207 |
-
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1094
|
1208 |
-
#. translators: Payment method as in a specific credit card, e-check or bank
|
1209 |
-
#. account
|
1210 |
-
msgid "Payment method deleted."
|
1211 |
-
msgstr ""
|
1212 |
-
|
1213 |
#: payment-gateway/class-sv-wc-payment-gateway-payment-form.php:340
|
1214 |
msgid "Card Number"
|
1215 |
msgstr ""
|
@@ -1273,7 +1287,7 @@ msgstr ""
|
|
1273 |
msgid "Payment Info"
|
1274 |
msgstr ""
|
1275 |
|
1276 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1277 |
#. translators: Placeholders: %1$s - plugin name, %2$s - <a> tag, %3$s - </a>
|
1278 |
#. tag
|
1279 |
msgid ""
|
@@ -1281,7 +1295,7 @@ msgid ""
|
|
1281 |
"data may be at risk. %2$sVerify your site URLs here%3$s"
|
1282 |
msgstr ""
|
1283 |
|
1284 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1285 |
#. translators: Placeholders: %s - payment gateway name
|
1286 |
msgid ""
|
1287 |
"%s will soon require TLS 1.2 support to process transactions and your "
|
@@ -1290,7 +1304,7 @@ msgid ""
|
|
1290 |
"and request they make any necessary updates."
|
1291 |
msgstr ""
|
1292 |
|
1293 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1294 |
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
1295 |
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
1296 |
msgid ""
|
@@ -1302,7 +1316,7 @@ msgid_plural ""
|
|
1302 |
msgstr[0] ""
|
1303 |
msgstr[1] ""
|
1304 |
|
1305 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1306 |
#. translators: Placeholders: %1$s - payment gateway name, %2$s - opening <a>
|
1307 |
#. tag, %3$s - closing </a> tag
|
1308 |
msgid ""
|
@@ -1311,16 +1325,16 @@ msgid ""
|
|
1311 |
"processing, we recommend %2$sturning off Debug Mode%3$s"
|
1312 |
msgstr ""
|
1313 |
|
1314 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1315 |
#. translators: Placeholders: %s - gateway name
|
1316 |
msgid "%s is not configured"
|
1317 |
msgstr ""
|
1318 |
|
1319 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1320 |
msgid "Dismiss"
|
1321 |
msgstr ""
|
1322 |
|
1323 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1324 |
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1325 |
#. tag, %3$s - closing </a> HTML link tag
|
1326 |
msgid ""
|
@@ -1328,7 +1342,15 @@ msgid ""
|
|
1328 |
"Please %2$supdate WooCommerce%3$s."
|
1329 |
msgstr ""
|
1330 |
|
1331 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1332 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1333 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1334 |
msgid ""
|
@@ -1336,7 +1358,7 @@ msgid ""
|
|
1336 |
"tokenization%3$s to activate %1$s for Subscriptions."
|
1337 |
msgstr ""
|
1338 |
|
1339 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1340 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1341 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1342 |
msgid ""
|
@@ -1344,13 +1366,13 @@ msgid ""
|
|
1344 |
"tokenization%3$s to activate %1$s for Pre-Orders."
|
1345 |
msgstr ""
|
1346 |
|
1347 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1348 |
msgid ""
|
1349 |
"You must enable tokenization for this gateway in order to support automatic "
|
1350 |
"renewal payments with the WooCommerce Subscriptions extension."
|
1351 |
msgstr ""
|
1352 |
|
1353 |
-
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:
|
1354 |
msgid "Inactive"
|
1355 |
msgstr ""
|
1356 |
|
@@ -1370,296 +1392,292 @@ msgstr ""
|
|
1370 |
msgid "Expiry Date"
|
1371 |
msgstr ""
|
1372 |
|
1373 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1374 |
msgid "you successfully processed a payment!"
|
1375 |
msgstr ""
|
1376 |
|
1377 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1378 |
msgid "you successfully processed a refund!"
|
1379 |
msgstr ""
|
1380 |
|
1381 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1382 |
msgid "Check Number is missing"
|
1383 |
msgstr ""
|
1384 |
|
1385 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1386 |
msgid "Drivers license state is missing"
|
1387 |
msgstr ""
|
1388 |
|
1389 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1390 |
msgid "Drivers license number is missing"
|
1391 |
msgstr ""
|
1392 |
|
1393 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1394 |
msgid "Continue to Payment"
|
1395 |
msgstr ""
|
1396 |
|
1397 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1398 |
msgid "Place order"
|
1399 |
msgstr ""
|
1400 |
|
1401 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1402 |
msgid "Thank you for your order."
|
1403 |
msgstr ""
|
1404 |
|
1405 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1406 |
msgid "Credit Card"
|
1407 |
msgstr ""
|
1408 |
|
1409 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1410 |
msgid "eCheck"
|
1411 |
msgstr ""
|
1412 |
|
1413 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1414 |
msgid "Pay securely using your credit card."
|
1415 |
msgstr ""
|
1416 |
|
1417 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1418 |
msgid "Pay securely using your checking account."
|
1419 |
msgstr ""
|
1420 |
|
1421 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1422 |
msgid "Enable this gateway"
|
1423 |
msgstr ""
|
1424 |
|
1425 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1426 |
-
msgid "Title"
|
1427 |
-
msgstr ""
|
1428 |
-
|
1429 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:1198
|
1430 |
msgid "Payment method title that the customer will see during checkout."
|
1431 |
msgstr ""
|
1432 |
|
1433 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1434 |
msgid "Description"
|
1435 |
msgstr ""
|
1436 |
|
1437 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1438 |
msgid "Payment method description that the customer will see during checkout."
|
1439 |
msgstr ""
|
1440 |
|
1441 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1442 |
msgid "Detailed Decline Messages"
|
1443 |
msgstr ""
|
1444 |
|
1445 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1446 |
msgid ""
|
1447 |
"Check to enable detailed decline messages to the customer during checkout "
|
1448 |
"when possible, rather than a generic decline message."
|
1449 |
msgstr ""
|
1450 |
|
1451 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1452 |
#. translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag
|
1453 |
msgid ""
|
1454 |
"Show Detailed Error Messages and API requests/responses on the checkout "
|
1455 |
"page and/or save them to the %1$sdebug log%2$s"
|
1456 |
msgstr ""
|
1457 |
|
1458 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1459 |
msgid "Show on Checkout Page"
|
1460 |
msgstr ""
|
1461 |
|
1462 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1463 |
#. translators: show debugging information on both checkout page and in the log
|
1464 |
msgid "Both"
|
1465 |
msgstr ""
|
1466 |
|
1467 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1468 |
msgid "Select the gateway environment to use for transactions."
|
1469 |
msgstr ""
|
1470 |
|
1471 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1472 |
msgid "Share connection settings"
|
1473 |
msgstr ""
|
1474 |
|
1475 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1476 |
msgid "Use connection/authentication settings from other gateway"
|
1477 |
msgstr ""
|
1478 |
|
1479 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1480 |
msgid "Disabled because the other gateway is using these settings"
|
1481 |
msgstr ""
|
1482 |
|
1483 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1484 |
msgid "Card Verification (CSC)"
|
1485 |
msgstr ""
|
1486 |
|
1487 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1488 |
msgid "Display the Card Security Code (CV2) field on checkout"
|
1489 |
msgstr ""
|
1490 |
|
1491 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1492 |
msgid "Saved Card Verification"
|
1493 |
msgstr ""
|
1494 |
|
1495 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1496 |
msgid "Display the Card Security Code field when paying with a saved card"
|
1497 |
msgstr ""
|
1498 |
|
1499 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1500 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1501 |
msgid "%1$s - Order %2$s"
|
1502 |
msgstr ""
|
1503 |
|
1504 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1505 |
#. translators: Placeholders: %1$s - site title, %2$s - order number.
|
1506 |
#. Definitions: Capture as in capture funds from a credit card.
|
1507 |
msgid "%1$s - Capture for Order %2$s"
|
1508 |
msgstr ""
|
1509 |
|
1510 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1511 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1512 |
msgid "%1$s - Refund for Order %2$s"
|
1513 |
msgstr ""
|
1514 |
|
1515 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1516 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1517 |
#. Authorize.net, Braintree, etc), %2$s - a monetary amount
|
1518 |
msgid "%1$s Refund in the amount of %2$s approved."
|
1519 |
msgstr ""
|
1520 |
|
1521 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1522 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1523 |
#. Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message
|
1524 |
msgid "%1$s Refund Failed: %2$s - %3$s"
|
1525 |
msgstr ""
|
1526 |
|
1527 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1528 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1529 |
#. Authorize.net, Braintree, etc), %2$s - error message
|
1530 |
msgid "%1$s Refund Failed: %2$s"
|
1531 |
msgstr ""
|
1532 |
|
1533 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1534 |
#. translators: Placeholders: %s - payment gateway title (such as
|
1535 |
#. Authorize.net, Braintree, etc)
|
1536 |
msgid "%s Order completely refunded."
|
1537 |
msgstr ""
|
1538 |
|
1539 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1540 |
msgid ""
|
1541 |
"Oops, you cannot partially void this order. Please use the full order "
|
1542 |
"amount."
|
1543 |
msgstr ""
|
1544 |
|
1545 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1546 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error code,
|
1547 |
#. %3$s - error message. Void as in to void an order.
|
1548 |
msgid "%1$s Void Failed: %2$s - %3$s"
|
1549 |
msgstr ""
|
1550 |
|
1551 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1552 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1553 |
#. message. Void as in to void an order.
|
1554 |
msgid "%1$s Void Failed: %2$s"
|
1555 |
msgstr ""
|
1556 |
|
1557 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1558 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary
|
1559 |
#. amount. Void as in to void an order.
|
1560 |
msgid "%1$s Void in the amount of %2$s approved."
|
1561 |
msgstr ""
|
1562 |
|
1563 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1564 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1565 |
#. ("Test"), %3$s - transaction type (authorization/charge)
|
1566 |
msgid "%1$s %2$s %3$s Approved"
|
1567 |
msgstr ""
|
1568 |
|
1569 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1570 |
#. translators: Placeholders: %1$s - credit card type (MasterCard, Visa,
|
1571 |
#. etc...), %2$s - last four digits of the card
|
1572 |
msgid "%1$s ending in %2$s"
|
1573 |
msgstr ""
|
1574 |
|
1575 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1576 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - message
|
1577 |
#. (probably reason for the transaction being held for review)
|
1578 |
msgid "%1$s Transaction Held for Review (%2$s)"
|
1579 |
msgstr ""
|
1580 |
|
1581 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1582 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1583 |
#. message; e.g. Order Note: [Payment method] Payment failed [error]
|
1584 |
msgid "%1$s Payment Failed (%2$s)"
|
1585 |
msgstr ""
|
1586 |
|
1587 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1588 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s -
|
1589 |
#. message/error
|
1590 |
msgid "%1$s Transaction Cancelled (%2$s)"
|
1591 |
msgstr ""
|
1592 |
|
1593 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1594 |
msgid "Transaction Type"
|
1595 |
msgstr ""
|
1596 |
|
1597 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1598 |
msgid ""
|
1599 |
"Select how transactions should be processed. Charge submits all "
|
1600 |
"transactions for settlement, Authorization simply authorizes the order "
|
1601 |
"total for capture later."
|
1602 |
msgstr ""
|
1603 |
|
1604 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1605 |
msgid "Charge Virtual-Only Orders"
|
1606 |
msgstr ""
|
1607 |
|
1608 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1609 |
msgid ""
|
1610 |
"If the order contains exclusively virtual items, enable this to immediately "
|
1611 |
"charge, rather than authorize, the transaction."
|
1612 |
msgstr ""
|
1613 |
|
1614 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1615 |
msgid "Enable Partial Capture"
|
1616 |
msgstr ""
|
1617 |
|
1618 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1619 |
msgid "Allow orders to be partially captured multiple times."
|
1620 |
msgstr ""
|
1621 |
|
1622 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1623 |
msgid "Capture Paid Orders"
|
1624 |
msgstr ""
|
1625 |
|
1626 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1627 |
msgid "Automatically capture orders when they are changed to %s."
|
1628 |
msgstr ""
|
1629 |
|
1630 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1631 |
msgid "a paid status"
|
1632 |
msgstr ""
|
1633 |
|
1634 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1635 |
msgid "Accepted Card Logos"
|
1636 |
msgstr ""
|
1637 |
|
1638 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1639 |
msgid ""
|
1640 |
"These are the card logos that are displayed to customers as accepted during "
|
1641 |
"checkout."
|
1642 |
msgstr ""
|
1643 |
|
1644 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1645 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag
|
1646 |
msgid ""
|
1647 |
"This setting %1$sdoes not%2$s change which card types the gateway will "
|
1648 |
"accept. Accepted cards are configured from your payment processor account."
|
1649 |
msgstr ""
|
1650 |
|
1651 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1652 |
#. translators:
|
1653 |
#. http:www.cybersource.com/products/payment_security/payment_tokenization/ and
|
1654 |
#. https:en.wikipedia.org/wiki/Tokenization_(data_security)
|
1655 |
msgid "Tokenization"
|
1656 |
msgstr ""
|
1657 |
|
1658 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1659 |
msgid "Allow customers to securely save their payment details for future checkout."
|
1660 |
msgstr ""
|
1661 |
|
1662 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1663 |
#. translators: %1$s - gateway name, %2$s - <a> tag, %3$s - </a> tag, %4$s -
|
1664 |
#. <a> tag, %5$s - </a> tag
|
1665 |
msgid ""
|
@@ -1691,44 +1709,42 @@ msgstr ""
|
|
1691 |
msgid "Pre-Order Release Payment Failed: %s"
|
1692 |
msgstr ""
|
1693 |
|
1694 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1695 |
msgid "Subscription Renewal: payment token is missing/invalid."
|
1696 |
msgstr ""
|
1697 |
|
1698 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1699 |
msgid "%1$s - Subscription Renewal Order %2$s"
|
1700 |
msgstr ""
|
1701 |
|
1702 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1703 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1704 |
#. message; e.g. Order Note: [Payment method] Payment Change failed [error]
|
1705 |
msgid "%1$s Payment Change Failed (%2$s)"
|
1706 |
msgstr ""
|
1707 |
|
1708 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1709 |
msgid "Via %s ending in %s"
|
1710 |
msgstr ""
|
1711 |
|
1712 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1713 |
msgid "Subscriptions"
|
1714 |
msgstr ""
|
1715 |
|
1716 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1717 |
-
msgid ""
|
1718 |
-
"This payment method is tied to a subscription and cannot be deleted. Please "
|
1719 |
-
"switch the subscription to another method first."
|
1720 |
msgstr ""
|
1721 |
|
1722 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1723 |
msgid "Payment Token"
|
1724 |
msgstr ""
|
1725 |
|
1726 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1727 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
1728 |
msgid "%s is required."
|
1729 |
msgstr ""
|
1730 |
|
1731 |
-
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:
|
1732 |
msgid "Unknown Error"
|
1733 |
msgstr ""
|
1734 |
|
@@ -1846,52 +1862,52 @@ msgid ""
|
|
1846 |
"has loopback connections enabled."
|
1847 |
msgstr ""
|
1848 |
|
1849 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1850 |
msgctxt "enhanced select"
|
1851 |
msgid "No matches found"
|
1852 |
msgstr ""
|
1853 |
|
1854 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1855 |
msgctxt "enhanced select"
|
1856 |
msgid "Loading failed"
|
1857 |
msgstr ""
|
1858 |
|
1859 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1860 |
msgctxt "enhanced select"
|
1861 |
msgid "Please enter 1 or more characters"
|
1862 |
msgstr ""
|
1863 |
|
1864 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1865 |
msgctxt "enhanced select"
|
1866 |
msgid "Please enter %qty% or more characters"
|
1867 |
msgstr ""
|
1868 |
|
1869 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1870 |
msgctxt "enhanced select"
|
1871 |
msgid "Please delete 1 character"
|
1872 |
msgstr ""
|
1873 |
|
1874 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1875 |
msgctxt "enhanced select"
|
1876 |
msgid "Please delete %qty% characters"
|
1877 |
msgstr ""
|
1878 |
|
1879 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1880 |
msgctxt "enhanced select"
|
1881 |
msgid "You can only select 1 item"
|
1882 |
msgstr ""
|
1883 |
|
1884 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1885 |
msgctxt "enhanced select"
|
1886 |
msgid "You can only select %qty% items"
|
1887 |
msgstr ""
|
1888 |
|
1889 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1890 |
msgctxt "enhanced select"
|
1891 |
msgid "Loading more results…"
|
1892 |
msgstr ""
|
1893 |
|
1894 |
-
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:
|
1895 |
msgctxt "enhanced select"
|
1896 |
msgid "Searching…"
|
1897 |
msgstr ""
|
@@ -1901,32 +1917,32 @@ msgctxt "coordinating conjunction for a list of items: a, b, and c"
|
|
1901 |
msgid "and"
|
1902 |
msgstr ""
|
1903 |
|
1904 |
-
#: class-sv-wc-plugin.php:
|
1905 |
msgctxt "noun"
|
1906 |
msgid "Support"
|
1907 |
msgstr ""
|
1908 |
|
1909 |
-
#: class-sv-wc-plugin.php:
|
1910 |
msgctxt "verb"
|
1911 |
msgid "Review"
|
1912 |
msgstr ""
|
1913 |
|
1914 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1915 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1916 |
msgctxt "noun, software environment"
|
1917 |
msgid "Test"
|
1918 |
msgstr ""
|
1919 |
|
1920 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1921 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1922 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1923 |
msgctxt "credit card transaction type"
|
1924 |
msgid "Authorization"
|
1925 |
msgstr ""
|
1926 |
|
1927 |
-
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:
|
1928 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1929 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1930 |
msgctxt "noun, credit card transaction type"
|
1931 |
msgid "Charge"
|
1932 |
msgstr ""
|
@@ -1937,19 +1953,19 @@ msgid "Account"
|
|
1937 |
msgstr ""
|
1938 |
|
1939 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:229
|
1940 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1941 |
msgctxt "credit card type"
|
1942 |
msgid "Visa"
|
1943 |
msgstr ""
|
1944 |
|
1945 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:233
|
1946 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1947 |
msgctxt "credit card type"
|
1948 |
msgid "MasterCard"
|
1949 |
msgstr ""
|
1950 |
|
1951 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:237
|
1952 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1953 |
msgctxt "credit card type"
|
1954 |
msgid "American Express"
|
1955 |
msgstr ""
|
@@ -1960,13 +1976,13 @@ msgid "Diners Club"
|
|
1960 |
msgstr ""
|
1961 |
|
1962 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:245
|
1963 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1964 |
msgctxt "credit card type"
|
1965 |
msgid "Discover"
|
1966 |
msgstr ""
|
1967 |
|
1968 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:249
|
1969 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1970 |
msgctxt "credit card type"
|
1971 |
msgid "JCB"
|
1972 |
msgstr ""
|
@@ -1986,7 +2002,7 @@ msgctxt "credit card type"
|
|
1986 |
msgid "Laser"
|
1987 |
msgstr ""
|
1988 |
|
1989 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
1990 |
msgctxt "credit card type"
|
1991 |
msgid "Diners"
|
1992 |
msgstr ""
|
@@ -2003,24 +2019,24 @@ msgctxt "account type"
|
|
2003 |
msgid "Savings"
|
2004 |
msgstr ""
|
2005 |
|
2006 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2007 |
msgctxt "hash before order number"
|
2008 |
msgid "#"
|
2009 |
msgstr ""
|
2010 |
|
2011 |
-
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:
|
2012 |
msgctxt "hash before order number"
|
2013 |
msgid "#%s"
|
2014 |
msgstr ""
|
2015 |
|
2016 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2017 |
msgctxt ""
|
2018 |
"coordinating conjunction for a list of order statuses: on-hold, processing, "
|
2019 |
"or completed"
|
2020 |
msgid "or"
|
2021 |
msgstr ""
|
2022 |
|
2023 |
-
#: payment-gateway/class-sv-wc-payment-gateway.php:
|
2024 |
#. translators: https:www.skyverge.com/for-translators-environments/
|
2025 |
msgctxt "software environment"
|
2026 |
msgid "Production"
|
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.5\n"
|
6 |
"Report-Msgid-Bugs-To: https://support.woocommerce.com/hc/\n"
|
7 |
"POT-Creation-Date: 2015-07-22 12:09:16+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
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 |
|
62 |
msgid "%s › Setup"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:350
|
66 |
msgid "Oops! An error occurred, please try again."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:488
|
70 |
msgid "Ready!"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:581
|
74 |
#. translators: Placeholder: %s - plugin name
|
75 |
msgid "Welcome to %s!"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:594
|
79 |
msgid ""
|
80 |
"This quick setup wizard will help you configure the basic settings and get "
|
81 |
"you started."
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:608
|
85 |
msgid "%s is ready!"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:660
|
89 |
msgid "Next step"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:686
|
93 |
msgid "You can also:"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:730
|
97 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:760
|
98 |
msgid "View the Docs"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:731
|
102 |
msgid "See more setup options"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:732
|
106 |
msgid "Learn more about customizing the plugin"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:756
|
110 |
msgid "Review Your Settings"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:764
|
114 |
msgid "Leave a Review"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:788
|
118 |
msgid "Continue"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:948
|
122 |
msgid "Return to the WordPress Dashboard"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:950
|
126 |
msgid "Not right now"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:952
|
130 |
msgid "Skip this step"
|
131 |
msgstr ""
|
132 |
|
173 |
msgid "Please %1$supdate WooCommerce%2$s"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: class-sv-wc-plugin-compatibility.php:349
|
177 |
msgid "WooCommerce"
|
178 |
msgstr ""
|
179 |
|
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 ""
|
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 ""
|
273 |
|
274 |
+
#: payment-gateway/External_Checkout/Admin.php:137
|
275 |
+
#: payment-gateway/External_Checkout/Admin.php:147
|
276 |
+
msgid "Processing Gateway"
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
#: payment-gateway/External_Checkout/Admin.php:287
|
280 |
+
msgid "Single products"
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: payment-gateway/External_Checkout/Admin.php:288
|
284 |
+
msgid "Cart"
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: payment-gateway/External_Checkout/Admin.php:289
|
288 |
+
msgid "Checkout"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: payment-gateway/External_Checkout/Admin.php:330
|
292 |
+
#. translators: Placeholder: %s - external checkout label
|
293 |
+
msgid "%s is disabled."
|
294 |
+
msgstr ""
|
295 |
+
|
296 |
+
#: payment-gateway/External_Checkout/Admin.php:394
|
297 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
298 |
+
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a>
|
299 |
+
#. tag, %5$s - external checkout label
|
300 |
+
msgid ""
|
301 |
+
"Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s "
|
302 |
+
"to enable %4$s."
|
303 |
+
msgid_plural ""
|
304 |
+
"Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to "
|
305 |
+
"accept one of %1$s to enable %4$s."
|
306 |
+
msgstr[0] ""
|
307 |
+
msgstr[1] ""
|
308 |
+
|
309 |
+
#: payment-gateway/External_Checkout/Admin.php:436
|
310 |
+
msgid ""
|
311 |
+
"%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the "
|
312 |
+
"shipping address, but %1$s %4$sdoes not%5$s share customer shipping "
|
313 |
+
"information with your store for orders with only virtual products. These "
|
314 |
+
"orders will have their taxes calculated based on the shop address instead."
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: payment-gateway/External_Checkout/Admin.php:470
|
318 |
+
msgid ""
|
319 |
+
"%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the "
|
320 |
+
"billing address, but %1$s %4$sdoes not%5$s share the customer billing "
|
321 |
+
"address with your store before payment. These orders will have their taxes "
|
322 |
+
"calculated based on the shipping address (or shop address, for orders with "
|
323 |
+
"only virtual products)."
|
324 |
+
msgstr ""
|
325 |
+
|
326 |
+
#: payment-gateway/External_Checkout/Frontend.php:259
|
327 |
+
msgid "or"
|
328 |
+
msgstr ""
|
329 |
+
|
330 |
+
#: payment-gateway/External_Checkout/Frontend.php:293
|
331 |
+
msgid "By submitting your payment, you agree to our %1$sterms and conditions%2$s."
|
332 |
+
msgstr ""
|
333 |
+
|
334 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:71
|
335 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:87
|
336 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:66
|
337 |
+
msgid "Google Pay"
|
338 |
+
msgstr ""
|
339 |
+
|
340 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:93
|
341 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:93
|
342 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1262
|
343 |
+
msgid "Enable / Disable"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:94
|
347 |
+
msgid "Accept Google Pay"
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:101
|
351 |
+
msgid "Allow Google Pay on"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:111
|
355 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:111
|
356 |
+
msgid "Button Style"
|
357 |
+
msgstr ""
|
358 |
+
|
359 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:114
|
360 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:114
|
361 |
+
msgid "Black"
|
362 |
+
msgstr ""
|
363 |
+
|
364 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:115
|
365 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:115
|
366 |
+
msgid "White"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:148
|
370 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:150
|
371 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1440
|
372 |
+
msgid "Connection Settings"
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:157
|
376 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:188
|
377 |
+
msgid "Test Mode"
|
378 |
+
msgstr ""
|
379 |
+
|
380 |
+
#: payment-gateway/External_Checkout/Google_Pay/Admin.php:158
|
381 |
+
msgid ""
|
382 |
+
"Enable to test Google Pay functionality throughout your sites without "
|
383 |
+
"processing real payments."
|
384 |
+
msgstr ""
|
385 |
+
|
386 |
+
#: payment-gateway/External_Checkout/Google_Pay/Frontend.php:130
|
387 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:141
|
388 |
+
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:99
|
389 |
+
msgid "An error occurred, please try again or try an alternate form of payment"
|
390 |
+
msgstr ""
|
391 |
+
|
392 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:255
|
393 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:380
|
394 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:539
|
395 |
+
msgid "Subtotal"
|
396 |
+
msgstr ""
|
397 |
+
|
398 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:390
|
399 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:549
|
400 |
+
msgid "Discount"
|
401 |
+
msgstr ""
|
402 |
+
|
403 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:400
|
404 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:559
|
405 |
+
msgid "Shipping"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:410
|
409 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:569
|
410 |
+
msgid "Fees"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:420
|
414 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:579
|
415 |
+
msgid "Taxes"
|
416 |
+
msgstr ""
|
417 |
+
|
418 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:463
|
419 |
+
msgid "Google Pay payment authorized."
|
420 |
+
msgstr ""
|
421 |
+
|
422 |
+
#: payment-gateway/External_Checkout/Google_Pay/Google_Pay.php:538
|
423 |
+
msgid "Google Pay payment failed. %s"
|
424 |
+
msgstr ""
|
425 |
+
|
426 |
+
#: payment-gateway/External_Checkout/Orders.php:140
|
427 |
+
#: payment-gateway/External_Checkout/Orders.php:153
|
428 |
+
#: payment-gateway/External_Checkout/Orders.php:157
|
429 |
+
msgid "Error %d: Unable to create order. Please try again."
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:71
|
433 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:87
|
434 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:65
|
435 |
+
msgid "Apple Pay"
|
436 |
+
msgstr ""
|
437 |
+
|
438 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:94
|
439 |
+
msgid "Accept Apple Pay"
|
440 |
+
msgstr ""
|
441 |
+
|
442 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:101
|
443 |
+
msgid "Allow Apple Pay on"
|
444 |
+
msgstr ""
|
445 |
+
|
446 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:116
|
447 |
+
msgid "White with outline"
|
448 |
+
msgstr ""
|
449 |
+
|
450 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:159
|
451 |
+
msgid "Apple Merchant ID"
|
452 |
+
msgstr ""
|
453 |
+
|
454 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:163
|
455 |
+
msgid "This is found in your %1$sApple developer account%2$s"
|
456 |
+
msgstr ""
|
457 |
+
|
458 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:173
|
459 |
+
msgid "Certificate Path"
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:178
|
463 |
+
#. translators: Placeholders: %s - the server's web root path
|
464 |
+
msgid "For reference, your current web root path is: %s"
|
465 |
+
msgstr ""
|
466 |
+
|
467 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:189
|
468 |
+
msgid ""
|
469 |
+
"Enable to test Apple Pay functionality throughout your sites without "
|
470 |
+
"processing real payments."
|
471 |
+
msgstr ""
|
472 |
+
|
473 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:228
|
474 |
+
msgid "Your site must be served over HTTPS with a valid SSL certificate."
|
475 |
+
msgstr ""
|
476 |
+
|
477 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php:238
|
478 |
+
msgid ""
|
479 |
+
"Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check "
|
480 |
+
"your path configuration."
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php:176
|
484 |
+
msgid "Buy with"
|
485 |
+
msgstr ""
|
486 |
+
|
487 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:152
|
488 |
+
msgid "Apple Pay payment authorized."
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:186
|
492 |
+
msgid "Apple Pay payment failed. %s"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:179
|
496 |
msgid ""
|
497 |
"There was a problem processing your order and it is being placed on hold "
|
499 |
msgstr ""
|
500 |
|
501 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:217
|
502 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2889
|
503 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:512
|
504 |
msgid "An error occurred, please try again or try an alternate form of payment."
|
505 |
msgstr ""
|
506 |
|
507 |
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
|
508 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:449
|
509 |
#. translators: Placeholders: %s - a WooCommerce order ID
|
510 |
msgid "Could not find order %s"
|
511 |
msgstr ""
|
512 |
|
513 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:152
|
514 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2482
|
515 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:173
|
516 |
#. translators: Placeholders: %1$s - status code, %2$s - status message
|
517 |
#. translators: Placeholders: %1$s - payment request response status code, %2$s
|
518 |
#. - payment request response status message
|
520 |
msgstr ""
|
521 |
|
522 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:155
|
523 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2485
|
524 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:176
|
525 |
#. translators: Placeholders: %s - status code
|
526 |
#. translators: Placeholders: %s - payment request response status code
|
527 |
msgid "Status code: %s"
|
528 |
msgstr ""
|
529 |
|
530 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:158
|
531 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2488
|
532 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:179
|
533 |
#. translators: Placeholders; %s - status message
|
534 |
#. translators: Placeholders: %s - payment request response status message
|
535 |
msgid "Status message: %s"
|
536 |
msgstr ""
|
537 |
|
538 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:163
|
539 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2493
|
540 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:186
|
541 |
msgid "Transaction ID %s"
|
542 |
msgstr ""
|
543 |
|
544 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
|
545 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:513
|
546 |
#. translators: Placeholders: %s - payment gateway title (such as
|
547 |
#. Authorize.net, Braintree, etc)
|
548 |
msgid "%s duplicate transaction received"
|
549 |
msgstr ""
|
550 |
|
551 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
|
552 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:516
|
553 |
msgid "Order %s is already paid for."
|
554 |
msgstr ""
|
555 |
|
556 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:267
|
557 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2825
|
558 |
msgid ""
|
559 |
"Your order has been received and is being reviewed. Thank you for your "
|
560 |
"business."
|
561 |
msgstr ""
|
562 |
|
563 |
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:274
|
564 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:864
|
565 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1860
|
566 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:370
|
567 |
#. translators: This is a message describing that the transaction in question
|
568 |
#. only performed a credit card authorization and did not capture any funds.
|
608 |
msgstr ""
|
609 |
|
610 |
#: payment-gateway/Handlers/Capture.php:198
|
611 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:683
|
612 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:768
|
613 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2161
|
614 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2394
|
615 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2706
|
616 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2751
|
617 |
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:353
|
618 |
#. translators: Placeholders: %s - transaction ID
|
619 |
msgid "(Transaction ID %s)"
|
670 |
msgid "An error occurred. Please try again."
|
671 |
msgstr ""
|
672 |
|
673 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:491
|
674 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:305
|
675 |
msgid "(%s)"
|
676 |
msgstr ""
|
677 |
|
678 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:521
|
679 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:900
|
680 |
msgid "Default"
|
681 |
msgstr ""
|
682 |
|
683 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:557
|
684 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:590
|
685 |
msgid "Token ID"
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:562
|
689 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:300
|
690 |
msgid "Card Type"
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:567
|
694 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:603
|
695 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:192
|
696 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:298
|
697 |
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"
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:598
|
713 |
msgid "Checking"
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:599
|
717 |
msgid "Savings"
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:700
|
721 |
msgid "Refresh"
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:702
|
725 |
msgid "Add New"
|
726 |
msgstr ""
|
727 |
|
728 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:705
|
729 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:297
|
730 |
msgid "Save"
|
731 |
msgstr ""
|
732 |
|
733 |
+
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:728
|
734 |
msgid "Remove"
|
735 |
msgstr ""
|
736 |
|
740 |
msgstr ""
|
741 |
|
742 |
#: payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:302
|
743 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:841
|
744 |
msgid "Customer ID"
|
745 |
msgstr ""
|
746 |
|
749 |
msgstr ""
|
750 |
|
751 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:53
|
752 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1389
|
753 |
#. translators: environment as in a software environment (test/production)
|
754 |
msgid "Environment"
|
755 |
msgstr ""
|
767 |
msgstr ""
|
768 |
|
769 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:75
|
770 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1316
|
771 |
msgid "Debug Mode"
|
772 |
msgstr ""
|
773 |
|
784 |
msgstr ""
|
785 |
|
786 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:83
|
787 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1324
|
788 |
msgid "Save to Log"
|
789 |
msgstr ""
|
790 |
|
791 |
#: payment-gateway/admin/views/html-admin-gateway-status.php:85
|
792 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1322
|
793 |
msgid "Off"
|
794 |
msgstr ""
|
795 |
|
818 |
msgstr ""
|
819 |
|
820 |
#: payment-gateway/admin/views/html-order-partial-capture.php:66
|
821 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:608
|
822 |
msgid "Cancel"
|
823 |
msgstr ""
|
824 |
|
825 |
+
#: payment-gateway/admin/views/html-user-payment-token-editor-token.php:57
|
826 |
msgid "-- Select an option --"
|
827 |
msgstr ""
|
828 |
|
834 |
msgid "The gateway customer ID for the user. Only edit this if necessary."
|
835 |
msgstr ""
|
836 |
|
|
|
|
|
|
|
|
|
|
|
837 |
#: payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:100
|
838 |
msgid ""
|
839 |
"We cannot process your order with the payment information that you "
|
950 |
"Please verify the address and try again."
|
951 |
msgstr ""
|
952 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
953 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:61
|
954 |
msgid ""
|
955 |
"Payment error, please try another payment method or contact us to complete "
|
957 |
msgstr ""
|
958 |
|
959 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:161
|
960 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:503
|
961 |
msgid "Card expiration date is invalid"
|
962 |
msgstr ""
|
963 |
|
964 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:185
|
965 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:496
|
966 |
msgid "Card number is missing"
|
967 |
msgstr ""
|
968 |
|
969 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:191
|
970 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:499
|
971 |
msgid "Card number is invalid (wrong length)"
|
972 |
msgstr ""
|
973 |
|
974 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:196
|
975 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:498
|
976 |
msgid "Card number is invalid (only digits allowed)"
|
977 |
msgstr ""
|
978 |
|
979 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:201
|
980 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:497
|
981 |
msgid "Card number is invalid"
|
982 |
msgstr ""
|
983 |
|
984 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:228
|
985 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:501
|
986 |
msgid "Card security code is invalid (only digits are allowed)"
|
987 |
msgstr ""
|
988 |
|
989 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:234
|
990 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:502
|
991 |
msgid "Card security code is invalid (must be 3 or 4 digits)"
|
992 |
msgstr ""
|
993 |
|
994 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:240
|
995 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:500
|
996 |
msgid "Card security code is missing"
|
997 |
msgstr ""
|
998 |
|
999 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:267
|
1000 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:512
|
1001 |
msgid "Routing Number is missing"
|
1002 |
msgstr ""
|
1003 |
|
1004 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:274
|
1005 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:513
|
1006 |
msgid "Routing Number is invalid (only digits are allowed)"
|
1007 |
msgstr ""
|
1008 |
|
1009 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:280
|
1010 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:514
|
1011 |
msgid "Routing number is invalid (must be 9 digits)"
|
1012 |
msgstr ""
|
1013 |
|
1014 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:289
|
1015 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:509
|
1016 |
msgid "Account Number is missing"
|
1017 |
msgstr ""
|
1018 |
|
1019 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:296
|
1020 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:510
|
1021 |
msgid "Account Number is invalid (only digits are allowed)"
|
1022 |
msgstr ""
|
1023 |
|
1024 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:302
|
1025 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:511
|
1026 |
msgid "Account number is invalid (must be between 5 and 17 digits)"
|
1027 |
msgstr ""
|
1028 |
|
1029 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:309
|
1030 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:508
|
1031 |
msgid "Drivers license number is invalid"
|
1032 |
msgstr ""
|
1033 |
|
1034 |
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:315
|
1035 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:504
|
1036 |
msgid "Check Number is invalid (only digits are allowed)"
|
1037 |
msgstr ""
|
1038 |
|
1044 |
msgid "Payment method address could not be updated. %s"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:673
|
1048 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2741
|
1049 |
#. translators: Placeholders: %1$s - payment method title, %2$s - payment
|
1050 |
#. account type (savings/checking) (may or may not be available), %3$s - last
|
1051 |
#. four digits of the account
|
1052 |
msgid "%1$s Check Transaction Approved: %2$s account ending in %3$s"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:678
|
1056 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2746
|
1057 |
#. translators: Placeholders: %s - check number
|
1058 |
msgid "Check number %s"
|
1059 |
msgstr ""
|
1060 |
|
1061 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:747
|
1062 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1063 |
#. ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type
|
1064 |
#. (mastercard, visa, ...), %5$s - last four digits of the card
|
1065 |
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)"
|
1073 |
msgstr ""
|
1074 |
|
1075 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:832
|
1076 |
#. translators: Placeholders: %s - failure message
|
1077 |
msgid "Tokenization Request Failed: %s"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:843
|
1081 |
#. translators: Placeholders: %1$s - payment method title, %2$s - failure
|
1082 |
#. message
|
1083 |
msgid "%1$s Tokenization Request Failed: %2$s"
|
1084 |
msgstr ""
|
1085 |
|
1086 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:901
|
1087 |
#. translators: Placeholders: %s - failure message. Payment method as in a
|
1088 |
#. specific credit card, e-check or bank account
|
1089 |
msgid "Oops, adding your new payment method failed: %s"
|
1090 |
msgstr ""
|
1091 |
|
1092 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:946
|
1093 |
#. translators: Payment method as in a specific credit card. Placeholders: %1$s
|
1094 |
#. - card type (visa, mastercard, ...), %2$s - last four digits of the card,
|
1095 |
#. %3$s - card expiry date
|
1096 |
msgid "Nice! New payment method added: %1$s ending in %2$s (expires %3$s)"
|
1097 |
msgstr ""
|
1098 |
|
1099 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:956
|
1100 |
#. translators: Payment method as in a specific e-check account. Placeholders:
|
1101 |
#. %1$s - account type (checking/savings), %2$s - last four digits of the
|
1102 |
#. account
|
1103 |
msgid "Nice! New payment method added: %1$s account ending in %2$s"
|
1104 |
msgstr ""
|
1105 |
|
1106 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:963
|
1107 |
#. translators: Payment method as in a specific credit card, e-check or bank
|
1108 |
#. account
|
1109 |
msgid "Nice! New payment method added."
|
1110 |
msgstr ""
|
1111 |
|
1112 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:1086
|
1113 |
#. translators: Placeholders: %1$s - site title, %2$s - customer email. Payment
|
1114 |
#. method as in a specific credit card, e-check or bank account
|
1115 |
msgid "%1$s - Add Payment Method for %2$s"
|
1135 |
msgid "Bank Account"
|
1136 |
msgstr ""
|
1137 |
|
1138 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:301
|
1139 |
msgid "Thank you for your order, please click the button below to pay."
|
1140 |
msgstr ""
|
1141 |
|
1142 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:302
|
1143 |
msgid "Thank you for your order. We are now redirecting you to complete payment."
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:303
|
1147 |
msgid "Pay Now"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:304
|
1151 |
msgid "Cancel Order"
|
1152 |
msgstr ""
|
1153 |
|
1154 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:601
|
1155 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1115
|
1156 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1157 |
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
|
1158 |
#. account, etc), %3$s - last four digits of the card/account, %4$s -
|
1160 |
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
|
1161 |
msgstr ""
|
1162 |
|
1163 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:612
|
1164 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1126
|
1165 |
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
|
1166 |
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
|
1167 |
#. available), %3$s - last four digits of the account
|
1168 |
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
|
1169 |
msgstr ""
|
1170 |
|
1171 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:621
|
1172 |
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
|
1173 |
#. NETbilling, etc)
|
1174 |
msgid "%s Payment Method Saved"
|
1175 |
msgstr ""
|
1176 |
|
1177 |
+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:630
|
1178 |
#. translators: Placeholders: %s - a failed tokenization API error
|
1179 |
msgid "Tokenization failed. %s"
|
1180 |
msgstr ""
|
1181 |
|
1182 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:293
|
1183 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:607
|
1184 |
msgid "Edit"
|
1185 |
msgstr ""
|
1186 |
|
1187 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:337
|
1188 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1269
|
1189 |
+
msgid "Title"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1190 |
msgstr ""
|
1191 |
|
1192 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:340
|
1193 |
msgid "Details"
|
1194 |
msgstr ""
|
1195 |
|
1196 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:343
|
|
|
|
|
|
|
|
|
1197 |
msgid "Default?"
|
1198 |
msgstr ""
|
1199 |
|
1200 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:609
|
1201 |
+
msgid "Oops, there was an error updating your payment method. Please try again."
|
|
|
|
|
|
|
|
|
1202 |
msgstr ""
|
1203 |
|
1204 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:610
|
1205 |
+
msgid "Are you sure you want to delete this payment method?"
|
1206 |
msgstr ""
|
1207 |
|
1208 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:697
|
1209 |
+
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1210 |
+
#. account
|
1211 |
+
msgid "You do not have any saved payment methods."
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:872
|
1215 |
#: payment-gateway/class-sv-wc-payment-gateway-privacy.php:200
|
1216 |
msgid "Nickname"
|
1217 |
msgstr ""
|
1218 |
|
1219 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1118
|
|
|
|
|
|
|
|
|
1220 |
msgid "Oops, you took too long, please try again."
|
1221 |
msgstr ""
|
1222 |
|
1223 |
+
#: payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:1129
|
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 ""
|
1287 |
msgid "Payment Info"
|
1288 |
msgstr ""
|
1289 |
|
1290 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:706
|
1291 |
#. translators: Placeholders: %1$s - plugin name, %2$s - <a> tag, %3$s - </a>
|
1292 |
#. tag
|
1293 |
msgid ""
|
1295 |
"data may be at risk. %2$sVerify your site URLs here%3$s"
|
1296 |
msgstr ""
|
1297 |
|
1298 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:723
|
1299 |
#. translators: Placeholders: %s - payment gateway name
|
1300 |
msgid ""
|
1301 |
"%s will soon require TLS 1.2 support to process transactions and your "
|
1304 |
"and request they make any necessary updates."
|
1305 |
msgstr ""
|
1306 |
|
1307 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:779
|
1308 |
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
1309 |
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
1310 |
msgid ""
|
1316 |
msgstr[0] ""
|
1317 |
msgstr[1] ""
|
1318 |
|
1319 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:814
|
1320 |
#. translators: Placeholders: %1$s - payment gateway name, %2$s - opening <a>
|
1321 |
#. tag, %3$s - closing </a> tag
|
1322 |
msgid ""
|
1325 |
"processing, we recommend %2$sturning off Debug Mode%3$s"
|
1326 |
msgstr ""
|
1327 |
|
1328 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:865
|
1329 |
#. translators: Placeholders: %s - gateway name
|
1330 |
msgid "%s is not configured"
|
1331 |
msgstr ""
|
1332 |
|
1333 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:877
|
1334 |
msgid "Dismiss"
|
1335 |
msgstr ""
|
1336 |
|
1337 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:914
|
1338 |
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1339 |
#. tag, %3$s - closing </a> HTML link tag
|
1340 |
msgid ""
|
1342 |
"Please %2$supdate WooCommerce%3$s."
|
1343 |
msgstr ""
|
1344 |
|
1345 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:938
|
1346 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link
|
1347 |
+
#. tag, %3$s - closing </a> HTML link tag
|
1348 |
+
msgid ""
|
1349 |
+
"Heads up! Google Pay for %1$s requires WooCommerce version 3.2 or greater. "
|
1350 |
+
"Please %2$supdate WooCommerce%3$s."
|
1351 |
+
msgstr ""
|
1352 |
+
|
1353 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:974
|
1354 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1355 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1356 |
msgid ""
|
1358 |
"tokenization%3$s to activate %1$s for Subscriptions."
|
1359 |
msgstr ""
|
1360 |
|
1361 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:992
|
1362 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1363 |
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1364 |
msgid ""
|
1366 |
"tokenization%3$s to activate %1$s for Pre-Orders."
|
1367 |
msgstr ""
|
1368 |
|
1369 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:1029
|
1370 |
msgid ""
|
1371 |
"You must enable tokenization for this gateway in order to support automatic "
|
1372 |
"renewal payments with the WooCommerce Subscriptions extension."
|
1373 |
msgstr ""
|
1374 |
|
1375 |
+
#: payment-gateway/class-sv-wc-payment-gateway-plugin.php:1030
|
1376 |
msgid "Inactive"
|
1377 |
msgstr ""
|
1378 |
|
1392 |
msgid "Expiry Date"
|
1393 |
msgstr ""
|
1394 |
|
1395 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:350
|
1396 |
msgid "you successfully processed a payment!"
|
1397 |
msgstr ""
|
1398 |
|
1399 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:355
|
1400 |
msgid "you successfully processed a refund!"
|
1401 |
msgstr ""
|
1402 |
|
1403 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:505
|
1404 |
msgid "Check Number is missing"
|
1405 |
msgstr ""
|
1406 |
|
1407 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:506
|
1408 |
msgid "Drivers license state is missing"
|
1409 |
msgstr ""
|
1410 |
|
1411 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:507
|
1412 |
msgid "Drivers license number is missing"
|
1413 |
msgstr ""
|
1414 |
|
1415 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:720
|
1416 |
msgid "Continue to Payment"
|
1417 |
msgstr ""
|
1418 |
|
1419 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:720
|
1420 |
msgid "Place order"
|
1421 |
msgstr ""
|
1422 |
|
1423 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:752
|
1424 |
msgid "Thank you for your order."
|
1425 |
msgstr ""
|
1426 |
|
1427 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1221
|
1428 |
msgid "Credit Card"
|
1429 |
msgstr ""
|
1430 |
|
1431 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1223
|
1432 |
msgid "eCheck"
|
1433 |
msgstr ""
|
1434 |
|
1435 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1241
|
1436 |
msgid "Pay securely using your credit card."
|
1437 |
msgstr ""
|
1438 |
|
1439 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1243
|
1440 |
msgid "Pay securely using your checking account."
|
1441 |
msgstr ""
|
1442 |
|
1443 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1263
|
1444 |
msgid "Enable this gateway"
|
1445 |
msgstr ""
|
1446 |
|
1447 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1271
|
|
|
|
|
|
|
|
|
1448 |
msgid "Payment method title that the customer will see during checkout."
|
1449 |
msgstr ""
|
1450 |
|
1451 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1276
|
1452 |
msgid "Description"
|
1453 |
msgstr ""
|
1454 |
|
1455 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1278
|
1456 |
msgid "Payment method description that the customer will see during checkout."
|
1457 |
msgstr ""
|
1458 |
|
1459 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1307
|
1460 |
msgid "Detailed Decline Messages"
|
1461 |
msgstr ""
|
1462 |
|
1463 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1309
|
1464 |
msgid ""
|
1465 |
"Check to enable detailed decline messages to the customer during checkout "
|
1466 |
"when possible, rather than a generic decline message."
|
1467 |
msgstr ""
|
1468 |
|
1469 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1319
|
1470 |
#. translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag
|
1471 |
msgid ""
|
1472 |
"Show Detailed Error Messages and API requests/responses on the checkout "
|
1473 |
"page and/or save them to the %1$sdebug log%2$s"
|
1474 |
msgstr ""
|
1475 |
|
1476 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1323
|
1477 |
msgid "Show on Checkout Page"
|
1478 |
msgstr ""
|
1479 |
|
1480 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1326
|
1481 |
#. translators: show debugging information on both checkout page and in the log
|
1482 |
msgid "Both"
|
1483 |
msgstr ""
|
1484 |
|
1485 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1392
|
1486 |
msgid "Select the gateway environment to use for transactions."
|
1487 |
msgstr ""
|
1488 |
|
1489 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1446
|
1490 |
msgid "Share connection settings"
|
1491 |
msgstr ""
|
1492 |
|
1493 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1448
|
1494 |
msgid "Use connection/authentication settings from other gateway"
|
1495 |
msgstr ""
|
1496 |
|
1497 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1451
|
1498 |
msgid "Disabled because the other gateway is using these settings"
|
1499 |
msgstr ""
|
1500 |
|
1501 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1468
|
1502 |
msgid "Card Verification (CSC)"
|
1503 |
msgstr ""
|
1504 |
|
1505 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1469
|
1506 |
msgid "Display the Card Security Code (CV2) field on checkout"
|
1507 |
msgstr ""
|
1508 |
|
1509 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1477
|
1510 |
msgid "Saved Card Verification"
|
1511 |
msgstr ""
|
1512 |
|
1513 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1478
|
1514 |
msgid "Display the Card Security Code field when paying with a saved card"
|
1515 |
msgstr ""
|
1516 |
|
1517 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1813
|
1518 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1519 |
msgid "%1$s - Order %2$s"
|
1520 |
msgstr ""
|
1521 |
|
1522 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:1942
|
1523 |
#. translators: Placeholders: %1$s - site title, %2$s - order number.
|
1524 |
#. Definitions: Capture as in capture funds from a credit card.
|
1525 |
msgid "%1$s - Capture for Order %2$s"
|
1526 |
msgstr ""
|
1527 |
|
1528 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2085
|
1529 |
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1530 |
msgid "%1$s - Refund for Order %2$s"
|
1531 |
msgstr ""
|
1532 |
|
1533 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2152
|
1534 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1535 |
#. Authorize.net, Braintree, etc), %2$s - a monetary amount
|
1536 |
msgid "%1$s Refund in the amount of %2$s approved."
|
1537 |
msgstr ""
|
1538 |
|
1539 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2182
|
1540 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1541 |
#. Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message
|
1542 |
msgid "%1$s Refund Failed: %2$s - %3$s"
|
1543 |
msgstr ""
|
1544 |
|
1545 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2190
|
1546 |
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1547 |
#. Authorize.net, Braintree, etc), %2$s - error message
|
1548 |
msgid "%1$s Refund Failed: %2$s"
|
1549 |
msgstr ""
|
1550 |
|
1551 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2211
|
1552 |
#. translators: Placeholders: %s - payment gateway title (such as
|
1553 |
#. Authorize.net, Braintree, etc)
|
1554 |
msgid "%s Order completely refunded."
|
1555 |
msgstr ""
|
1556 |
|
1557 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2266
|
1558 |
msgid ""
|
1559 |
"Oops, you cannot partially void this order. Please use the full order "
|
1560 |
"amount."
|
1561 |
msgstr ""
|
1562 |
|
1563 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2353
|
1564 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error code,
|
1565 |
#. %3$s - error message. Void as in to void an order.
|
1566 |
msgid "%1$s Void Failed: %2$s - %3$s"
|
1567 |
msgstr ""
|
1568 |
|
1569 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2361
|
1570 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1571 |
#. message. Void as in to void an order.
|
1572 |
msgid "%1$s Void Failed: %2$s"
|
1573 |
msgstr ""
|
1574 |
|
1575 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2385
|
1576 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary
|
1577 |
#. amount. Void as in to void an order.
|
1578 |
msgid "%1$s Void in the amount of %2$s approved."
|
1579 |
msgstr ""
|
1580 |
|
1581 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2677
|
1582 |
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
1583 |
#. ("Test"), %3$s - transaction type (authorization/charge)
|
1584 |
msgid "%1$s %2$s %3$s Approved"
|
1585 |
msgstr ""
|
1586 |
|
1587 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2687
|
1588 |
#. translators: Placeholders: %1$s - credit card type (MasterCard, Visa,
|
1589 |
#. etc...), %2$s - last four digits of the card
|
1590 |
msgid "%1$s ending in %2$s"
|
1591 |
msgstr ""
|
1592 |
|
1593 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2783
|
1594 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - message
|
1595 |
#. (probably reason for the transaction being held for review)
|
1596 |
msgid "%1$s Transaction Held for Review (%2$s)"
|
1597 |
msgstr ""
|
1598 |
|
1599 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2872
|
1600 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1601 |
#. message; e.g. Order Note: [Payment method] Payment failed [error]
|
1602 |
msgid "%1$s Payment Failed (%2$s)"
|
1603 |
msgstr ""
|
1604 |
|
1605 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2907
|
1606 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s -
|
1607 |
#. message/error
|
1608 |
msgid "%1$s Transaction Cancelled (%2$s)"
|
1609 |
msgstr ""
|
1610 |
|
1611 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3155
|
1612 |
msgid "Transaction Type"
|
1613 |
msgstr ""
|
1614 |
|
1615 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3157
|
1616 |
msgid ""
|
1617 |
"Select how transactions should be processed. Charge submits all "
|
1618 |
"transactions for settlement, Authorization simply authorizes the order "
|
1619 |
"total for capture later."
|
1620 |
msgstr ""
|
1621 |
|
1622 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3168
|
1623 |
msgid "Charge Virtual-Only Orders"
|
1624 |
msgstr ""
|
1625 |
|
1626 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3170
|
1627 |
msgid ""
|
1628 |
"If the order contains exclusively virtual items, enable this to immediately "
|
1629 |
"charge, rather than authorize, the transaction."
|
1630 |
msgstr ""
|
1631 |
|
1632 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3178
|
1633 |
msgid "Enable Partial Capture"
|
1634 |
msgstr ""
|
1635 |
|
1636 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3180
|
1637 |
msgid "Allow orders to be partially captured multiple times."
|
1638 |
msgstr ""
|
1639 |
|
1640 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3192
|
1641 |
msgid "Capture Paid Orders"
|
1642 |
msgstr ""
|
1643 |
|
1644 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3195
|
1645 |
msgid "Automatically capture orders when they are changed to %s."
|
1646 |
msgstr ""
|
1647 |
|
1648 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3196
|
1649 |
msgid "a paid status"
|
1650 |
msgstr ""
|
1651 |
|
1652 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3386
|
1653 |
msgid "Accepted Card Logos"
|
1654 |
msgstr ""
|
1655 |
|
1656 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3388
|
1657 |
msgid ""
|
1658 |
"These are the card logos that are displayed to customers as accepted during "
|
1659 |
"checkout."
|
1660 |
msgstr ""
|
1661 |
|
1662 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3391
|
1663 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag
|
1664 |
msgid ""
|
1665 |
"This setting %1$sdoes not%2$s change which card types the gateway will "
|
1666 |
"accept. Accepted cards are configured from your payment processor account."
|
1667 |
msgstr ""
|
1668 |
|
1669 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3482
|
1670 |
#. translators:
|
1671 |
#. http:www.cybersource.com/products/payment_security/payment_tokenization/ and
|
1672 |
#. https:en.wikipedia.org/wiki/Tokenization_(data_security)
|
1673 |
msgid "Tokenization"
|
1674 |
msgstr ""
|
1675 |
|
1676 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3483
|
1677 |
msgid "Allow customers to securely save their payment details for future checkout."
|
1678 |
msgstr ""
|
1679 |
|
1680 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:4302
|
1681 |
#. translators: %1$s - gateway name, %2$s - <a> tag, %3$s - </a> tag, %4$s -
|
1682 |
#. <a> tag, %5$s - </a> tag
|
1683 |
msgid ""
|
1709 |
msgid "Pre-Order Release Payment Failed: %s"
|
1710 |
msgstr ""
|
1711 |
|
1712 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:349
|
1713 |
msgid "Subscription Renewal: payment token is missing/invalid."
|
1714 |
msgstr ""
|
1715 |
|
1716 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:375
|
1717 |
msgid "%1$s - Subscription Renewal Order %2$s"
|
1718 |
msgstr ""
|
1719 |
|
1720 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:507
|
1721 |
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1722 |
#. message; e.g. Order Note: [Payment method] Payment Change failed [error]
|
1723 |
msgid "%1$s Payment Change Failed (%2$s)"
|
1724 |
msgstr ""
|
1725 |
|
1726 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:650
|
1727 |
msgid "Via %s ending in %s"
|
1728 |
msgstr ""
|
1729 |
|
1730 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:677
|
1731 |
msgid "Subscriptions"
|
1732 |
msgstr ""
|
1733 |
|
1734 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:738
|
1735 |
+
msgid "N/A"
|
|
|
|
|
1736 |
msgstr ""
|
1737 |
|
1738 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:837
|
1739 |
msgid "Payment Token"
|
1740 |
msgstr ""
|
1741 |
|
1742 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:866
|
1743 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:871
|
1744 |
msgid "%s is required."
|
1745 |
msgstr ""
|
1746 |
|
1747 |
+
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:181
|
1748 |
msgid "Unknown Error"
|
1749 |
msgstr ""
|
1750 |
|
1862 |
"has loopback connections enabled."
|
1863 |
msgstr ""
|
1864 |
|
1865 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:395
|
1866 |
msgctxt "enhanced select"
|
1867 |
msgid "No matches found"
|
1868 |
msgstr ""
|
1869 |
|
1870 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:396
|
1871 |
msgctxt "enhanced select"
|
1872 |
msgid "Loading failed"
|
1873 |
msgstr ""
|
1874 |
|
1875 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:397
|
1876 |
msgctxt "enhanced select"
|
1877 |
msgid "Please enter 1 or more characters"
|
1878 |
msgstr ""
|
1879 |
|
1880 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:398
|
1881 |
msgctxt "enhanced select"
|
1882 |
msgid "Please enter %qty% or more characters"
|
1883 |
msgstr ""
|
1884 |
|
1885 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:399
|
1886 |
msgctxt "enhanced select"
|
1887 |
msgid "Please delete 1 character"
|
1888 |
msgstr ""
|
1889 |
|
1890 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:400
|
1891 |
msgctxt "enhanced select"
|
1892 |
msgid "Please delete %qty% characters"
|
1893 |
msgstr ""
|
1894 |
|
1895 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:401
|
1896 |
msgctxt "enhanced select"
|
1897 |
msgid "You can only select 1 item"
|
1898 |
msgstr ""
|
1899 |
|
1900 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:402
|
1901 |
msgctxt "enhanced select"
|
1902 |
msgid "You can only select %qty% items"
|
1903 |
msgstr ""
|
1904 |
|
1905 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:403
|
1906 |
msgctxt "enhanced select"
|
1907 |
msgid "Loading more results…"
|
1908 |
msgstr ""
|
1909 |
|
1910 |
+
#: admin/abstract-sv-wc-plugin-admin-setup-wizard.php:404
|
1911 |
msgctxt "enhanced select"
|
1912 |
msgid "Searching…"
|
1913 |
msgstr ""
|
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 ""
|
1929 |
|
1930 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:749
|
1931 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2679
|
1932 |
msgctxt "noun, software environment"
|
1933 |
msgid "Test"
|
1934 |
msgstr ""
|
1935 |
|
1936 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:750
|
1937 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2680
|
1938 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3161
|
1939 |
msgctxt "credit card transaction type"
|
1940 |
msgid "Authorization"
|
1941 |
msgstr ""
|
1942 |
|
1943 |
+
#: payment-gateway/class-sv-wc-payment-gateway-direct.php:750
|
1944 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2680
|
1945 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3160
|
1946 |
msgctxt "noun, credit card transaction type"
|
1947 |
msgid "Charge"
|
1948 |
msgstr ""
|
1953 |
msgstr ""
|
1954 |
|
1955 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:229
|
1956 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3419
|
1957 |
msgctxt "credit card type"
|
1958 |
msgid "Visa"
|
1959 |
msgstr ""
|
1960 |
|
1961 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:233
|
1962 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3420
|
1963 |
msgctxt "credit card type"
|
1964 |
msgid "MasterCard"
|
1965 |
msgstr ""
|
1966 |
|
1967 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:237
|
1968 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3421
|
1969 |
msgctxt "credit card type"
|
1970 |
msgid "American Express"
|
1971 |
msgstr ""
|
1976 |
msgstr ""
|
1977 |
|
1978 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:245
|
1979 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3422
|
1980 |
msgctxt "credit card type"
|
1981 |
msgid "Discover"
|
1982 |
msgstr ""
|
1983 |
|
1984 |
#: payment-gateway/class-sv-wc-payment-gateway-helper.php:249
|
1985 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3424
|
1986 |
msgctxt "credit card type"
|
1987 |
msgid "JCB"
|
1988 |
msgstr ""
|
2002 |
msgid "Laser"
|
2003 |
msgstr ""
|
2004 |
|
2005 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3423
|
2006 |
msgctxt "credit card type"
|
2007 |
msgid "Diners"
|
2008 |
msgstr ""
|
2019 |
msgid "Savings"
|
2020 |
msgstr ""
|
2021 |
|
2022 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:2460
|
2023 |
msgctxt "hash before order number"
|
2024 |
msgid "#"
|
2025 |
msgstr ""
|
2026 |
|
2027 |
+
#: payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:732
|
2028 |
msgctxt "hash before order number"
|
2029 |
msgid "#%s"
|
2030 |
msgstr ""
|
2031 |
|
2032 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:3189
|
2033 |
msgctxt ""
|
2034 |
"coordinating conjunction for a list of order statuses: on-hold, processing, "
|
2035 |
"or completed"
|
2036 |
msgid "or"
|
2037 |
msgstr ""
|
2038 |
|
2039 |
+
#: payment-gateway/class-sv-wc-payment-gateway.php:4028
|
2040 |
#. translators: https:www.skyverge.com/for-translators-environments/
|
2041 |
msgctxt "software environment"
|
2042 |
msgid "Production"
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Admin.php
ADDED
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
|
28 |
+
|
29 |
+
defined( 'ABSPATH' ) or exit;
|
30 |
+
|
31 |
+
if ( ! class_exists( __NAMESPACE__ . '\\Admin' ) ) :
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Base class to set up a Payments settings screen, used by external checkout integrations.
|
35 |
+
*
|
36 |
+
* @since 5.10.0
|
37 |
+
*/
|
38 |
+
abstract class Admin {
|
39 |
+
|
40 |
+
|
41 |
+
/** @var string settings section ID */
|
42 |
+
protected $section_id;
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Construct the class.
|
47 |
+
*
|
48 |
+
* @since 5.10.0
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
$this->add_hooks();
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Sets up the necessary hooks.
|
58 |
+
*
|
59 |
+
* @since 5.10.0
|
60 |
+
*/
|
61 |
+
protected function add_hooks() {
|
62 |
+
|
63 |
+
// bail if another plugin has already added the settings for this external checkout integration
|
64 |
+
$sections = apply_filters( 'woocommerce_get_sections_checkout', [] );
|
65 |
+
if ( ! empty( $sections[ $this->section_id ] ) ) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
add_filter( 'woocommerce_get_sections_checkout', [ $this, 'add_settings_section' ], 99 );
|
70 |
+
add_action( 'woocommerce_settings_checkout', [ $this, 'add_settings' ] );
|
71 |
+
add_action( 'woocommerce_settings_save_checkout', [ $this, 'save_settings' ] );
|
72 |
+
|
73 |
+
// render the special "static" gateway select
|
74 |
+
if ( ! has_action( 'woocommerce_admin_field_static' ) ) {
|
75 |
+
add_action( 'woocommerce_admin_field_static', [ $this, 'render_static_setting' ] );
|
76 |
+
}
|
77 |
+
|
78 |
+
// add admin notices for configuration issues
|
79 |
+
add_action( 'admin_footer', [ $this, 'add_admin_notices' ], 10 );
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Adds the checkout settings section.
|
85 |
+
*
|
86 |
+
* @internal
|
87 |
+
*
|
88 |
+
* @since 5.10.0
|
89 |
+
*
|
90 |
+
* @param array $sections the existing sections
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
public function add_settings_section( $sections ) {
|
94 |
+
|
95 |
+
$sections[ $this->section_id ] = $this->get_settings_section_name();
|
96 |
+
|
97 |
+
return $sections;
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Gets the name of the settings section.
|
103 |
+
*
|
104 |
+
* @since 5.10.0
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
abstract protected function get_settings_section_name();
|
109 |
+
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Gets all of the combined settings.
|
113 |
+
*
|
114 |
+
* @since 5.10.0
|
115 |
+
*
|
116 |
+
* @return array $settings combined settings.
|
117 |
+
*/
|
118 |
+
abstract public function get_settings();
|
119 |
+
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Adds the definition for a Processing Gateway setting.
|
123 |
+
*
|
124 |
+
* @since 5.10.0
|
125 |
+
*
|
126 |
+
* @param array $settings setting definitions
|
127 |
+
* @return array
|
128 |
+
*/
|
129 |
+
protected function add_processing_gateway_settings( $settings ) {
|
130 |
+
|
131 |
+
$gateway_options = $this->get_processing_gateway_options();
|
132 |
+
|
133 |
+
if ( 1 === count( $gateway_options ) ) {
|
134 |
+
|
135 |
+
$settings[] = [
|
136 |
+
'id' => $this->get_processing_gateway_setting_id(),
|
137 |
+
'title' => __( 'Processing Gateway', 'woocommerce-plugin-framework' ),
|
138 |
+
'type' => 'static',
|
139 |
+
'value' => key( $gateway_options ),
|
140 |
+
'label' => current( $gateway_options ),
|
141 |
+
];
|
142 |
+
|
143 |
+
} else {
|
144 |
+
|
145 |
+
$settings[] = [
|
146 |
+
'id' => $this->get_processing_gateway_setting_id(),
|
147 |
+
'title' => __( 'Processing Gateway', 'woocommerce-plugin-framework' ),
|
148 |
+
'type' => 'select',
|
149 |
+
'options' => $gateway_options
|
150 |
+
];
|
151 |
+
}
|
152 |
+
|
153 |
+
return $settings;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Gets the ID for the Processing Gateway setting.
|
159 |
+
*
|
160 |
+
* @since 5.10.0
|
161 |
+
*
|
162 |
+
* @return string
|
163 |
+
*/
|
164 |
+
protected function get_processing_gateway_setting_id() {
|
165 |
+
|
166 |
+
return sprintf( 'sv_wc_%s_payment_gateway', str_replace( '-', '_', $this->section_id ) );
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Gets an array IDs and names of payment gateways that declare support.
|
172 |
+
*
|
173 |
+
* @since 5.10.0
|
174 |
+
*
|
175 |
+
* @return array
|
176 |
+
*/
|
177 |
+
protected function get_processing_gateway_options() {
|
178 |
+
|
179 |
+
return array_map(
|
180 |
+
function( $gateway ) {
|
181 |
+
return $gateway->get_method_title();
|
182 |
+
},
|
183 |
+
$this->get_supporting_gateways()
|
184 |
+
);
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Gets the gateways that declare support.
|
190 |
+
*
|
191 |
+
* @since 5.10.0
|
192 |
+
*
|
193 |
+
* @return array the supporting gateways as `$gateway_id => \SV_WC_Payment_Gateway`
|
194 |
+
*/
|
195 |
+
abstract protected function get_supporting_gateways();
|
196 |
+
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Outputs the settings fields.
|
200 |
+
*
|
201 |
+
* @internal
|
202 |
+
*
|
203 |
+
* @since 5.10.0
|
204 |
+
*
|
205 |
+
* @global string $current_section current settings section.
|
206 |
+
*/
|
207 |
+
public function add_settings() {
|
208 |
+
global $current_section;
|
209 |
+
|
210 |
+
if ( $current_section === $this->section_id ) {
|
211 |
+
\WC_Admin_Settings::output_fields( $this->get_settings() );
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Saves the settings.
|
218 |
+
*
|
219 |
+
* @internal
|
220 |
+
*
|
221 |
+
* @since 5.10.0
|
222 |
+
*
|
223 |
+
* @global string $current_section current settings section.
|
224 |
+
*/
|
225 |
+
public function save_settings() {
|
226 |
+
global $current_section;
|
227 |
+
|
228 |
+
if ( $current_section === $this->section_id ) {
|
229 |
+
\WC_Admin_Settings::save_fields( $this->get_settings() );
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Renders a static setting.
|
236 |
+
*
|
237 |
+
* This "setting" just displays simple text instead of a <select> with only one option.
|
238 |
+
*
|
239 |
+
* @since 5.10.0
|
240 |
+
*
|
241 |
+
* @param array $setting
|
242 |
+
*/
|
243 |
+
public function render_static_setting( $setting ) {
|
244 |
+
|
245 |
+
?>
|
246 |
+
|
247 |
+
<tr valign="top">
|
248 |
+
<th scope="row" class="titledesc">
|
249 |
+
<label for="<?php echo esc_attr( $setting['id'] ); ?>"><?php echo esc_html( $setting['title'] ); ?></label>
|
250 |
+
</th>
|
251 |
+
<td class="forminp forminp-<?php echo sanitize_title( $setting['type'] ) ?>">
|
252 |
+
<?php echo esc_html( $setting['label'] ); ?>
|
253 |
+
<input
|
254 |
+
name="<?php echo esc_attr( $setting['id'] ); ?>"
|
255 |
+
id="<?php echo esc_attr( $setting['id'] ); ?>"
|
256 |
+
value="<?php echo esc_html( $setting['value'] ); ?>"
|
257 |
+
type="hidden"
|
258 |
+
>
|
259 |
+
</td>
|
260 |
+
</tr><?php
|
261 |
+
}
|
262 |
+
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Determines if the user is currently on the settings screen.
|
266 |
+
*
|
267 |
+
* @since 5.10.0
|
268 |
+
*
|
269 |
+
* @return bool
|
270 |
+
*/
|
271 |
+
protected function is_settings_screen() {
|
272 |
+
|
273 |
+
return 'wc-settings' === SV_WC_Helper::get_requested_value( 'page' ) && $this->section_id === SV_WC_Helper::get_requested_value( 'section' );
|
274 |
+
}
|
275 |
+
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Gets the available display location options.
|
279 |
+
*
|
280 |
+
* @since 5.10.0
|
281 |
+
*
|
282 |
+
* @return array
|
283 |
+
*/
|
284 |
+
protected function get_display_location_options() {
|
285 |
+
|
286 |
+
return [
|
287 |
+
'product' => __( 'Single products', 'woocommerce-plugin-framework' ),
|
288 |
+
'cart' => __( 'Cart', 'woocommerce-plugin-framework' ),
|
289 |
+
'checkout' => __( 'Checkout', 'woocommerce-plugin-framework' ),
|
290 |
+
];
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Adds admin notices for configuration issues.
|
296 |
+
*
|
297 |
+
* @since 5.10.0
|
298 |
+
*/
|
299 |
+
public function add_admin_notices() {
|
300 |
+
|
301 |
+
// if the feature is not enabled, bail
|
302 |
+
if ( ! $this->handler->is_enabled() ) {
|
303 |
+
return;
|
304 |
+
}
|
305 |
+
|
306 |
+
// if not on the settings screen, bail
|
307 |
+
if ( ! $this->is_settings_screen() ) {
|
308 |
+
return;
|
309 |
+
}
|
310 |
+
|
311 |
+
$this->add_configuration_errors_notice();
|
312 |
+
|
313 |
+
$this->add_configuration_warnings_notices();
|
314 |
+
}
|
315 |
+
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Adds one error notice for all configuration options that need attention.
|
319 |
+
*
|
320 |
+
* @since 5.10.0
|
321 |
+
*/
|
322 |
+
protected function add_configuration_errors_notice() {
|
323 |
+
|
324 |
+
$errors = $this->get_configuration_errors();
|
325 |
+
|
326 |
+
if ( ! empty( $errors ) ) {
|
327 |
+
|
328 |
+
$message = sprintf(
|
329 |
+
/* translators: Placeholder: %s - external checkout label */
|
330 |
+
'<strong>' . __( '%s is disabled.', 'woocommerce-plugin-framework' ) . '</strong>',
|
331 |
+
$this->handler->get_label()
|
332 |
+
);
|
333 |
+
|
334 |
+
if ( 1 === count( $errors ) ) {
|
335 |
+
$message .= ' ' . current( $errors );
|
336 |
+
} else {
|
337 |
+
$message .= '<ul><li>' . implode( '</li><li>', $errors ) . '</li></ul>';
|
338 |
+
}
|
339 |
+
|
340 |
+
$this->handler->get_plugin()->get_admin_notice_handler()->add_admin_notice( $message, $this->section_id . '-configuration-issue', [
|
341 |
+
'notice_class' => 'error',
|
342 |
+
'dismissible' => false,
|
343 |
+
] );
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
|
348 |
+
/**
|
349 |
+
* Adds warning notices for each configuration option that may need attention.
|
350 |
+
*
|
351 |
+
* @since 5.10.0
|
352 |
+
*/
|
353 |
+
protected function add_configuration_warnings_notices() {
|
354 |
+
|
355 |
+
if ( $this->should_display_shipping_based_tax_notice() ) {
|
356 |
+
|
357 |
+
$message = $this->get_shipping_based_tax_notice();
|
358 |
+
|
359 |
+
$this->handler->get_plugin()->get_admin_notice_handler()->add_admin_notice( $message, $this->section_id . '-shipping-based-tax', [
|
360 |
+
'notice_class' => 'notice-warning',
|
361 |
+
'dismissible' => true,
|
362 |
+
] );
|
363 |
+
}
|
364 |
+
|
365 |
+
if ( $this->should_display_billing_based_tax_notice() ) {
|
366 |
+
$message = $this->get_billing_based_tax_notice();
|
367 |
+
|
368 |
+
$this->handler->get_plugin()->get_admin_notice_handler()->add_admin_notice( $message, $this->section_id . '-billing-based-tax', [
|
369 |
+
'notice_class' => 'notice-warning',
|
370 |
+
'dismissible' => true,
|
371 |
+
] );
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Gets the error messages for configuration issues that need attention.
|
378 |
+
*
|
379 |
+
* @since 5.10.0
|
380 |
+
*
|
381 |
+
* @return string[] error messages
|
382 |
+
*/
|
383 |
+
protected function get_configuration_errors() {
|
384 |
+
|
385 |
+
$errors = [];
|
386 |
+
|
387 |
+
// currency notice
|
388 |
+
$accepted_currencies = $this->handler->get_accepted_currencies();
|
389 |
+
|
390 |
+
if ( ! empty( $accepted_currencies ) && ! in_array( get_woocommerce_currency(), $accepted_currencies, true ) ) {
|
391 |
+
|
392 |
+
$errors[] = sprintf(
|
393 |
+
/* translators: Placeholders: %1$s - plugin name, %2$s - a currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag, %5$s - external checkout label */
|
394 |
+
_n(
|
395 |
+
'Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s to enable %4$s.',
|
396 |
+
'Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to accept one of %1$s to enable %4$s.',
|
397 |
+
count( $accepted_currencies ),
|
398 |
+
'woocommerce-plugin-framework'
|
399 |
+
),
|
400 |
+
'<strong>' . implode( ', ', $accepted_currencies ) . '</strong>',
|
401 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=general' ) ) . '">',
|
402 |
+
'</a>',
|
403 |
+
$this->handler->get_label()
|
404 |
+
);
|
405 |
+
}
|
406 |
+
|
407 |
+
return $errors;
|
408 |
+
}
|
409 |
+
|
410 |
+
|
411 |
+
/**
|
412 |
+
* Checks if the shipping based tax notice should be displayed.
|
413 |
+
*
|
414 |
+
* @since 5.10.0
|
415 |
+
*
|
416 |
+
* @return bool
|
417 |
+
*/
|
418 |
+
protected function should_display_shipping_based_tax_notice() {
|
419 |
+
|
420 |
+
return 'shipping' === get_option( 'woocommerce_tax_based_on' ) &&
|
421 |
+
SV_WC_Helper::shop_has_virtual_products();
|
422 |
+
}
|
423 |
+
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Gets the shipping based tax notice text.
|
427 |
+
*
|
428 |
+
* @since 5.10.0
|
429 |
+
*
|
430 |
+
* @return string
|
431 |
+
*/
|
432 |
+
protected function get_shipping_based_tax_notice() {
|
433 |
+
|
434 |
+
return sprintf(
|
435 |
+
/** translators: Placeholders: %1$s - external checkout label, %2$s - <a> tag, %3$s - </a> tag, %4$s - <strong> tag, %5$s - </strong> tag */
|
436 |
+
__( '%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the shipping address, but %1$s %4$sdoes not%5$s share customer shipping information with your store for orders with only virtual products. These orders will have their taxes calculated based on the shop address instead.', 'woocommerce-plugin-framework' ),
|
437 |
+
$this->handler->get_label(),
|
438 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=tax' ) ) . '">',
|
439 |
+
'</a>',
|
440 |
+
'<strong>', '</strong>'
|
441 |
+
);
|
442 |
+
}
|
443 |
+
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Checks if the billing based tax notice should be displayed.
|
447 |
+
*
|
448 |
+
* @since 5.10.0
|
449 |
+
*
|
450 |
+
* @return bool
|
451 |
+
*/
|
452 |
+
protected function should_display_billing_based_tax_notice() {
|
453 |
+
|
454 |
+
return 'billing' === get_option( 'woocommerce_tax_based_on' ) &&
|
455 |
+
! $this->handler->is_billing_address_available_before_payment();
|
456 |
+
}
|
457 |
+
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Gets the billing based tax notice text.
|
461 |
+
*
|
462 |
+
* @since 5.10.0
|
463 |
+
*
|
464 |
+
* @return string
|
465 |
+
*/
|
466 |
+
protected function get_billing_based_tax_notice() {
|
467 |
+
|
468 |
+
return sprintf(
|
469 |
+
/** translators: Placeholders: %1$s - external checkout label, %2$s - <a> tag, %3$s - </a> tag, %4$s - <strong> tag, %5$s - </strong> tag */
|
470 |
+
__( '%4$s%1$s Notice!%5$s Your store %2$scalculates taxes%3$s based on the billing address, but %1$s %4$sdoes not%5$s share the customer billing address with your store before payment. These orders will have their taxes calculated based on the shipping address (or shop address, for orders with only virtual products).', 'woocommerce-plugin-framework' ),
|
471 |
+
$this->handler->get_label(),
|
472 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=tax' ) ) . '">',
|
473 |
+
'</a>',
|
474 |
+
'<strong>', '</strong>'
|
475 |
+
);
|
476 |
+
}
|
477 |
+
|
478 |
+
|
479 |
+
}
|
480 |
+
|
481 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/External_Checkout.php
ADDED
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
|
29 |
+
|
30 |
+
defined( 'ABSPATH' ) or exit;
|
31 |
+
|
32 |
+
if ( ! class_exists( __NAMESPACE__ . '\\External_Checkout' ) ) :
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Base class to set up an external checkout integration.
|
36 |
+
*
|
37 |
+
* @since 5.10.0
|
38 |
+
*/
|
39 |
+
abstract class External_Checkout {
|
40 |
+
|
41 |
+
|
42 |
+
/** @var string external checkout ID */
|
43 |
+
protected $id;
|
44 |
+
|
45 |
+
/** @var string external checkout human-readable label (used in notices and log entries) */
|
46 |
+
protected $label;
|
47 |
+
|
48 |
+
/** @var SV_WC_Payment_Gateway_Plugin the plugin instance */
|
49 |
+
protected $plugin;
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Constructs the class.
|
54 |
+
*
|
55 |
+
* @since 5.10.0
|
56 |
+
*
|
57 |
+
* @param SV_WC_Payment_Gateway_Plugin $plugin the plugin instance
|
58 |
+
*/
|
59 |
+
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin ) {
|
60 |
+
|
61 |
+
$this->plugin = $plugin;
|
62 |
+
|
63 |
+
$this->init();
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Initializes the handlers.
|
69 |
+
*
|
70 |
+
* @since 5.10.0
|
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();
|
78 |
+
$this->init_frontend();
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Initializes the admin handler.
|
85 |
+
*
|
86 |
+
* @since 5.10.0
|
87 |
+
*/
|
88 |
+
abstract protected function init_admin();
|
89 |
+
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Initializes the AJAX handler.
|
93 |
+
*
|
94 |
+
* @since 5.10.0
|
95 |
+
*/
|
96 |
+
abstract protected function init_ajax();
|
97 |
+
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Initializes the frontend handler.
|
101 |
+
*
|
102 |
+
* @since 5.10.0
|
103 |
+
*/
|
104 |
+
abstract protected function init_frontend();
|
105 |
+
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Checks if the external checkout provides the customer billing address to WC before payment confirmation.
|
109 |
+
*
|
110 |
+
* Each external checkout handler should implement this method according to the external checkout behavior.
|
111 |
+
*
|
112 |
+
* @since 5.10.0
|
113 |
+
*
|
114 |
+
* @return bool
|
115 |
+
*/
|
116 |
+
abstract public function is_billing_address_available_before_payment();
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Gets the configured display locations.
|
121 |
+
*
|
122 |
+
* @since 5.10.0
|
123 |
+
*
|
124 |
+
* @return array
|
125 |
+
*/
|
126 |
+
public function get_display_locations() {
|
127 |
+
|
128 |
+
return get_option( "sv_wc_{$this->id}_display_locations", [] );
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Adds a log entry to the gateway's debug log.
|
134 |
+
*
|
135 |
+
* @since 5.10.0
|
136 |
+
*
|
137 |
+
* @param string $message the log message to add
|
138 |
+
*/
|
139 |
+
public function log( $message ) {
|
140 |
+
|
141 |
+
/** @var SV_WC_Payment_Gateway $gateway */
|
142 |
+
$gateway = $this->get_processing_gateway();
|
143 |
+
|
144 |
+
if ( ! $gateway ) {
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( $gateway->debug_log() ) {
|
149 |
+
$gateway->get_plugin()->log( "[{$this->label}] $message", $gateway->get_id() );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Simulates a successful gateway payment response.
|
156 |
+
*
|
157 |
+
* This provides an easy way for merchants to test that their settings are correctly configured and communicating
|
158 |
+
* with the external checkout provider without processing actual payments to test.
|
159 |
+
*
|
160 |
+
* @since 5.10.0
|
161 |
+
*
|
162 |
+
* @param \WC_Order $order order object
|
163 |
+
* @return array
|
164 |
+
*/
|
165 |
+
protected function process_test_payment( \WC_Order $order ) {
|
166 |
+
|
167 |
+
$order->payment_complete();
|
168 |
+
|
169 |
+
WC()->cart->empty_cart();
|
170 |
+
|
171 |
+
return [
|
172 |
+
'result' => 'success',
|
173 |
+
'redirect' => $this->get_processing_gateway()->get_return_url( $order ),
|
174 |
+
];
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Determines if the external checkout is available.
|
180 |
+
*
|
181 |
+
* Each handler can override this method to add availability requirements.
|
182 |
+
*
|
183 |
+
* @since 5.10.0
|
184 |
+
*
|
185 |
+
* @return bool
|
186 |
+
*/
|
187 |
+
public function is_available() {
|
188 |
+
|
189 |
+
$is_available = $this->is_configured();
|
190 |
+
|
191 |
+
$accepted_currencies = $this->get_accepted_currencies();
|
192 |
+
|
193 |
+
if ( ! empty( $accepted_currencies ) ) {
|
194 |
+
|
195 |
+
$is_available = $is_available && in_array( get_woocommerce_currency(), $accepted_currencies, true );
|
196 |
+
}
|
197 |
+
|
198 |
+
return $is_available;
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Determines if the external checkout settings are properly configured.
|
204 |
+
*
|
205 |
+
* Each handler can override this method to add configuration requirements.
|
206 |
+
*
|
207 |
+
* @since 5.10.0
|
208 |
+
*
|
209 |
+
* @return bool
|
210 |
+
*/
|
211 |
+
public function is_configured() {
|
212 |
+
|
213 |
+
if ( ! $this->get_processing_gateway() ) {
|
214 |
+
return false;
|
215 |
+
}
|
216 |
+
|
217 |
+
return $this->is_enabled() && $this->get_processing_gateway()->is_enabled();
|
218 |
+
}
|
219 |
+
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Determines if the external checkout is enabled.
|
223 |
+
*
|
224 |
+
* @since 5.10.0
|
225 |
+
*
|
226 |
+
* @return bool
|
227 |
+
*/
|
228 |
+
public function is_enabled() {
|
229 |
+
|
230 |
+
return 'yes' === get_option( "sv_wc_{$this->id}_enabled" );
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Determines if test mode is enabled.
|
236 |
+
*
|
237 |
+
* @since 5.10.0
|
238 |
+
*
|
239 |
+
* @return bool
|
240 |
+
*/
|
241 |
+
public function is_test_mode() {
|
242 |
+
|
243 |
+
return 'yes' === get_option( "sv_wc_{$this->id}_test_mode" );
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Gets the gateways that declare support for this external checkout flow.
|
249 |
+
*
|
250 |
+
* @since 5.10.0
|
251 |
+
*
|
252 |
+
* @return array the supporting gateways as `$gateway_id => \SV_WC_Payment_Gateway`
|
253 |
+
*/
|
254 |
+
public function get_supporting_gateways() {
|
255 |
+
|
256 |
+
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
|
257 |
+
$supporting_gateways = [];
|
258 |
+
|
259 |
+
foreach ( $available_gateways as $key => $gateway ) {
|
260 |
+
|
261 |
+
$method_name = "supports_{$this->id}";
|
262 |
+
|
263 |
+
if ( method_exists( $gateway, $method_name ) && $gateway->$method_name() ) {
|
264 |
+
$supporting_gateways[ $gateway->get_id() ] = $gateway;
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
return $supporting_gateways;
|
269 |
+
}
|
270 |
+
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Gets the gateway set to process transactions for this external checkout flow.
|
274 |
+
*
|
275 |
+
* @since 5.10.0
|
276 |
+
*
|
277 |
+
* @return SV_WC_Payment_Gateway|null
|
278 |
+
*/
|
279 |
+
public function get_processing_gateway() {
|
280 |
+
|
281 |
+
$gateways = $this->get_supporting_gateways();
|
282 |
+
|
283 |
+
$gateway_id = get_option( "sv_wc_{$this->id}_payment_gateway" );
|
284 |
+
|
285 |
+
return isset( $gateways[ $gateway_id ] ) ? $gateways[ $gateway_id ] : null;
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Gets the external checkout button style.
|
291 |
+
*
|
292 |
+
* @since 5.10.0
|
293 |
+
*
|
294 |
+
* @return string
|
295 |
+
*/
|
296 |
+
public function get_button_style() {
|
297 |
+
|
298 |
+
return get_option( "sv_wc_{$this->id}_button_style", 'black' );
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Gets the gateway plugin instance.
|
304 |
+
*
|
305 |
+
* @since 5.10.0
|
306 |
+
*
|
307 |
+
* @return SV_WC_Payment_Gateway_Plugin
|
308 |
+
*/
|
309 |
+
public function get_plugin() {
|
310 |
+
|
311 |
+
return $this->plugin;
|
312 |
+
}
|
313 |
+
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Gets the external checkout label.
|
317 |
+
*
|
318 |
+
* @since 5.10.0
|
319 |
+
*
|
320 |
+
* @return string
|
321 |
+
*/
|
322 |
+
public function get_label() {
|
323 |
+
|
324 |
+
return $this->label;
|
325 |
+
}
|
326 |
+
|
327 |
+
|
328 |
+
}
|
329 |
+
|
330 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Frontend.php
ADDED
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* WooCommerce Payment Gateway Framework
|
5 |
+
*
|
6 |
+
* This source file is subject to the GNU General Public License v3.0
|
7 |
+
* that is bundled with this package in the file license.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
+
* If you did not receive a copy of the license and are unable to
|
11 |
+
* obtain it through the world-wide-web, please send an email
|
12 |
+
* to license@skyverge.com so we can send you a copy immediately.
|
13 |
+
*
|
14 |
+
* DISCLAIMER
|
15 |
+
*
|
16 |
+
* Do not edit or add to this file if you wish to upgrade the plugin to newer
|
17 |
+
* versions in the future. If you wish to customize the plugin for your
|
18 |
+
* needs please refer to http://www.skyverge.com
|
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_5\Payment_Gateway\External_Checkout;
|
27 |
+
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Handlers\Script_Handler;
|
29 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
|
30 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway;
|
31 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
|
32 |
+
|
33 |
+
defined( 'ABSPATH' ) or exit;
|
34 |
+
|
35 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Frontend' ) ) :
|
36 |
+
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Base class to set up an external checkout front-end functionality.
|
40 |
+
*
|
41 |
+
* @since 5.10.0
|
42 |
+
*/
|
43 |
+
abstract class Frontend extends Script_Handler {
|
44 |
+
|
45 |
+
|
46 |
+
/** @var SV_WC_Payment_Gateway_Plugin $plugin the gateway plugin instance */
|
47 |
+
protected $plugin;
|
48 |
+
|
49 |
+
/** @var External_Checkout $handler the external checkout handler instance */
|
50 |
+
protected $handler;
|
51 |
+
|
52 |
+
/** @var SV_WC_Payment_Gateway $gateway the gateway instance */
|
53 |
+
protected $gateway;
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Constructs the class.
|
58 |
+
*
|
59 |
+
* @since 5.10.0
|
60 |
+
*
|
61 |
+
* @param SV_WC_Payment_Gateway_Plugin $plugin the gateway plugin instance
|
62 |
+
* @param External_Checkout the handler instance
|
63 |
+
*/
|
64 |
+
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin, External_Checkout $handler ) {
|
65 |
+
|
66 |
+
$this->plugin = $plugin;
|
67 |
+
$this->handler = $handler;
|
68 |
+
$this->gateway = $this->get_handler()->get_processing_gateway();
|
69 |
+
|
70 |
+
parent::__construct();
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Adds the action and filter hooks.
|
76 |
+
*
|
77 |
+
* @since 5.10.0
|
78 |
+
*/
|
79 |
+
protected function add_hooks() {
|
80 |
+
|
81 |
+
if ( ! $this->get_handler()->is_available() ) {
|
82 |
+
return;
|
83 |
+
}
|
84 |
+
|
85 |
+
add_action( 'wp', [ $this, 'init' ] );
|
86 |
+
|
87 |
+
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
|
88 |
+
|
89 |
+
parent::add_hooks();
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Initializes the scripts and hooks.
|
95 |
+
*
|
96 |
+
* @since 5.10.0
|
97 |
+
*/
|
98 |
+
public function init() {
|
99 |
+
|
100 |
+
if ( ! $this->get_handler()->is_available() ) {
|
101 |
+
return;
|
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();
|
109 |
+
} else if ( ( is_cart() || $is_cart_ajax ) && in_array( 'cart', $locations, true ) ) {
|
110 |
+
$this->init_cart();
|
111 |
+
} else if ( is_checkout() && in_array( 'checkout', $locations, true ) ) {
|
112 |
+
$this->init_checkout();
|
113 |
+
} else {
|
114 |
+
return;
|
115 |
+
}
|
116 |
+
|
117 |
+
// only render external checkout container if not rendered yet
|
118 |
+
if ( ! has_action( 'sv_wc_external_checkout' ) ) {
|
119 |
+
add_action( 'sv_wc_external_checkout', [ $this, 'render_external_checkout' ] );
|
120 |
+
}
|
121 |
+
|
122 |
+
add_action( 'sv_wc_external_checkout_button', [ $this, 'render_button' ] );
|
123 |
+
|
124 |
+
// only render terms notice if not rendered yet
|
125 |
+
if ( ! has_action( 'sv_wc_external_checkout_terms_notice' ) ) {
|
126 |
+
add_action( 'sv_wc_external_checkout_terms_notice', [ $this, 'render_terms_notice' ] );
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Initializes external checkout on the single product page.
|
133 |
+
*
|
134 |
+
* Each handler can override this method to add specific product validation.
|
135 |
+
*
|
136 |
+
* @since 5.10.0
|
137 |
+
*/
|
138 |
+
public function init_product() {
|
139 |
+
|
140 |
+
$product = wc_get_product( get_the_ID() );
|
141 |
+
|
142 |
+
if ( ! $product ) {
|
143 |
+
return;
|
144 |
+
}
|
145 |
+
|
146 |
+
$this->enqueue_js_handler( $this->get_product_js_handler_args( $product ) );
|
147 |
+
|
148 |
+
add_action( 'woocommerce_before_add_to_cart_button', [ $this, 'maybe_render_external_checkout' ] );
|
149 |
+
}
|
150 |
+
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Initializes external checkout on the cart page.
|
154 |
+
*
|
155 |
+
* Each handler can override this method to add specific cart validation.
|
156 |
+
*
|
157 |
+
* @since 5.10.0
|
158 |
+
*/
|
159 |
+
public function init_cart() {
|
160 |
+
|
161 |
+
// bail if the cart is missing or empty
|
162 |
+
if ( ! WC()->cart || WC()->cart->is_empty() ) {
|
163 |
+
return;
|
164 |
+
}
|
165 |
+
|
166 |
+
$this->enqueue_js_handler( $this->get_cart_js_handler_args( WC()->cart ) );
|
167 |
+
|
168 |
+
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'maybe_render_external_checkout' ] );
|
169 |
+
}
|
170 |
+
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Initializes external checkout on the checkout page.
|
174 |
+
*
|
175 |
+
* Each handler can override this method to add specific cart validation.
|
176 |
+
*
|
177 |
+
* @since 5.10.0
|
178 |
+
*/
|
179 |
+
public function init_checkout() {
|
180 |
+
|
181 |
+
$this->enqueue_js_handler( $this->get_checkout_js_handler_args() );
|
182 |
+
|
183 |
+
if ( $this->get_handler()->get_plugin()->is_plugin_active( 'woocommerce-checkout-add-ons.php' ) ) {
|
184 |
+
add_action( 'woocommerce_review_order_before_payment', [ $this, 'maybe_render_external_checkout' ] );
|
185 |
+
} else {
|
186 |
+
add_action( 'woocommerce_before_checkout_form', [ $this, 'maybe_render_external_checkout_with_divider' ], 15 );
|
187 |
+
}
|
188 |
+
|
189 |
+
// only render external checkout container if not rendered yet
|
190 |
+
if ( ! has_action( 'sv_wc_external_checkout_with_divider' ) ) {
|
191 |
+
add_action( 'sv_wc_external_checkout_with_divider', [ $this, 'render_external_checkout_with_divider' ] );
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Maybe renders the external checkout buttons and possibly terms notice.
|
198 |
+
*
|
199 |
+
* @since 5.10.0
|
200 |
+
*/
|
201 |
+
public function maybe_render_external_checkout() {
|
202 |
+
|
203 |
+
// only render external checkout container if not rendered yet
|
204 |
+
if ( ! did_action( 'sv_wc_external_checkout' ) ) {
|
205 |
+
|
206 |
+
do_action( 'sv_wc_external_checkout' );
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Renders the external checkout buttons and possibly terms notice.
|
213 |
+
*
|
214 |
+
* @since 5.10.0
|
215 |
+
*/
|
216 |
+
public function render_external_checkout() {
|
217 |
+
?>
|
218 |
+
<div class="sv-wc-external-checkout">
|
219 |
+
<div class="buttons-container">
|
220 |
+
<?php do_action( 'sv_wc_external_checkout_button' ); ?>
|
221 |
+
</div>
|
222 |
+
<?php do_action( 'sv_wc_external_checkout_terms_notice' ); ?>
|
223 |
+
</div>
|
224 |
+
<?php
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Maybe renders the external checkout buttons and possibly terms notice with a divider.
|
230 |
+
*
|
231 |
+
* @since 5.10.0
|
232 |
+
*/
|
233 |
+
public function maybe_render_external_checkout_with_divider() {
|
234 |
+
|
235 |
+
// only render external checkout container if not rendered yet
|
236 |
+
if ( ! did_action( 'sv_wc_external_checkout_with_divider' ) ) {
|
237 |
+
|
238 |
+
do_action( 'sv_wc_external_checkout_with_divider' );
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Renders the external checkout buttons and possibly terms notice with a divider.
|
245 |
+
*
|
246 |
+
* @since 5.10.0
|
247 |
+
*/
|
248 |
+
public function render_external_checkout_with_divider() {
|
249 |
+
|
250 |
+
?>
|
251 |
+
|
252 |
+
<div class="sv-wc-external-checkout">
|
253 |
+
<div class="buttons-container">
|
254 |
+
<?php do_action( 'sv_wc_external_checkout_button' ); ?>
|
255 |
+
</div>
|
256 |
+
<?php do_action( 'sv_wc_external_checkout_terms_notice' ); ?>
|
257 |
+
<span class="divider">
|
258 |
+
<?php /** translators: "or" as in "Pay with XYZ [or] regular checkout" */
|
259 |
+
esc_html_e( 'or', 'woocommerce-plugin-framework' ); ?>
|
260 |
+
</span>
|
261 |
+
</div>
|
262 |
+
|
263 |
+
<?php
|
264 |
+
}
|
265 |
+
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Renders an external checkout button.
|
269 |
+
*
|
270 |
+
* Each handler should override this method to render its own button.
|
271 |
+
*
|
272 |
+
* @since 5.10.0
|
273 |
+
*/
|
274 |
+
abstract public function render_button();
|
275 |
+
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Renders a notice informing the customer that by purchasing they are accepting the website's terms and conditions.
|
279 |
+
*
|
280 |
+
* Only displayed if a Terms and conditions page is configured.
|
281 |
+
*
|
282 |
+
* @internal
|
283 |
+
*
|
284 |
+
* @since 5.10.0
|
285 |
+
*/
|
286 |
+
public function render_terms_notice() {
|
287 |
+
|
288 |
+
/** This filter is documented by WooCommerce in templates/checkout/terms.php */
|
289 |
+
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) && wc_terms_and_conditions_checkbox_enabled() ) {
|
290 |
+
|
291 |
+
$default_text = sprintf(
|
292 |
+
/** translators: Placeholders: %1$s - opening HTML link tag pointing to the terms & conditions page, %2$s closing HTML link tag */
|
293 |
+
__( 'By submitting your payment, you agree to our %1$sterms and conditions%2$s.', 'woocommerce-plugin-framework' ),
|
294 |
+
'<a href="' . esc_url( get_permalink( wc_terms_and_conditions_page_id() ) ) . '" class="terms-link" target="_blank">',
|
295 |
+
'</a>'
|
296 |
+
);
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Allows to filter the text for the terms & conditions notice.
|
300 |
+
*
|
301 |
+
* @since 5.10.0
|
302 |
+
*
|
303 |
+
* @params string $default_text default notice text
|
304 |
+
*/
|
305 |
+
$text = apply_filters( 'sv_wc_external_checkout_terms_notice_text', $default_text );
|
306 |
+
|
307 |
+
?>
|
308 |
+
<div class="terms-notice woocommerce-terms-and-conditions-wrapper">
|
309 |
+
<p><small><?php echo wp_kses_post( $text ); ?></small></p>
|
310 |
+
</div>
|
311 |
+
<?php
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Enqueues the scripts.
|
318 |
+
*
|
319 |
+
* Each handler should override this method to add its specific JS.
|
320 |
+
*
|
321 |
+
* @since 5.10.0
|
322 |
+
*/
|
323 |
+
public function enqueue_scripts() {
|
324 |
+
|
325 |
+
wp_enqueue_style( 'sv-wc-external-checkout-v5_10_5', $this->get_handler()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-external-checkout.css', array(), $this->get_handler()->get_plugin()->get_version() ); // TODO: min
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Enqueues an external checkout JS handler.
|
331 |
+
*
|
332 |
+
* @since 5.10.0
|
333 |
+
*
|
334 |
+
* @param array $args handler arguments
|
335 |
+
* @param string $object_name JS object name
|
336 |
+
* @param string $handler_name handler class name
|
337 |
+
*/
|
338 |
+
protected function enqueue_js_handler( array $args, $object_name = '', $handler_name = '' ) {
|
339 |
+
|
340 |
+
wc_enqueue_js( $this->get_safe_handler_js( $args, $handler_name, $object_name ) );
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Gets the handler instantiation JS.
|
346 |
+
*
|
347 |
+
* @since 5.10.0
|
348 |
+
*
|
349 |
+
* @param array $additional_args additional handler arguments, if any
|
350 |
+
* @param string $handler_name handler name, if different from self::get_js_handler_class_name()
|
351 |
+
* @param string $object_name object name, if different from self::get_js_handler_object_name()
|
352 |
+
* @return string
|
353 |
+
*/
|
354 |
+
protected function get_handler_js( array $additional_args = [], $handler_name = '', $object_name = '' ) {
|
355 |
+
|
356 |
+
$js = parent::get_handler_js( $additional_args, $handler_name );
|
357 |
+
|
358 |
+
$js .= sprintf( 'window.%s.init();', $object_name ?: $this->get_js_handler_object_name() );
|
359 |
+
|
360 |
+
return $js;
|
361 |
+
}
|
362 |
+
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Adds a log entry.
|
366 |
+
*
|
367 |
+
* @since 5.10.0
|
368 |
+
*
|
369 |
+
* @param string $message message to log
|
370 |
+
*/
|
371 |
+
protected function log_event( $message ) {
|
372 |
+
|
373 |
+
$this->get_gateway()->add_debug_message( $message );
|
374 |
+
}
|
375 |
+
|
376 |
+
|
377 |
+
/**
|
378 |
+
* Determines whether logging is enabled.
|
379 |
+
*
|
380 |
+
* @since 5.10.0
|
381 |
+
*
|
382 |
+
* @return bool
|
383 |
+
*/
|
384 |
+
protected function is_logging_enabled() {
|
385 |
+
|
386 |
+
return $this->get_gateway()->debug_log();
|
387 |
+
}
|
388 |
+
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Gets the gateway instance.
|
392 |
+
*
|
393 |
+
* @since 5.10.0
|
394 |
+
*
|
395 |
+
* @return SV_WC_Payment_Gateway
|
396 |
+
*/
|
397 |
+
protected function get_gateway() {
|
398 |
+
|
399 |
+
return $this->gateway;
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Gets the gateway plugin instance.
|
405 |
+
*
|
406 |
+
* @since 5.10.0
|
407 |
+
*
|
408 |
+
* @return SV_WC_Payment_Gateway_Plugin
|
409 |
+
*/
|
410 |
+
protected function get_plugin() {
|
411 |
+
|
412 |
+
return $this->plugin;
|
413 |
+
}
|
414 |
+
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Gets the external checkout handler instance.
|
418 |
+
*
|
419 |
+
* @since 5.10.0
|
420 |
+
*
|
421 |
+
* @return External_Checkout
|
422 |
+
*/
|
423 |
+
protected function get_handler() {
|
424 |
+
|
425 |
+
return $this->handler;
|
426 |
+
}
|
427 |
+
|
428 |
+
|
429 |
+
}
|
430 |
+
|
431 |
+
|
432 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout\Google_Pay;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
|
29 |
+
|
30 |
+
defined( 'ABSPATH' ) or exit;
|
31 |
+
|
32 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) :
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The Google Pay AJAX handler.
|
37 |
+
*
|
38 |
+
* @since 5.10.0
|
39 |
+
*/
|
40 |
+
class AJAX {
|
41 |
+
|
42 |
+
|
43 |
+
/** @var Google_Pay $handler the Google Pay handler instance */
|
44 |
+
protected $handler;
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Constructs the class.
|
49 |
+
*
|
50 |
+
* @since 5.10.0
|
51 |
+
*
|
52 |
+
* @param Google_Pay $handler the Google Pay handler instance
|
53 |
+
*/
|
54 |
+
public function __construct( Google_Pay $handler ) {
|
55 |
+
|
56 |
+
$this->handler = $handler;
|
57 |
+
|
58 |
+
if ( $this->get_handler()->is_available() ) {
|
59 |
+
$this->add_hooks();
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Adds the action & filter hooks.
|
66 |
+
*
|
67 |
+
* @since 5.10.0
|
68 |
+
*/
|
69 |
+
protected function add_hooks() {
|
70 |
+
|
71 |
+
$gateway_id = $this->get_handler()->get_processing_gateway()->get_id();
|
72 |
+
|
73 |
+
add_action( "wp_ajax_wc_{$gateway_id}_google_pay_get_transaction_info", [ $this, 'get_transaction_info' ] );
|
74 |
+
add_action( "wp_ajax_nopriv_wc_{$gateway_id}_google_pay_get_transaction_info", [ $this, 'get_transaction_info' ] );
|
75 |
+
|
76 |
+
// recalculate the totals after selecting an address or shipping method
|
77 |
+
add_action( "wp_ajax_wc_{$gateway_id}_google_pay_recalculate_totals", [ $this, 'recalculate_totals' ] );
|
78 |
+
add_action( "wp_ajax_nopriv_wc_{$gateway_id}_google_pay_recalculate_totals", [ $this, 'recalculate_totals' ] );
|
79 |
+
|
80 |
+
// process the payment
|
81 |
+
add_action( "wp_ajax_wc_{$gateway_id}_google_pay_process_payment", [ $this, 'process_payment' ] );
|
82 |
+
add_action( "wp_ajax_nopriv_wc_{$gateway_id}_google_pay_process_payment", [ $this, 'process_payment' ] );
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Gets Google transaction info based on WooCommerce cart data.
|
88 |
+
*
|
89 |
+
* @internal
|
90 |
+
*
|
91 |
+
* @since 5.10.0
|
92 |
+
*/
|
93 |
+
public function get_transaction_info() {
|
94 |
+
|
95 |
+
$this->get_handler()->log( 'Getting Google transaction info' );
|
96 |
+
|
97 |
+
try {
|
98 |
+
|
99 |
+
$product_id = wc_clean( SV_WC_Helper::get_posted_value( 'productID' ) );
|
100 |
+
|
101 |
+
$transaction_info = $this->get_handler()->get_transaction_info( WC()->cart, $product_id );
|
102 |
+
|
103 |
+
$this->get_handler()->log( "Google transaction info:\n" . print_r( $transaction_info, true ) );
|
104 |
+
|
105 |
+
wp_send_json_success( json_encode( $transaction_info ) );
|
106 |
+
|
107 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
108 |
+
|
109 |
+
$this->get_handler()->log( 'Could not build transaction info. ' . $e->getMessage() );
|
110 |
+
|
111 |
+
wp_send_json_error( [
|
112 |
+
'message' => $e->getMessage(),
|
113 |
+
'code' => $e->getCode(),
|
114 |
+
] );
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Recalculates the totals after selecting an address or shipping method.
|
121 |
+
*
|
122 |
+
* @internal
|
123 |
+
*
|
124 |
+
* @since 5.10.0
|
125 |
+
*/
|
126 |
+
public function recalculate_totals() {
|
127 |
+
|
128 |
+
$this->get_handler()->log( 'Recalculating totals' );
|
129 |
+
|
130 |
+
check_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_google_pay_recalculate_totals', 'nonce' );
|
131 |
+
|
132 |
+
try {
|
133 |
+
|
134 |
+
// if a shipping address is passed, set the shipping address data
|
135 |
+
$shipping_address = SV_WC_Helper::get_posted_value( 'shippingAddress' );
|
136 |
+
if ( ! empty( $shipping_address ) && is_array( $shipping_address ) ) {
|
137 |
+
|
138 |
+
$shipping_address = wp_parse_args( $shipping_address, [
|
139 |
+
'administrativeArea' => null,
|
140 |
+
'countryCode' => null,
|
141 |
+
'locality' => null,
|
142 |
+
'postalCode' => null,
|
143 |
+
] );
|
144 |
+
|
145 |
+
$state = $shipping_address['administrativeArea'];
|
146 |
+
$country = $shipping_address['countryCode'];
|
147 |
+
$city = $shipping_address['locality'];
|
148 |
+
$postcode = $shipping_address['postalCode'];
|
149 |
+
|
150 |
+
WC()->customer->set_shipping_city( $city );
|
151 |
+
WC()->customer->set_shipping_state( $state );
|
152 |
+
WC()->customer->set_shipping_country( $country );
|
153 |
+
WC()->customer->set_shipping_postcode( $postcode );
|
154 |
+
|
155 |
+
if ( $country ) {
|
156 |
+
WC()->customer->set_calculated_shipping( true );
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
$chosen_shipping_methods = ( $method = SV_WC_Helper::get_posted_value( 'shippingMethod' ) ) ? [ wc_clean( $method ) ] : [];
|
161 |
+
|
162 |
+
WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
|
163 |
+
|
164 |
+
$product_id = wc_clean( SV_WC_Helper::get_posted_value( 'productID' ) );
|
165 |
+
|
166 |
+
$payment_totals = $this->get_handler()->recalculate_totals( wc_clean( $method ), $product_id );
|
167 |
+
|
168 |
+
$this->get_handler()->log( "New totals:\n" . print_r( $payment_totals, true ) );
|
169 |
+
|
170 |
+
wp_send_json_success( json_encode( $payment_totals ) );
|
171 |
+
|
172 |
+
} catch ( \Exception $e ) {
|
173 |
+
|
174 |
+
$this->get_handler()->log( $e->getMessage() );
|
175 |
+
|
176 |
+
wp_send_json_error( [
|
177 |
+
'message' => $e->getMessage(),
|
178 |
+
'code' => $e->getCode(),
|
179 |
+
] );
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Processes the payment after the Google Pay authorization.
|
186 |
+
*
|
187 |
+
* @internal
|
188 |
+
*
|
189 |
+
* @since 5.10.0
|
190 |
+
*/
|
191 |
+
public function process_payment() {
|
192 |
+
|
193 |
+
$this->get_handler()->log( 'Processing payment' );
|
194 |
+
|
195 |
+
check_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_google_pay_process_payment', 'nonce' );
|
196 |
+
|
197 |
+
$payment_data = stripslashes( SV_WC_Helper::get_posted_value( 'paymentData' ) );
|
198 |
+
$product_id = wc_clean( SV_WC_Helper::get_posted_value( 'productID' ) );
|
199 |
+
|
200 |
+
try {
|
201 |
+
|
202 |
+
$result = $this->get_handler()->process_payment( $payment_data, $product_id );
|
203 |
+
|
204 |
+
wp_send_json_success( $result );
|
205 |
+
|
206 |
+
} catch ( \Exception $e ) {
|
207 |
+
|
208 |
+
$this->get_handler()->log( 'Payment failed. ' . $e->getMessage() );
|
209 |
+
|
210 |
+
wp_send_json_error( [
|
211 |
+
'message' => $e->getMessage(),
|
212 |
+
'code' => $e->getCode(),
|
213 |
+
] );
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Gets the Google Pay handler instance.
|
220 |
+
*
|
221 |
+
* @since 5.10.0
|
222 |
+
*
|
223 |
+
* @return Google_Pay
|
224 |
+
*/
|
225 |
+
protected function get_handler() {
|
226 |
+
|
227 |
+
return $this->handler;
|
228 |
+
}
|
229 |
+
|
230 |
+
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout\Google_Pay;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Helper;
|
28 |
+
|
29 |
+
defined( 'ABSPATH' ) or exit;
|
30 |
+
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) :
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Sets up the Google Pay settings screen.
|
36 |
+
*
|
37 |
+
* @since 5.10.0
|
38 |
+
*/
|
39 |
+
class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Admin {
|
40 |
+
|
41 |
+
|
42 |
+
/** @var Google_Pay the Google Pay handler instance */
|
43 |
+
protected $handler;
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Construct the class.
|
48 |
+
*
|
49 |
+
* @since 5.10.0
|
50 |
+
*
|
51 |
+
* @param Google_Pay $handler main Google Pay handler instance
|
52 |
+
*/
|
53 |
+
public function __construct( Google_Pay $handler ) {
|
54 |
+
|
55 |
+
$this->section_id = 'google-pay';
|
56 |
+
$this->handler = $handler;
|
57 |
+
|
58 |
+
parent::__construct();
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Gets the name of the Google Pay settings section.
|
64 |
+
*
|
65 |
+
* @since 5.10.0
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
protected function get_settings_section_name() {
|
70 |
+
|
71 |
+
return __( 'Google Pay', 'woocommerce-plugin-framework' );
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Gets all of the combined settings.
|
77 |
+
*
|
78 |
+
* @since 5.10.0
|
79 |
+
*
|
80 |
+
* @return array $settings combined settings.
|
81 |
+
*/
|
82 |
+
public function get_settings() {
|
83 |
+
|
84 |
+
$settings = [
|
85 |
+
|
86 |
+
[
|
87 |
+
'title' => __( 'Google Pay', 'woocommerce-plugin-framework' ),
|
88 |
+
'type' => 'title',
|
89 |
+
],
|
90 |
+
|
91 |
+
[
|
92 |
+
'id' => 'sv_wc_google_pay_enabled',
|
93 |
+
'title' => __( 'Enable / Disable', 'woocommerce-plugin-framework' ),
|
94 |
+
'desc' => __( 'Accept Google Pay', 'woocommerce-plugin-framework' ),
|
95 |
+
'type' => 'checkbox',
|
96 |
+
'default' => 'no',
|
97 |
+
],
|
98 |
+
|
99 |
+
[
|
100 |
+
'id' => 'sv_wc_google_pay_display_locations',
|
101 |
+
'title' => __( 'Allow Google Pay on', 'woocommerce-plugin-framework' ),
|
102 |
+
'type' => 'multiselect',
|
103 |
+
'class' => 'wc-enhanced-select',
|
104 |
+
'css' => 'width: 350px;',
|
105 |
+
'options' => $this->get_display_location_options(),
|
106 |
+
'default' => array_keys( $this->get_display_location_options() ),
|
107 |
+
],
|
108 |
+
|
109 |
+
[
|
110 |
+
'id' => 'sv_wc_google_pay_button_style',
|
111 |
+
'title' => __( 'Button Style', 'woocommerce-plugin-framework' ),
|
112 |
+
'type' => 'select',
|
113 |
+
'options' => [
|
114 |
+
'black' => __( 'Black', 'woocommerce-plugin-framework' ),
|
115 |
+
'white' => __( 'White', 'woocommerce-plugin-framework' ),
|
116 |
+
],
|
117 |
+
'default' => 'black',
|
118 |
+
],
|
119 |
+
|
120 |
+
[
|
121 |
+
'type' => 'sectionend',
|
122 |
+
],
|
123 |
+
];
|
124 |
+
|
125 |
+
$settings = array_merge( $settings, $this->get_connection_settings() );
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Filter the settings fields for Google Pay.
|
129 |
+
*
|
130 |
+
* @since 5.10.0
|
131 |
+
* @param array $settings combined settings.
|
132 |
+
*/
|
133 |
+
return apply_filters( 'woocommerce_get_settings_google_pay', $settings );
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Gets the connection settings for Google Pay.
|
139 |
+
*
|
140 |
+
* @since 5.10.0
|
141 |
+
*
|
142 |
+
* @return array $settings connection settings
|
143 |
+
*/
|
144 |
+
protected function get_connection_settings() {
|
145 |
+
|
146 |
+
$connection_settings = [
|
147 |
+
[
|
148 |
+
'title' => __( 'Connection Settings', 'woocommerce-plugin-framework' ),
|
149 |
+
'type' => 'title',
|
150 |
+
],
|
151 |
+
];
|
152 |
+
|
153 |
+
$connection_settings = $this->add_processing_gateway_settings( $connection_settings );
|
154 |
+
|
155 |
+
$connection_settings[] = [
|
156 |
+
'id' => 'sv_wc_google_pay_test_mode',
|
157 |
+
'title' => __( 'Test Mode', 'woocommerce-plugin-framework' ),
|
158 |
+
'desc' => __( 'Enable to test Google Pay functionality throughout your sites without processing real payments.', 'woocommerce-plugin-framework' ),
|
159 |
+
'type' => 'checkbox',
|
160 |
+
'default' => 'no',
|
161 |
+
];
|
162 |
+
|
163 |
+
$connection_settings[] = [
|
164 |
+
'type' => 'sectionend',
|
165 |
+
];
|
166 |
+
|
167 |
+
return $connection_settings;
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Gets the gateways that declare support for Google Pay.
|
173 |
+
*
|
174 |
+
* @since 5.10.0
|
175 |
+
*
|
176 |
+
* @return array
|
177 |
+
*/
|
178 |
+
protected function get_supporting_gateways() {
|
179 |
+
|
180 |
+
return $this->handler->get_supporting_gateways();
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout\Google_Pay;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
|
29 |
+
|
30 |
+
defined( 'ABSPATH' ) or exit;
|
31 |
+
|
32 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) :
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets up the Google Pay front-end functionality.
|
37 |
+
*
|
38 |
+
* @since 5.10.0
|
39 |
+
*/
|
40 |
+
class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Frontend {
|
41 |
+
|
42 |
+
|
43 |
+
/** @var string JS handler base class name, without the FW version */
|
44 |
+
protected $js_handler_base_class_name = 'SV_WC_Google_Pay_Handler';
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Constructs the class.
|
49 |
+
*
|
50 |
+
* @since 5.10.0
|
51 |
+
*
|
52 |
+
* @param SV_WC_Payment_Gateway_Plugin $plugin the gateway plugin instance
|
53 |
+
* @param Google_Pay $handler the Google Pay handler instance
|
54 |
+
*/
|
55 |
+
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin, Google_Pay $handler ) {
|
56 |
+
|
57 |
+
parent::__construct( $plugin, $handler );
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Gets the script ID.
|
63 |
+
*
|
64 |
+
* @since 5.10.0
|
65 |
+
*
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
public function get_id() {
|
69 |
+
|
70 |
+
return $this->get_gateway()->get_id() . '_google_pay';
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Gets the script ID, dasherized.
|
76 |
+
*
|
77 |
+
* @since 5.10.0
|
78 |
+
*
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
public function get_id_dasherized() {
|
82 |
+
|
83 |
+
return $this->get_gateway()->get_id_dasherized() . '-google-pay';
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Enqueues the scripts.
|
89 |
+
*
|
90 |
+
* @since 5.10.0
|
91 |
+
*/
|
92 |
+
public function enqueue_scripts() {
|
93 |
+
|
94 |
+
parent::enqueue_scripts();
|
95 |
+
|
96 |
+
wp_enqueue_script( 'google-pay-js-library', 'https://pay.google.com/gp/p/js/pay.js', array(), null, true );
|
97 |
+
wp_enqueue_script( 'sv-wc-google-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $this->get_plugin()->get_version(), true );
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Gets the JS handler arguments.
|
103 |
+
*
|
104 |
+
* @since 5.10.0
|
105 |
+
*
|
106 |
+
* @return array
|
107 |
+
*/
|
108 |
+
protected function get_js_handler_args() {
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Filters the Google Pay JS handler params.
|
112 |
+
*
|
113 |
+
* @since 5.10.0
|
114 |
+
*
|
115 |
+
* @param array $params the JS params
|
116 |
+
*/
|
117 |
+
return (array) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_google_pay_js_handler_params', [
|
118 |
+
'plugin_id' => $this->get_gateway()->get_plugin()->get_id(),
|
119 |
+
'merchant_id' => $this->get_handler()->get_merchant_id(),
|
120 |
+
'merchant_name' => get_bloginfo( 'name' ),
|
121 |
+
'gateway_id' => $this->get_gateway()->get_id(),
|
122 |
+
'gateway_id_dasherized' => $this->get_gateway()->get_id_dasherized(),
|
123 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
124 |
+
'recalculate_totals_nonce' => wp_create_nonce( 'wc_' . $this->get_gateway()->get_id() . '_google_pay_recalculate_totals' ),
|
125 |
+
'process_nonce' => wp_create_nonce( 'wc_' . $this->get_plugin()->get_gateway()->get_id() . '_google_pay_process_payment' ),
|
126 |
+
'button_style' => $this->get_handler()->get_button_style(),
|
127 |
+
'card_types' => $this->get_handler()->get_supported_networks(),
|
128 |
+
'available_countries' => $this->get_handler()->get_available_countries(),
|
129 |
+
'currency_code' => get_woocommerce_currency(),
|
130 |
+
'generic_error' => __( 'An error occurred, please try again or try an alternate form of payment', 'woocommerce-plugin-framework' ),
|
131 |
+
] );
|
132 |
+
}
|
133 |
+
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Renders a Google Pay button.
|
137 |
+
*
|
138 |
+
* @since 5.10.0
|
139 |
+
*/
|
140 |
+
public function render_button() {
|
141 |
+
|
142 |
+
?>
|
143 |
+
<div id="sv-wc-google-pay-button-container"></div>
|
144 |
+
<?php
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Initializes Google Pay on the single product page.
|
150 |
+
*
|
151 |
+
* @since 5.10.0
|
152 |
+
*/
|
153 |
+
public function init_product() {
|
154 |
+
|
155 |
+
$product = wc_get_product( get_the_ID() );
|
156 |
+
|
157 |
+
if ( ! $product ) {
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
|
161 |
+
try {
|
162 |
+
$this->get_handler()->validate_product( $product );
|
163 |
+
} catch ( SV_WC_Payment_Gateway_Exception $exception ) {
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
|
167 |
+
parent::init_product();
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Gets the args passed to the product JS handler.
|
173 |
+
*
|
174 |
+
* @since 5.10.0
|
175 |
+
*
|
176 |
+
* @param \WC_Product $product product object
|
177 |
+
* @return array
|
178 |
+
*/
|
179 |
+
protected function get_product_js_handler_args( \WC_Product $product ) {
|
180 |
+
|
181 |
+
$args = [
|
182 |
+
'product_id' => get_the_ID(),
|
183 |
+
'needs_shipping' => $product->needs_shipping(),
|
184 |
+
];
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Filters the gateway Google Pay cart handler args.
|
188 |
+
*
|
189 |
+
* @since 5.10.0
|
190 |
+
*
|
191 |
+
* @param array $args JS handler arguments
|
192 |
+
* @param \WC_Product $product product object
|
193 |
+
*/
|
194 |
+
return (array) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_google_pay_product_js_handler_args', $args, $product );
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
/** Cart functionality ****************************************************/
|
199 |
+
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Initializes Google Pay on the cart page.
|
203 |
+
*
|
204 |
+
* @since 5.10.0
|
205 |
+
*/
|
206 |
+
public function init_cart() {
|
207 |
+
|
208 |
+
try {
|
209 |
+
$this->get_handler()->validate_cart( WC()->cart );
|
210 |
+
} catch ( SV_WC_Payment_Gateway_Exception $exception ) {
|
211 |
+
return;
|
212 |
+
}
|
213 |
+
|
214 |
+
parent::init_cart();
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Gets the args passed to the cart JS handler.
|
220 |
+
*
|
221 |
+
* @since 5.10.0
|
222 |
+
*
|
223 |
+
* @param \WC_Cart $cart cart object
|
224 |
+
* @return array
|
225 |
+
*/
|
226 |
+
protected function get_cart_js_handler_args( \WC_Cart $cart ) {
|
227 |
+
|
228 |
+
$args = [
|
229 |
+
'needs_shipping' => $cart->needs_shipping(),
|
230 |
+
];
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Filters the gateway Google Pay cart handler args.
|
234 |
+
*
|
235 |
+
* @since 5.10.0
|
236 |
+
*
|
237 |
+
* @param array $args JS handler arguments
|
238 |
+
* @param \WC_Cart $cart cart object
|
239 |
+
*/
|
240 |
+
return (array) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_google_pay_cart_js_handler_args', $args, $cart );
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
/** Checkout functionality ************************************************/
|
245 |
+
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Initializes Google Pay on the checkout page.
|
249 |
+
*
|
250 |
+
* @since 5.10.0
|
251 |
+
*/
|
252 |
+
public function init_checkout() {
|
253 |
+
|
254 |
+
try {
|
255 |
+
$this->get_handler()->validate_cart( WC()->cart );
|
256 |
+
} catch ( SV_WC_Payment_Gateway_Exception $exception ) {
|
257 |
+
return;
|
258 |
+
}
|
259 |
+
|
260 |
+
parent::init_checkout();
|
261 |
+
}
|
262 |
+
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Gets the args passed to the checkout JS handler.
|
266 |
+
*
|
267 |
+
* @since 5.10.0
|
268 |
+
*
|
269 |
+
* @return array
|
270 |
+
*/
|
271 |
+
protected function get_checkout_js_handler_args() {
|
272 |
+
|
273 |
+
$args = [
|
274 |
+
'needs_shipping' => WC()->cart->needs_shipping(),
|
275 |
+
];
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Filters the gateway Google Pay checkout handler args.
|
279 |
+
*
|
280 |
+
* @since 5.10.0
|
281 |
+
*
|
282 |
+
* @param array $args JS handler arguments
|
283 |
+
*/
|
284 |
+
return (array) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_google_pay_checkout_js_handler_args', $args );
|
285 |
+
}
|
286 |
+
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
+
|
291 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php
ADDED
@@ -0,0 +1,721 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5\Payment_Gateway\External_Checkout\Google_Pay;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Orders;
|
29 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Exception;
|
30 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Helper;
|
31 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Plugin;
|
32 |
+
|
33 |
+
defined( 'ABSPATH' ) or exit;
|
34 |
+
|
35 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) :
|
36 |
+
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Sets up Google Pay support.
|
40 |
+
*
|
41 |
+
* @since 5.10.0
|
42 |
+
*/
|
43 |
+
class Google_Pay extends External_Checkout {
|
44 |
+
|
45 |
+
|
46 |
+
/** @var Admin the admin instance */
|
47 |
+
protected $admin;
|
48 |
+
|
49 |
+
/** @var Frontend the frontend instance */
|
50 |
+
protected $frontend;
|
51 |
+
|
52 |
+
/** @var AJAX the AJAX instance */
|
53 |
+
protected $ajax;
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Constructs the class.
|
58 |
+
*
|
59 |
+
* @since 5.10.0
|
60 |
+
*
|
61 |
+
* @param SV_WC_Payment_Gateway_Plugin $plugin the plugin instance
|
62 |
+
*/
|
63 |
+
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin ) {
|
64 |
+
|
65 |
+
$this->id = 'google_pay';
|
66 |
+
$this->label = __( 'Google Pay', 'woocommerce-plugin-framework' );
|
67 |
+
|
68 |
+
parent::__construct( $plugin );
|
69 |
+
|
70 |
+
if ( $this->is_available() ) {
|
71 |
+
add_filter( 'woocommerce_customer_taxable_address', [ $this, 'set_customer_taxable_address' ] );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Initializes the admin handler.
|
78 |
+
*
|
79 |
+
* @since 5.10.0
|
80 |
+
*/
|
81 |
+
protected function init_admin() {
|
82 |
+
|
83 |
+
$this->admin = new Admin( $this );
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Initializes the AJAX handler.
|
89 |
+
*
|
90 |
+
* @since 5.10.0
|
91 |
+
*/
|
92 |
+
protected function init_ajax() {
|
93 |
+
|
94 |
+
$this->ajax = new AJAX( $this );
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Initializes the frontend handler.
|
100 |
+
*
|
101 |
+
* @since 5.10.0
|
102 |
+
*/
|
103 |
+
protected function init_frontend() {
|
104 |
+
|
105 |
+
$this->frontend = new Frontend( $this->get_plugin(), $this );
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Checks if the external checkout provides the customer billing address to WC before payment confirmation.
|
111 |
+
*
|
112 |
+
* @since 5.10.0
|
113 |
+
*
|
114 |
+
* @return bool
|
115 |
+
*/
|
116 |
+
public function is_billing_address_available_before_payment() {
|
117 |
+
|
118 |
+
// Google Pay does not provide billing information until the payment is confirmed
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Gets Google transaction info based on WooCommerce cart or product data.
|
125 |
+
*
|
126 |
+
* @since 5.10.0
|
127 |
+
*
|
128 |
+
* @param \WC_Cart $cart cart object
|
129 |
+
* @param string $product_id product ID, if we are on a Product page
|
130 |
+
* @return array
|
131 |
+
* @throws SV_WC_Payment_Gateway_Exception
|
132 |
+
*/
|
133 |
+
public function get_transaction_info( \WC_Cart $cart, $product_id = '' ) {
|
134 |
+
|
135 |
+
if ( ! empty( $product_id ) && $product = wc_get_product( $product_id ) ) {
|
136 |
+
// buying from the product page
|
137 |
+
$transaction_info = $this->get_product_transaction_info( $product );
|
138 |
+
} else {
|
139 |
+
$transaction_info = $this->get_cart_transaction_info( $cart );
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Filters the Google Pay JS transaction info.
|
144 |
+
*
|
145 |
+
* @since 5.10.0
|
146 |
+
*
|
147 |
+
* @param array $transaction_info the JS transaction info
|
148 |
+
* @param \WC_Cart $cart the cart object
|
149 |
+
* @param \WC_Product|false $product the product object, if buying from the product page
|
150 |
+
*/
|
151 |
+
return apply_filters( 'sv_wc_google_pay_cart_transaction_info', $transaction_info, $cart, ! empty( $product ) ? $product : false );
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Checks if all products in the cart can be purchased using Google Pay.
|
157 |
+
*
|
158 |
+
* @since 5.10.0
|
159 |
+
*
|
160 |
+
* @param \WC_Cart $cart cart object
|
161 |
+
* @throws SV_WC_Payment_Gateway_Exception
|
162 |
+
*/
|
163 |
+
public function validate_cart( \WC_Cart $cart ) {
|
164 |
+
|
165 |
+
if ( $this->get_plugin()->is_subscriptions_active() && \WC_Subscriptions_Cart::cart_contains_subscription() ) {
|
166 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Cart contains subscriptions.' );
|
167 |
+
}
|
168 |
+
|
169 |
+
if ( $this->get_plugin()->is_pre_orders_active() && \WC_Pre_Orders_Cart::cart_contains_pre_order() ) {
|
170 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Cart contains pre-orders.' );
|
171 |
+
}
|
172 |
+
|
173 |
+
$cart->calculate_totals();
|
174 |
+
|
175 |
+
if ( count( WC()->shipping->get_packages() ) > 1 ) {
|
176 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Google Pay cannot be used for multiple shipments.' );
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Checks if a single product can be purchased using Google Pay.
|
183 |
+
*
|
184 |
+
* @since 5.10.0
|
185 |
+
*
|
186 |
+
* @param \WC_Product $product product object
|
187 |
+
* @throws SV_WC_Payment_Gateway_Exception
|
188 |
+
*/
|
189 |
+
public function validate_product( \WC_Product $product ) {
|
190 |
+
|
191 |
+
// no subscription products
|
192 |
+
if ( $this->get_plugin()->is_subscriptions_active() && \WC_Subscriptions_Product::is_subscription( $product ) ) {
|
193 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Not available for subscription products.' );
|
194 |
+
}
|
195 |
+
|
196 |
+
// no pre-order "charge upon release" products
|
197 |
+
if ( $this->get_plugin()->is_pre_orders_active() && \WC_Pre_Orders_Product::product_is_charged_upon_release( $product ) ) {
|
198 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Not available for pre-order products that are set to charge upon release.' );
|
199 |
+
}
|
200 |
+
|
201 |
+
// only simple products
|
202 |
+
if ( ! $product->is_type( 'simple' ) ) {
|
203 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Buy Now is only available for simple products' );
|
204 |
+
}
|
205 |
+
|
206 |
+
// if this product can't be purchased, bail
|
207 |
+
if ( ! $product->is_purchasable() || ! $product->is_in_stock() || ! $product->has_enough_stock( 1 ) ) {
|
208 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Product is not available for purchase.' );
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Gets Google transaction info based on WooCommerce cart data.
|
215 |
+
*
|
216 |
+
* @since 5.10.0
|
217 |
+
*
|
218 |
+
* @param \WC_Cart $cart cart object
|
219 |
+
* @return array
|
220 |
+
* @throws SV_WC_Payment_Gateway_Exception
|
221 |
+
*/
|
222 |
+
public function get_cart_transaction_info( \WC_Cart $cart ) {
|
223 |
+
|
224 |
+
$this->validate_cart( $cart );
|
225 |
+
|
226 |
+
return [
|
227 |
+
'displayItems' => $this->build_display_items( $cart ),
|
228 |
+
'countryCode' => substr( get_option( 'woocommerce_default_country' ), 0, 2 ),
|
229 |
+
'currencyCode' => get_woocommerce_currency(),
|
230 |
+
'totalPriceStatus' => "FINAL",
|
231 |
+
'totalPrice' => wc_format_decimal( $cart->total, 2 ),
|
232 |
+
'totalPriceLabel' => "Total",
|
233 |
+
];
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Gets Google transaction info based on product data.
|
239 |
+
*
|
240 |
+
* @since 5.10.0
|
241 |
+
*
|
242 |
+
* @param \WC_Product $product product object
|
243 |
+
* @return array
|
244 |
+
* @throws SV_WC_Payment_Gateway_Exception
|
245 |
+
*/
|
246 |
+
public function get_product_transaction_info( \WC_Product $product ) {
|
247 |
+
|
248 |
+
$this->validate_product( $product );
|
249 |
+
|
250 |
+
$price = wc_format_decimal( wc_get_price_including_tax( $product ), 2 );
|
251 |
+
|
252 |
+
return [
|
253 |
+
'displayItems' => [
|
254 |
+
[
|
255 |
+
'label' => __( 'Subtotal', 'woocommerce-plugin-framework' ),
|
256 |
+
'type' => 'SUBTOTAL',
|
257 |
+
'price' => $price,
|
258 |
+
],
|
259 |
+
],
|
260 |
+
'countryCode' => substr( get_option( 'woocommerce_default_country' ), 0, 2 ),
|
261 |
+
'currencyCode' => get_woocommerce_currency(),
|
262 |
+
'totalPriceStatus' => "FINAL",
|
263 |
+
'totalPrice' => $price,
|
264 |
+
'totalPriceLabel' => "Total",
|
265 |
+
];
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Populates cart with a single product.
|
271 |
+
*
|
272 |
+
* @since 5.10.0
|
273 |
+
*
|
274 |
+
* @param string $product_id product ID, if we are on a Product page
|
275 |
+
* @throws \Exception
|
276 |
+
*/
|
277 |
+
public function add_product_to_cart( $product_id ) {
|
278 |
+
|
279 |
+
if ( ! empty( $product_id ) && $product = wc_get_product( $product_id ) ) {
|
280 |
+
|
281 |
+
if ( ! is_user_logged_in() ) {
|
282 |
+
WC()->session->set_customer_session_cookie( true );
|
283 |
+
}
|
284 |
+
|
285 |
+
$this->validate_product( $product );
|
286 |
+
|
287 |
+
WC()->cart->empty_cart();
|
288 |
+
|
289 |
+
WC()->cart->add_to_cart( $product->get_id() );
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Recalculates the lines and totals after selecting an address or shipping method.
|
296 |
+
*
|
297 |
+
* @since 5.10.0
|
298 |
+
*
|
299 |
+
* @param string $chosen_shipping_method chosen shipping method
|
300 |
+
* @param string $product_id product ID, if we are on a Product page
|
301 |
+
* @return array
|
302 |
+
* @throws \Exception
|
303 |
+
*/
|
304 |
+
public function recalculate_totals( $chosen_shipping_method, $product_id ) {
|
305 |
+
|
306 |
+
// if this is a single product page, make sure the cart gets populated
|
307 |
+
$this->add_product_to_cart( $product_id );
|
308 |
+
|
309 |
+
if ( ! WC()->cart ) {
|
310 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Cart data is missing.' );
|
311 |
+
}
|
312 |
+
|
313 |
+
$response_data = [
|
314 |
+
// we do not pass the product ID here because we want to get the totals from the cart (including tax and shipping)
|
315 |
+
'newTransactionInfo' => $this->get_transaction_info( WC()->cart ),
|
316 |
+
'newShippingOptionParameters' => [],
|
317 |
+
];
|
318 |
+
|
319 |
+
$shipping_options = [];
|
320 |
+
$packages = WC()->shipping->get_packages();
|
321 |
+
|
322 |
+
if ( ! empty( $packages ) ) {
|
323 |
+
|
324 |
+
/** @var \WC_Shipping_Rate $method */
|
325 |
+
foreach ( $packages[0]['rates'] as $method ) {
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Filters a shipping method's description for the Google Pay payment.
|
329 |
+
*
|
330 |
+
* @since 5.10.0
|
331 |
+
*
|
332 |
+
* @param string $description shipping method description, such as delivery estimation
|
333 |
+
* @param object $method shipping method object
|
334 |
+
*/
|
335 |
+
$method_description = apply_filters( 'wc_payment_gateway_google_pay_shipping_method_description', '', $method );
|
336 |
+
|
337 |
+
$shipping_options[] = [
|
338 |
+
'id' => $method->get_id(),
|
339 |
+
'label' => $method->get_label(),
|
340 |
+
'description' => $method_description,
|
341 |
+
];
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
$response_data['newShippingOptionParameters']['shippingOptions'] = $shipping_options;
|
346 |
+
|
347 |
+
if ( ! empty( $chosen_shipping_method ) ) {
|
348 |
+
$response_data['newShippingOptionParameters']['defaultSelectedOptionId'] = $chosen_shipping_method;
|
349 |
+
} elseif ( ! empty( $shipping_options ) ) {
|
350 |
+
// set the first method as the default
|
351 |
+
$response_data['newShippingOptionParameters']['defaultSelectedOptionId'] = $shipping_options[0]['id'];
|
352 |
+
}
|
353 |
+
|
354 |
+
return $response_data;
|
355 |
+
}
|
356 |
+
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Builds display items for the Google Pay JS.
|
360 |
+
*
|
361 |
+
* @since 5.10.0
|
362 |
+
*
|
363 |
+
* @param \WC_Cart $cart
|
364 |
+
* @return array
|
365 |
+
*/
|
366 |
+
public function build_display_items( \WC_Cart $cart ) {
|
367 |
+
|
368 |
+
$subtotal = $cart->subtotal_ex_tax;
|
369 |
+
$discount = $cart->get_cart_discount_total();
|
370 |
+
$shipping = $cart->shipping_total;
|
371 |
+
$fees = $cart->fee_total;
|
372 |
+
$taxes = $cart->tax_total + $cart->shipping_tax_total;
|
373 |
+
|
374 |
+
$items = [];
|
375 |
+
|
376 |
+
// subtotal
|
377 |
+
if ( $subtotal > 0 ) {
|
378 |
+
|
379 |
+
$items[] = [
|
380 |
+
'label' => __( 'Subtotal', 'woocommerce-plugin-framework' ),
|
381 |
+
'type' => 'SUBTOTAL',
|
382 |
+
'price' => wc_format_decimal( $subtotal, 2 ),
|
383 |
+
];
|
384 |
+
}
|
385 |
+
|
386 |
+
// discounts
|
387 |
+
if ( $discount > 0 ) {
|
388 |
+
|
389 |
+
$items[] = [
|
390 |
+
'label' => __( 'Discount', 'woocommerce-plugin-framework' ),
|
391 |
+
'type' => 'LINE_ITEM',
|
392 |
+
'price' => abs( wc_format_decimal( $discount, 2 ) ) * - 1,
|
393 |
+
];
|
394 |
+
}
|
395 |
+
|
396 |
+
// shipping
|
397 |
+
if ( $shipping > 0 ) {
|
398 |
+
|
399 |
+
$items[] = [
|
400 |
+
'label' => __( 'Shipping', 'woocommerce-plugin-framework' ),
|
401 |
+
'type' => 'LINE_ITEM',
|
402 |
+
'price' => wc_format_decimal( $shipping, 2 ),
|
403 |
+
];
|
404 |
+
}
|
405 |
+
|
406 |
+
// fees
|
407 |
+
if ( $fees > 0 ) {
|
408 |
+
|
409 |
+
$items[] = [
|
410 |
+
'label' => __( 'Fees', 'woocommerce-plugin-framework' ),
|
411 |
+
'type' => 'LINE_ITEM',
|
412 |
+
'price' => wc_format_decimal( $fees, 2 ),
|
413 |
+
];
|
414 |
+
}
|
415 |
+
|
416 |
+
// taxes
|
417 |
+
if ( $taxes > 0 ) {
|
418 |
+
|
419 |
+
$items[] = [
|
420 |
+
'label' => __( 'Taxes', 'woocommerce-plugin-framework' ),
|
421 |
+
'type' => 'TAX',
|
422 |
+
'price' => wc_format_decimal( $taxes, 2 ),
|
423 |
+
];
|
424 |
+
}
|
425 |
+
|
426 |
+
return $items;
|
427 |
+
}
|
428 |
+
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Processes the payment after a Google Pay authorization.
|
432 |
+
*
|
433 |
+
* This method creates a new order and calls the gateway for processing.
|
434 |
+
*
|
435 |
+
* @since 5.10.0
|
436 |
+
*
|
437 |
+
* @param mixed $payment_data payment data returned by Google Pay
|
438 |
+
* @param string $product_id product ID, if we are on a Product page
|
439 |
+
* @return array
|
440 |
+
* @throws \Exception
|
441 |
+
*/
|
442 |
+
public function process_payment( $payment_data, $product_id ) {
|
443 |
+
|
444 |
+
$order = null;
|
445 |
+
|
446 |
+
try {
|
447 |
+
|
448 |
+
$this->log( "Payment Method Response:\n" . $payment_data . "\n" );
|
449 |
+
|
450 |
+
$payment_data = json_decode( $payment_data, true );
|
451 |
+
|
452 |
+
$this->store_payment_response( $payment_data );
|
453 |
+
|
454 |
+
// if this is a single product page, make sure the cart gets populated
|
455 |
+
$this->add_product_to_cart( $product_id );
|
456 |
+
|
457 |
+
$order = Orders::create_order( WC()->cart, [ 'created_via' => 'google_pay' ] );
|
458 |
+
|
459 |
+
$order->set_payment_method( $this->get_processing_gateway() );
|
460 |
+
|
461 |
+
// if we got to this point, the payment was authorized by Google Pay
|
462 |
+
// from here on out, it's up to the gateway to not screw things up.
|
463 |
+
$order->add_order_note( __( 'Google Pay payment authorized.', 'woocommerce-plugin-framework' ) );
|
464 |
+
|
465 |
+
if ( ! empty( $payment_data['paymentMethodData']['info']['billingAddress'] ) ) {
|
466 |
+
|
467 |
+
$billing_address_data = $payment_data['paymentMethodData']['info']['billingAddress'];
|
468 |
+
|
469 |
+
if ( ! empty( $billing_address_data['name'] ) ) {
|
470 |
+
$first_name = strstr( $billing_address_data['name'], ' ', true );
|
471 |
+
$last_name = strstr( $billing_address_data['name'], ' ' );
|
472 |
+
}
|
473 |
+
|
474 |
+
$billing_address = [
|
475 |
+
'first_name' => isset( $first_name ) ? $first_name : '',
|
476 |
+
'last_name' => isset( $last_name ) ? $last_name : '',
|
477 |
+
'address_1' => isset( $billing_address_data['address1'] ) ? $billing_address_data['address1'] : '',
|
478 |
+
'address_2' => isset( $billing_address_data['address2'] ) ? $billing_address_data['address2'] : '',
|
479 |
+
'city' => isset( $billing_address_data['locality'] ) ? $billing_address_data['locality'] : '',
|
480 |
+
'state' => isset( $billing_address_data['administrativeArea'] ) ? $billing_address_data['administrativeArea'] : '',
|
481 |
+
'postcode' => isset( $billing_address_data['postalCode'] ) ? $billing_address_data['postalCode'] : '',
|
482 |
+
'country' => isset( $billing_address_data['countryCode'] ) ? $billing_address_data['countryCode'] : '',
|
483 |
+
];
|
484 |
+
|
485 |
+
$order->set_address( $billing_address, 'billing' );
|
486 |
+
|
487 |
+
$order->set_billing_phone( isset( $billing_address_data['phoneNumber'] ) ? $billing_address_data['phoneNumber'] : '' );
|
488 |
+
}
|
489 |
+
|
490 |
+
$order->set_billing_email( isset( $payment_data['email'] ) ? $payment_data['email'] : '' );
|
491 |
+
|
492 |
+
if ( ! empty( $payment_data['shippingAddress'] ) ) {
|
493 |
+
|
494 |
+
$shipping_address_data = $payment_data['shippingAddress'];
|
495 |
+
|
496 |
+
if ( ! empty( $shipping_address_data['name'] ) ) {
|
497 |
+
$first_name = strstr( $shipping_address_data['name'], ' ', true );
|
498 |
+
$last_name = strstr( $shipping_address_data['name'], ' ' );
|
499 |
+
}
|
500 |
+
|
501 |
+
$shipping_address = [
|
502 |
+
'first_name' => isset( $first_name ) ? $first_name : '',
|
503 |
+
'last_name' => isset( $last_name ) ? $last_name : '',
|
504 |
+
'address_1' => isset( $shipping_address_data['address1'] ) ? $shipping_address_data['address1'] : '',
|
505 |
+
'address_2' => isset( $shipping_address_data['address2'] ) ? $shipping_address_data['address2'] : '',
|
506 |
+
'city' => isset( $shipping_address_data['locality'] ) ? $shipping_address_data['locality'] : '',
|
507 |
+
'state' => isset( $shipping_address_data['administrativeArea'] ) ? $shipping_address_data['administrativeArea'] : '',
|
508 |
+
'postcode' => isset( $shipping_address_data['postalCode'] ) ? $shipping_address_data['postalCode'] : '',
|
509 |
+
'country' => isset( $shipping_address_data['countryCode'] ) ? $shipping_address_data['countryCode'] : '',
|
510 |
+
];
|
511 |
+
|
512 |
+
$order->set_address( $shipping_address, 'shipping' );
|
513 |
+
}
|
514 |
+
|
515 |
+
$order->save();
|
516 |
+
|
517 |
+
// add Google Pay response data to the order
|
518 |
+
add_filter( 'wc_payment_gateway_' . $this->get_processing_gateway()->get_id() . '_get_order', [ $this, 'add_order_data' ] );
|
519 |
+
|
520 |
+
if ( $this->is_test_mode() ) {
|
521 |
+
$result = $this->process_test_payment( $order );
|
522 |
+
} else {
|
523 |
+
$result = $this->get_processing_gateway()->process_payment( $order->get_id() );
|
524 |
+
}
|
525 |
+
|
526 |
+
if ( ! isset( $result['result'] ) || 'success' !== $result['result'] ) {
|
527 |
+
throw new SV_WC_Payment_Gateway_Exception( 'Gateway processing error.' );
|
528 |
+
}
|
529 |
+
|
530 |
+
return $result;
|
531 |
+
|
532 |
+
} catch ( \Exception $e ) {
|
533 |
+
|
534 |
+
if ( $order ) {
|
535 |
+
|
536 |
+
$order->add_order_note( sprintf(
|
537 |
+
/** translators: Placeholders: %s - the error message */
|
538 |
+
__( 'Google Pay payment failed. %s', 'woocommerce-plugin-framework' ),
|
539 |
+
$e->getMessage()
|
540 |
+
) );
|
541 |
+
}
|
542 |
+
|
543 |
+
throw $e;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
|
547 |
+
|
548 |
+
/**
|
549 |
+
* Gets the stored payment response data.
|
550 |
+
*
|
551 |
+
* @since 5.10.0
|
552 |
+
*
|
553 |
+
* @return mixed|array $data
|
554 |
+
*/
|
555 |
+
public function get_stored_payment_response() {
|
556 |
+
|
557 |
+
return WC()->session->get( 'google_pay_payment_response', [] );
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Stores payment response data for later use.
|
563 |
+
*
|
564 |
+
* @since 5.10.0
|
565 |
+
*
|
566 |
+
* @param mixed|array $data
|
567 |
+
*/
|
568 |
+
public function store_payment_response( $data ) {
|
569 |
+
|
570 |
+
WC()->session->set( 'google_pay_payment_response', $data );
|
571 |
+
}
|
572 |
+
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Filters and sets the customer's taxable address.
|
576 |
+
*
|
577 |
+
* This is necessary because Google Pay doesn't ever provide a billing
|
578 |
+
* address until after payment is complete. If the shop is set to calculate
|
579 |
+
* tax based on the billing address, we need to use the shipping address
|
580 |
+
* to at least get some rates for new customers.
|
581 |
+
*
|
582 |
+
* @internal
|
583 |
+
*
|
584 |
+
* @since 5.10.0
|
585 |
+
*
|
586 |
+
* @param array $address taxable address
|
587 |
+
* @return array
|
588 |
+
*/
|
589 |
+
public function set_customer_taxable_address( $address ) {
|
590 |
+
|
591 |
+
// set to the shipping address provided by Google Pay if:
|
592 |
+
// 1. billing is not available
|
593 |
+
// 2. shipping is available
|
594 |
+
// 3. taxes aren't configured to use the shop base
|
595 |
+
if ( empty( WC()->customer->get_billing_postcode() ) && WC()->customer->get_shipping_postcode() && 'base' !== get_option( 'woocommerce_tax_based_on' ) ) {
|
596 |
+
|
597 |
+
$address = [
|
598 |
+
WC()->customer->get_shipping_country(),
|
599 |
+
WC()->customer->get_shipping_state(),
|
600 |
+
WC()->customer->get_shipping_postcode(),
|
601 |
+
WC()->customer->get_shipping_city(),
|
602 |
+
];
|
603 |
+
}
|
604 |
+
|
605 |
+
return $address;
|
606 |
+
}
|
607 |
+
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Allows the processing gateway to add Google Pay details to the payment data.
|
611 |
+
*
|
612 |
+
* @internal
|
613 |
+
*
|
614 |
+
* @since 5.10.0
|
615 |
+
*
|
616 |
+
* @param \WC_Order $order the order object
|
617 |
+
* @return \WC_Order
|
618 |
+
*/
|
619 |
+
public function add_order_data( $order ) {
|
620 |
+
|
621 |
+
if ( $response = $this->get_stored_payment_response() ) {
|
622 |
+
|
623 |
+
$order = $this->get_processing_gateway()->get_order_for_google_pay( $order, $response );
|
624 |
+
}
|
625 |
+
|
626 |
+
return $order;
|
627 |
+
}
|
628 |
+
|
629 |
+
|
630 |
+
/**
|
631 |
+
* Gets the currencies supported by the gateway and available for shipping.
|
632 |
+
*
|
633 |
+
* @since 5.10.0
|
634 |
+
*
|
635 |
+
* @return array
|
636 |
+
*/
|
637 |
+
public function get_available_countries() {
|
638 |
+
|
639 |
+
$gateway_available_countries = $this->get_processing_gateway()->get_available_countries();
|
640 |
+
$shipping_countries = array_keys( WC()->countries->get_shipping_countries() );
|
641 |
+
|
642 |
+
return ! empty( $gateway_available_countries ) ? array_intersect( $gateway_available_countries, $shipping_countries ) : $shipping_countries;
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
/**
|
647 |
+
* Gets the currencies accepted by the gateway's Google Pay integration.
|
648 |
+
*
|
649 |
+
* @since 5.10.0
|
650 |
+
*
|
651 |
+
* @return array
|
652 |
+
*/
|
653 |
+
public function get_accepted_currencies() {
|
654 |
+
|
655 |
+
$currencies = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_google_pay_currencies() : [];
|
656 |
+
|
657 |
+
/**
|
658 |
+
* Filters the currencies accepted by the gateway's Google Pay integration.
|
659 |
+
*
|
660 |
+
* @since 5.10.0
|
661 |
+
* @return array
|
662 |
+
*/
|
663 |
+
return apply_filters( 'sv_wc_google_pay_accepted_currencies', $currencies );
|
664 |
+
}
|
665 |
+
|
666 |
+
|
667 |
+
/**
|
668 |
+
* Gets the supported networks for Google Pay.
|
669 |
+
*
|
670 |
+
* @since 5.10.0
|
671 |
+
*
|
672 |
+
* @return array
|
673 |
+
*/
|
674 |
+
public function get_supported_networks() {
|
675 |
+
|
676 |
+
$accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : [];
|
677 |
+
|
678 |
+
$accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
|
679 |
+
|
680 |
+
$valid_networks = [
|
681 |
+
SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'AMEX',
|
682 |
+
SV_WC_Payment_Gateway_Helper::CARD_TYPE_DISCOVER => 'DISCOVER',
|
683 |
+
'interac' => 'INTERAC',
|
684 |
+
SV_WC_Payment_Gateway_Helper::CARD_TYPE_JCB => 'JCB',
|
685 |
+
SV_WC_Payment_Gateway_Helper::CARD_TYPE_MASTERCARD => 'MASTERCARD',
|
686 |
+
SV_WC_Payment_Gateway_Helper::CARD_TYPE_VISA => 'VISA',
|
687 |
+
];
|
688 |
+
|
689 |
+
$networks = array_intersect_key( $valid_networks, array_flip( $accepted_card_types ) );
|
690 |
+
|
691 |
+
/**
|
692 |
+
* Filters the supported Google Pay networks (card types).
|
693 |
+
*
|
694 |
+
* @since 5.10.0
|
695 |
+
*
|
696 |
+
* @param array $networks the supported networks
|
697 |
+
* @param Google_Pay $handler the Google Pay handler
|
698 |
+
*/
|
699 |
+
return apply_filters( 'sv_wc_google_pay_supported_networks', array_values( $networks ), $this );
|
700 |
+
}
|
701 |
+
|
702 |
+
|
703 |
+
/**
|
704 |
+
* Gets the gateway merchant ID.
|
705 |
+
*
|
706 |
+
* Each plugin can override this method to get the merchant ID from their own setting.
|
707 |
+
*
|
708 |
+
* @since 5.10.0
|
709 |
+
*
|
710 |
+
* @return string
|
711 |
+
*/
|
712 |
+
public function get_merchant_id() {
|
713 |
+
|
714 |
+
return method_exists( $this->get_processing_gateway(), 'get_merchant_id' ) ? $this->get_processing_gateway()->get_merchant_id() : '';
|
715 |
+
}
|
716 |
+
|
717 |
+
|
718 |
+
}
|
719 |
+
|
720 |
+
|
721 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay/class-sv-wc-payment-gateway-apple-pay-orders.php → External_Checkout/Orders.php}
RENAMED
@@ -16,55 +16,52 @@
|
|
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/
|
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\
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
|
|
31 |
|
32 |
/**
|
33 |
-
*
|
|
|
|
|
34 |
*
|
35 |
-
* @since
|
36 |
*/
|
37 |
-
class
|
38 |
|
39 |
|
40 |
/**
|
41 |
* Creates an order from a cart.
|
42 |
*
|
43 |
-
* @since
|
44 |
*
|
45 |
* @param \WC_Cart $cart cart object
|
46 |
-
* @
|
47 |
-
* @
|
|
|
48 |
* @throws \Exception
|
49 |
*/
|
50 |
-
public static function create_order( \WC_Cart $cart ) {
|
51 |
|
52 |
$cart->calculate_totals();
|
53 |
|
54 |
try {
|
55 |
|
56 |
-
|
57 |
-
$cart_hash = $cart->get_cart_hash();
|
58 |
-
} else {
|
59 |
-
$cart_hash = md5( json_encode( wc_clean( $cart->get_cart_for_session() ) ) . $cart->get_total( 'edit' ) );
|
60 |
-
}
|
61 |
-
|
62 |
-
$order_data = [
|
63 |
'status' => apply_filters( 'woocommerce_default_order_status', 'pending' ),
|
64 |
'customer_id' => apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() ),
|
65 |
-
'cart_hash' => $
|
66 |
-
|
67 |
-
];
|
68 |
|
69 |
$order = self::get_order_object( $order_data );
|
70 |
|
@@ -92,21 +89,41 @@ class SV_WC_Payment_Gateway_Apple_Pay_Orders {
|
|
92 |
|
93 |
return $order;
|
94 |
|
95 |
-
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
|
|
96 |
throw $e;
|
97 |
}
|
98 |
}
|
99 |
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
/**
|
102 |
* Gets an order object for payment.
|
103 |
*
|
104 |
-
* @since
|
105 |
*
|
106 |
* @see \WC_Checkout::create_order()
|
|
|
107 |
* @param array $order_data the order data
|
108 |
* @return \WC_Order
|
109 |
-
* @throws SV_WC_Payment_Gateway_Exception
|
110 |
*/
|
111 |
public static function get_order_object( $order_data ) {
|
112 |
|
@@ -120,7 +137,7 @@ class SV_WC_Payment_Gateway_Apple_Pay_Orders {
|
|
120 |
$order = wc_update_order( $order_data );
|
121 |
|
122 |
if ( is_wp_error( $order ) ) {
|
123 |
-
throw new SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 522 ) );
|
124 |
}
|
125 |
|
126 |
/** This action is documented by WooCommerce in includes/class-wc-checkout.php */
|
@@ -133,11 +150,11 @@ class SV_WC_Payment_Gateway_Apple_Pay_Orders {
|
|
133 |
$order = wc_create_order( $order_data );
|
134 |
|
135 |
if ( is_wp_error( $order ) ) {
|
136 |
-
throw new SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 520 ) );
|
137 |
}
|
138 |
|
139 |
if ( false === $order ) {
|
140 |
-
throw new SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 521 ) );
|
141 |
}
|
142 |
|
143 |
// set the new order ID so it can be resumed in case of failure
|
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/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_5\Payment_Gateway\External_Checkout;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
+
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( __NAMESPACE__ . '\\Orders' ) ) :
|
32 |
|
33 |
/**
|
34 |
+
* A helper that handles order creation outside the regular WC checkout process.
|
35 |
+
*
|
36 |
+
* @see \WC_Checkout
|
37 |
*
|
38 |
+
* @since 5.10.0
|
39 |
*/
|
40 |
+
class Orders {
|
41 |
|
42 |
|
43 |
/**
|
44 |
* Creates an order from a cart.
|
45 |
*
|
46 |
+
* @since 5.10.0
|
47 |
*
|
48 |
* @param \WC_Cart $cart cart object
|
49 |
+
* @param array $order_data order data
|
50 |
+
* @return \WC_Order
|
51 |
+
* @throws Framework\SV_WC_Payment_Gateway_Exception
|
52 |
* @throws \Exception
|
53 |
*/
|
54 |
+
public static function create_order( \WC_Cart $cart, $order_data = [] ) {
|
55 |
|
56 |
$cart->calculate_totals();
|
57 |
|
58 |
try {
|
59 |
|
60 |
+
$order_data = wp_parse_args( $order_data, [
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
'status' => apply_filters( 'woocommerce_default_order_status', 'pending' ),
|
62 |
'customer_id' => apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() ),
|
63 |
+
'cart_hash' => self::get_cart_hash( $cart ),
|
64 |
+
] );
|
|
|
65 |
|
66 |
$order = self::get_order_object( $order_data );
|
67 |
|
89 |
|
90 |
return $order;
|
91 |
|
92 |
+
} catch ( Framework\SV_WC_Payment_Gateway_Exception $e ) {
|
93 |
+
|
94 |
throw $e;
|
95 |
}
|
96 |
}
|
97 |
|
98 |
|
99 |
+
/**
|
100 |
+
* Gets the hash of the cart based on the cart contents.
|
101 |
+
*
|
102 |
+
* @since 5.10.0
|
103 |
+
*
|
104 |
+
* @param \WC_Cart $cart cart object
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
private static function get_cart_hash( \WC_Cart $cart ) {
|
108 |
+
|
109 |
+
if ( Framework\SV_WC_Plugin_Compatibility::is_wc_version_gte( '3.6' ) ) {
|
110 |
+
return $cart->get_cart_hash();
|
111 |
+
}
|
112 |
+
|
113 |
+
return md5( json_encode( wc_clean( $cart->get_cart_for_session() ) ) . $cart->get_total( 'edit' ) );
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
/**
|
118 |
* Gets an order object for payment.
|
119 |
*
|
120 |
+
* @since 5.10.0
|
121 |
*
|
122 |
* @see \WC_Checkout::create_order()
|
123 |
+
*
|
124 |
* @param array $order_data the order data
|
125 |
* @return \WC_Order
|
126 |
+
* @throws Framework\SV_WC_Payment_Gateway_Exception
|
127 |
*/
|
128 |
public static function get_order_object( $order_data ) {
|
129 |
|
137 |
$order = wc_update_order( $order_data );
|
138 |
|
139 |
if ( is_wp_error( $order ) ) {
|
140 |
+
throw new Framework\SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 522 ) );
|
141 |
}
|
142 |
|
143 |
/** This action is documented by WooCommerce in includes/class-wc-checkout.php */
|
150 |
$order = wc_create_order( $order_data );
|
151 |
|
152 |
if ( is_wp_error( $order ) ) {
|
153 |
+
throw new Framework\SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 520 ) );
|
154 |
}
|
155 |
|
156 |
if ( false === $order ) {
|
157 |
+
throw new Framework\SV_WC_Payment_Gateway_Exception( sprintf( __( 'Error %d: Unable to create order. Please try again.', 'woocommerce-plugin-framework' ), 521 ) );
|
158 |
}
|
159 |
|
160 |
// set the new order ID so it can be resumed in case of failure
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api-request.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api-response.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-api.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
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\\
|
61 |
}
|
62 |
|
63 |
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
57 |
$this->set_request_content_type_header( 'application/json' );
|
58 |
$this->set_request_accept_header( 'application/json' );
|
59 |
|
60 |
+
$this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' );
|
61 |
}
|
62 |
|
63 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php
ADDED
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Payment Gateway 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/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_5;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Admin;
|
28 |
+
|
29 |
+
defined( 'ABSPATH' ) or exit;
|
30 |
+
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) :
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Sets up the Apple Pay settings screen.
|
36 |
+
*
|
37 |
+
* @since 4.7.0
|
38 |
+
*/
|
39 |
+
class SV_WC_Payment_Gateway_Apple_Pay_Admin extends Admin {
|
40 |
+
|
41 |
+
|
42 |
+
/** @var SV_WC_Payment_Gateway_Apple_Pay the Apple Pay handler instance */
|
43 |
+
protected $handler;
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Construct the class.
|
48 |
+
*
|
49 |
+
* @since 4.7.0
|
50 |
+
*
|
51 |
+
* @param SV_WC_Payment_Gateway_Apple_Pay $handler main Apple Pay handler instance
|
52 |
+
*/
|
53 |
+
public function __construct( $handler ) {
|
54 |
+
|
55 |
+
$this->section_id = 'apple-pay';
|
56 |
+
$this->handler = $handler;
|
57 |
+
|
58 |
+
parent::__construct();
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Gets the name of the Apple Pay settings section.
|
64 |
+
*
|
65 |
+
* @since 5.10.0
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
protected function get_settings_section_name() {
|
70 |
+
|
71 |
+
return __( 'Apple Pay', 'woocommerce-plugin-framework' );
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Gets all of the combined settings.
|
77 |
+
*
|
78 |
+
* @since 4.7.0
|
79 |
+
*
|
80 |
+
* @return array $settings combined settings.
|
81 |
+
*/
|
82 |
+
public function get_settings() {
|
83 |
+
|
84 |
+
$settings = [
|
85 |
+
|
86 |
+
[
|
87 |
+
'title' => __( 'Apple Pay', 'woocommerce-plugin-framework' ),
|
88 |
+
'type' => 'title',
|
89 |
+
],
|
90 |
+
|
91 |
+
[
|
92 |
+
'id' => 'sv_wc_apple_pay_enabled',
|
93 |
+
'title' => __( 'Enable / Disable', 'woocommerce-plugin-framework' ),
|
94 |
+
'desc' => __( 'Accept Apple Pay', 'woocommerce-plugin-framework' ),
|
95 |
+
'type' => 'checkbox',
|
96 |
+
'default' => 'no',
|
97 |
+
],
|
98 |
+
|
99 |
+
[
|
100 |
+
'id' => 'sv_wc_apple_pay_display_locations',
|
101 |
+
'title' => __( 'Allow Apple Pay on', 'woocommerce-plugin-framework' ),
|
102 |
+
'type' => 'multiselect',
|
103 |
+
'class' => 'wc-enhanced-select',
|
104 |
+
'css' => 'width: 350px;',
|
105 |
+
'options' => $this->get_display_location_options(),
|
106 |
+
'default' => array_keys( $this->get_display_location_options() ),
|
107 |
+
],
|
108 |
+
|
109 |
+
[
|
110 |
+
'id' => 'sv_wc_apple_pay_button_style',
|
111 |
+
'title' => __( 'Button Style', 'woocommerce-plugin-framework' ),
|
112 |
+
'type' => 'select',
|
113 |
+
'options' => [
|
114 |
+
'black' => __( 'Black', 'woocommerce-plugin-framework' ),
|
115 |
+
'white' => __( 'White', 'woocommerce-plugin-framework' ),
|
116 |
+
'white-with-line' => __( 'White with outline', 'woocommerce-plugin-framework' ),
|
117 |
+
],
|
118 |
+
'default' => 'black',
|
119 |
+
],
|
120 |
+
|
121 |
+
[
|
122 |
+
'type' => 'sectionend',
|
123 |
+
],
|
124 |
+
];
|
125 |
+
|
126 |
+
$settings = array_merge( $settings, $this->get_connection_settings() );
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Filter the settings fields for Apple Pay.
|
130 |
+
*
|
131 |
+
* @param array $settings The combined settings.
|
132 |
+
*
|
133 |
+
* @since 1.0.0
|
134 |
+
*/
|
135 |
+
return apply_filters( 'woocommerce_get_settings_apple_pay', $settings );
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Gets the connection settings for Apple Pay.
|
141 |
+
*
|
142 |
+
* @since 5.10.0
|
143 |
+
*
|
144 |
+
* @return array $settings connection settings
|
145 |
+
*/
|
146 |
+
protected function get_connection_settings() {
|
147 |
+
|
148 |
+
$connection_settings = [
|
149 |
+
[
|
150 |
+
'title' => __( 'Connection Settings', 'woocommerce-plugin-framework' ),
|
151 |
+
'type' => 'title',
|
152 |
+
],
|
153 |
+
];
|
154 |
+
|
155 |
+
if ( $this->handler->requires_merchant_id() ) {
|
156 |
+
|
157 |
+
$connection_settings[] = [
|
158 |
+
'id' => 'sv_wc_apple_pay_merchant_id',
|
159 |
+
'title' => __( 'Apple Merchant ID', 'woocommerce-plugin-framework' ),
|
160 |
+
'type' => 'text',
|
161 |
+
'desc' => sprintf(
|
162 |
+
/** translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag */
|
163 |
+
__( 'This is found in your %1$sApple developer account%2$s', 'woocommerce-plugin-framework' ),
|
164 |
+
'<a href="https://developer.apple.com" target="_blank">', '</a>'
|
165 |
+
),
|
166 |
+
];
|
167 |
+
}
|
168 |
+
|
169 |
+
if ( $this->handler->requires_certificate() ) {
|
170 |
+
|
171 |
+
$connection_settings[] = [
|
172 |
+
'id' => 'sv_wc_apple_pay_cert_path',
|
173 |
+
'title' => __( 'Certificate Path', 'woocommerce-plugin-framework' ),
|
174 |
+
'type' => 'text',
|
175 |
+
'desc_tip' => 'The full system path to your certificate file from Apple. For security reasons you should store this outside of your web root.',
|
176 |
+
'desc' => sprintf(
|
177 |
+
/* translators: Placeholders: %s - the server's web root path */
|
178 |
+
__( 'For reference, your current web root path is: %s', 'woocommerce-plugin-framework' ),
|
179 |
+
'<code>' . ABSPATH . '</code>'
|
180 |
+
),
|
181 |
+
];
|
182 |
+
}
|
183 |
+
|
184 |
+
$connection_settings = $this->add_processing_gateway_settings( $connection_settings );
|
185 |
+
|
186 |
+
$connection_settings[] = [
|
187 |
+
'id' => 'sv_wc_apple_pay_test_mode',
|
188 |
+
'title' => __( 'Test Mode', 'woocommerce-plugin-framework' ),
|
189 |
+
'desc' => __( 'Enable to test Apple Pay functionality throughout your sites without processing real payments.', 'woocommerce-plugin-framework' ),
|
190 |
+
'type' => 'checkbox',
|
191 |
+
'default' => 'no',
|
192 |
+
];
|
193 |
+
|
194 |
+
$connection_settings[] = array(
|
195 |
+
'type' => 'sectionend',
|
196 |
+
);
|
197 |
+
|
198 |
+
return $connection_settings;
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Gets the gateways that declare support for Apple Pay.
|
204 |
+
*
|
205 |
+
* @since 5.10.0
|
206 |
+
*
|
207 |
+
* @return array
|
208 |
+
*/
|
209 |
+
protected function get_supporting_gateways() {
|
210 |
+
|
211 |
+
return $this->handler->get_supporting_gateways();
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Gets the error messages for configuration issues that need attention.
|
217 |
+
*
|
218 |
+
* @since 5.10.0
|
219 |
+
*
|
220 |
+
* @return string[] error messages
|
221 |
+
*/
|
222 |
+
protected function get_configuration_errors() {
|
223 |
+
|
224 |
+
$errors = parent::get_configuration_errors();
|
225 |
+
|
226 |
+
// HTTPS notice
|
227 |
+
if ( ! wc_site_is_https() ) {
|
228 |
+
$errors[] = __( 'Your site must be served over HTTPS with a valid SSL certificate.', 'woocommerce-plugin-framework' );
|
229 |
+
}
|
230 |
+
|
231 |
+
// bad cert config notice
|
232 |
+
// this first checks if the option has been set so the notice is not
|
233 |
+
// displayed without the user having the chance to set it.
|
234 |
+
if ( false !== $this->handler->get_cert_path() && ! $this->handler->is_cert_configured() ) {
|
235 |
+
|
236 |
+
$errors[] = sprintf(
|
237 |
+
/** translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag */
|
238 |
+
__( 'Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check your path configuration.', 'woocommerce-plugin-framework' ),
|
239 |
+
'<strong>', '</strong>'
|
240 |
+
);
|
241 |
+
}
|
242 |
+
|
243 |
+
return $errors;
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
endif;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay-ajax.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay-frontend.php
RENAMED
@@ -16,17 +16,17 @@
|
|
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/Payment-Gateway/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\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -34,18 +34,9 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_7_1\\SV_WC_Pa
|
|
34 |
*
|
35 |
* @since 4.7.0
|
36 |
*/
|
37 |
-
class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends
|
38 |
|
39 |
|
40 |
-
/** @var SV_WC_Payment_Gateway_Plugin $plugin the gateway plugin instance */
|
41 |
-
protected $plugin;
|
42 |
-
|
43 |
-
/** @var SV_WC_Payment_Gateway_Apple_Pay $handler the Apple Pay handler instance */
|
44 |
-
protected $handler;
|
45 |
-
|
46 |
-
/** @var SV_WC_Payment_Gateway $gateway the gateway instance */
|
47 |
-
protected $gateway;
|
48 |
-
|
49 |
/** @var string JS handler base class name, without the FW version */
|
50 |
protected $js_handler_base_class_name = 'SV_WC_Apple_Pay_Handler';
|
51 |
|
@@ -60,13 +51,7 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
60 |
*/
|
61 |
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin, SV_WC_Payment_Gateway_Apple_Pay $handler ) {
|
62 |
|
63 |
-
$
|
64 |
-
|
65 |
-
$this->handler = $handler;
|
66 |
-
|
67 |
-
$this->gateway = $this->get_handler()->get_processing_gateway();
|
68 |
-
|
69 |
-
parent::__construct();
|
70 |
}
|
71 |
|
72 |
|
@@ -88,25 +73,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
88 |
}
|
89 |
|
90 |
|
91 |
-
/**
|
92 |
-
* Initializes the scripts and hooks.
|
93 |
-
*
|
94 |
-
* @since 4.7.0
|
95 |
-
*/
|
96 |
-
public function init() {
|
97 |
-
|
98 |
-
$locations = $this->get_display_locations();
|
99 |
-
|
100 |
-
if ( is_product() && in_array( 'product', $locations, true ) ) {
|
101 |
-
$this->init_product();
|
102 |
-
} else if ( is_cart() && in_array( 'cart', $locations, true ) ) {
|
103 |
-
$this->init_cart();
|
104 |
-
} else if ( is_checkout() && in_array( 'checkout', $locations, true ) ) {
|
105 |
-
$this->init_checkout();
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
/**
|
111 |
* Gets the script ID.
|
112 |
*
|
@@ -133,19 +99,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
133 |
}
|
134 |
|
135 |
|
136 |
-
/**
|
137 |
-
* Gets the configured display locations.
|
138 |
-
*
|
139 |
-
* @since 4.7.0
|
140 |
-
*
|
141 |
-
* @return array
|
142 |
-
*/
|
143 |
-
protected function get_display_locations() {
|
144 |
-
|
145 |
-
return get_option( 'sv_wc_apple_pay_display_locations', array() );
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
/**
|
150 |
* Enqueues the scripts.
|
151 |
*
|
@@ -153,9 +106,11 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
153 |
*/
|
154 |
public function enqueue_scripts() {
|
155 |
|
156 |
-
|
|
|
|
|
157 |
|
158 |
-
wp_enqueue_script( 'sv-wc-apple-pay-
|
159 |
}
|
160 |
|
161 |
|
@@ -188,85 +143,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
188 |
}
|
189 |
|
190 |
|
191 |
-
/**
|
192 |
-
* Enqueues an Apple Pay JS handler.
|
193 |
-
*
|
194 |
-
* @since 5.6.0
|
195 |
-
*
|
196 |
-
* @param array $args handler arguments
|
197 |
-
* @param string $object_name JS object name
|
198 |
-
* @param string $handler_name handler class name
|
199 |
-
*/
|
200 |
-
protected function enqueue_js_handler( array $args, $object_name = '', $handler_name = '' ) {
|
201 |
-
|
202 |
-
wc_enqueue_js( $this->get_safe_handler_js( $args, $handler_name, $object_name ) );
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
/**
|
207 |
-
* Gets the handler instantiation JS.
|
208 |
-
*
|
209 |
-
* @since 5.7.0
|
210 |
-
*
|
211 |
-
* @param array $additional_args additional handler arguments, if any
|
212 |
-
* @param string $handler_name handler name, if different from self::get_js_handler_class_name()
|
213 |
-
* @param string $object_name object name, if different from self::get_js_handler_object_name()
|
214 |
-
* @return string
|
215 |
-
*/
|
216 |
-
protected function get_handler_js( array $additional_args = [], $handler_name = '', $object_name = '' ) {
|
217 |
-
|
218 |
-
$js = parent::get_handler_js( $additional_args, $handler_name );
|
219 |
-
|
220 |
-
$js .= sprintf( 'window.%s.init();', $object_name ?: $this->get_js_handler_object_name() );
|
221 |
-
|
222 |
-
return $js;
|
223 |
-
}
|
224 |
-
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Gets the JS handler class name.
|
228 |
-
*
|
229 |
-
* Concrete implementations can override this with their own handler.
|
230 |
-
*
|
231 |
-
* @since 5.6.0
|
232 |
-
* @deprecated 5.7.0
|
233 |
-
*
|
234 |
-
* @return string
|
235 |
-
*/
|
236 |
-
protected function get_js_handler_name() {
|
237 |
-
|
238 |
-
wc_deprecated_function( __METHOD__, '5.7.0', __CLASS__ . '::get_js_handler_class_name()' );
|
239 |
-
|
240 |
-
return parent::get_js_handler_class_name();
|
241 |
-
}
|
242 |
-
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Adds a log entry.
|
246 |
-
*
|
247 |
-
* @since 5.7.0
|
248 |
-
*
|
249 |
-
* @param string $message message to log
|
250 |
-
*/
|
251 |
-
protected function log_event( $message ) {
|
252 |
-
|
253 |
-
$this->get_gateway()->add_debug_message( $message );
|
254 |
-
}
|
255 |
-
|
256 |
-
|
257 |
-
/**
|
258 |
-
* Determines whether logging is enabled.
|
259 |
-
*
|
260 |
-
* @since 5.7.0
|
261 |
-
*
|
262 |
-
* @return bool
|
263 |
-
*/
|
264 |
-
protected function is_logging_enabled() {
|
265 |
-
|
266 |
-
return $this->get_gateway()->debug_log();
|
267 |
-
}
|
268 |
-
|
269 |
-
|
270 |
/**
|
271 |
* Renders an Apple Pay button.
|
272 |
*
|
@@ -314,65 +190,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
314 |
}
|
315 |
|
316 |
|
317 |
-
/**
|
318 |
-
* Renders a notice informing the customer that by purchasing they are accepting the website's terms and conditions.
|
319 |
-
*
|
320 |
-
* Only displayed if a Terms and conditions page is configured.
|
321 |
-
*
|
322 |
-
* @internal
|
323 |
-
*
|
324 |
-
* @since 5.5.4
|
325 |
-
*/
|
326 |
-
public function render_terms_notice() {
|
327 |
-
|
328 |
-
/** This filter is documented by WooCommerce in templates/checkout/terms.php */
|
329 |
-
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) && wc_terms_and_conditions_checkbox_enabled() ) {
|
330 |
-
|
331 |
-
$default_text = sprintf(
|
332 |
-
/** translators: Placeholders: %1$s - opening HTML link tag pointing to the terms & conditions page, %2$s closing HTML link tag */
|
333 |
-
__( 'By submitting your payment, you agree to our %1$sterms and conditions%2$s.', 'woocommerce-plugin-framework' ),
|
334 |
-
'<a href="' . esc_url( get_permalink( wc_terms_and_conditions_page_id() ) ) . '" class="sv-wc-apple-pay-terms-and-conditions-link" target="_blank">',
|
335 |
-
'</a>'
|
336 |
-
);
|
337 |
-
|
338 |
-
/**
|
339 |
-
* Allows to filter the text for the terms & conditions notice.
|
340 |
-
*
|
341 |
-
* @since 5.5.4
|
342 |
-
*
|
343 |
-
* @params string $default_text default notice text
|
344 |
-
*/
|
345 |
-
$text = apply_filters( 'sv_wc_apple_pay_terms_notice_text', $default_text );
|
346 |
-
|
347 |
-
?>
|
348 |
-
<div class="sv-wc-apple-pay-terms woocommerce-terms-and-conditions-wrapper">
|
349 |
-
<p><small><?php echo wp_kses_post( $text ); ?></small></p>
|
350 |
-
</div>
|
351 |
-
<?php
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
|
356 |
-
/**
|
357 |
-
* Initializes Apple Pay on the single product page.
|
358 |
-
*
|
359 |
-
* @since 4.7.0
|
360 |
-
*/
|
361 |
-
public function init_product() {
|
362 |
-
|
363 |
-
$product = wc_get_product( get_the_ID() );
|
364 |
-
|
365 |
-
if ( ! $product ) {
|
366 |
-
return;
|
367 |
-
}
|
368 |
-
|
369 |
-
$this->enqueue_js_handler( $this->get_product_js_handler_args( $product ) );
|
370 |
-
|
371 |
-
add_action( 'woocommerce_before_add_to_cart_button', [ $this, 'render_button' ] );
|
372 |
-
add_action( 'woocommerce_before_add_to_cart_button', [ $this, 'render_terms_notice' ] );
|
373 |
-
}
|
374 |
-
|
375 |
-
|
376 |
/**
|
377 |
* Gets the args passed to the product JS handler.
|
378 |
*
|
@@ -383,7 +200,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
383 |
*/
|
384 |
protected function get_product_js_handler_args( \WC_Product $product ) {
|
385 |
|
386 |
-
|
387 |
$args = [];
|
388 |
|
389 |
try {
|
@@ -422,25 +238,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
422 |
/** Cart functionality ****************************************************/
|
423 |
|
424 |
|
425 |
-
/**
|
426 |
-
* Initializes Apple Pay on the cart page.
|
427 |
-
*
|
428 |
-
* @since 4.7.0
|
429 |
-
*/
|
430 |
-
public function init_cart() {
|
431 |
-
|
432 |
-
// bail if the cart is missing or empty
|
433 |
-
if ( ! WC()->cart || WC()->cart->is_empty() ) {
|
434 |
-
return;
|
435 |
-
}
|
436 |
-
|
437 |
-
$this->enqueue_js_handler( $this->get_cart_js_handler_args( WC()->cart ) );
|
438 |
-
|
439 |
-
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'render_button' ] );
|
440 |
-
add_action( 'woocommerce_proceed_to_checkout', [ $this, 'render_terms_notice' ] );
|
441 |
-
}
|
442 |
-
|
443 |
-
|
444 |
/**
|
445 |
* Gets the args passed to the cart JS handler.
|
446 |
*
|
@@ -489,24 +286,6 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
489 |
/** Checkout functionality ************************************************/
|
490 |
|
491 |
|
492 |
-
/**
|
493 |
-
* Initializes Apple Pay on the checkout page.
|
494 |
-
*
|
495 |
-
* @since 4.7.0
|
496 |
-
*/
|
497 |
-
public function init_checkout() {
|
498 |
-
|
499 |
-
$this->enqueue_js_handler( $this->get_checkout_js_handler_args() );
|
500 |
-
|
501 |
-
if ( $this->get_plugin()->is_plugin_active( 'woocommerce-checkout-add-ons.php' ) ) {
|
502 |
-
add_action( 'woocommerce_review_order_before_payment', [ $this, 'render_button' ] );
|
503 |
-
add_action( 'woocommerce_review_order_before_payment', [ $this, 'render_terms_notice' ] );
|
504 |
-
} else {
|
505 |
-
add_action( 'woocommerce_before_checkout_form', [ $this, 'render_checkout_button' ], 15 );
|
506 |
-
}
|
507 |
-
}
|
508 |
-
|
509 |
-
|
510 |
/**
|
511 |
* Gets the args passed to the checkout JS handler.
|
512 |
*
|
@@ -537,74 +316,27 @@ class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends Handlers\Script_Handler {
|
|
537 |
}
|
538 |
|
539 |
|
540 |
-
/**
|
541 |
-
* Renders the Apple Pay button for checkout.
|
542 |
-
*
|
543 |
-
* @since 4.7.0
|
544 |
-
*/
|
545 |
-
public function render_checkout_button() {
|
546 |
-
|
547 |
-
?>
|
548 |
-
|
549 |
-
<div class="sv-wc-apply-pay-checkout">
|
550 |
-
|
551 |
-
<?php
|
552 |
-
$this->render_button();
|
553 |
-
$this->render_terms_notice();
|
554 |
-
?>
|
555 |
-
|
556 |
-
<span class="divider">
|
557 |
-
<?php /** translators: "or" as in "Pay with Apple Pay [or] regular checkout" */
|
558 |
-
esc_html_e( 'or', 'woocommerce-plugin-framework' ); ?>
|
559 |
-
</span>
|
560 |
-
|
561 |
-
</div>
|
562 |
-
|
563 |
-
<?php
|
564 |
-
}
|
565 |
|
566 |
|
567 |
/**
|
568 |
-
* Gets the
|
569 |
-
*
|
570 |
-
* @since 4.7.0
|
571 |
*
|
572 |
-
*
|
573 |
-
*/
|
574 |
-
protected function get_gateway() {
|
575 |
-
|
576 |
-
return $this->gateway;
|
577 |
-
}
|
578 |
-
|
579 |
-
|
580 |
-
/**
|
581 |
-
* Gets the gateway plugin instance.
|
582 |
*
|
583 |
-
* @since
|
|
|
584 |
*
|
585 |
-
* @return
|
586 |
*/
|
587 |
-
protected function
|
588 |
-
|
589 |
-
return $this->plugin;
|
590 |
-
}
|
591 |
|
592 |
-
|
593 |
-
* Gets the Apple Pay handler instance.
|
594 |
-
*
|
595 |
-
* @since 4.7.0
|
596 |
-
*
|
597 |
-
* @return SV_WC_Payment_Gateway_Apple_Pay
|
598 |
-
*/
|
599 |
-
protected function get_handler() {
|
600 |
|
601 |
-
return
|
602 |
}
|
603 |
|
604 |
|
605 |
-
/** Deprecated methods ********************************************************************************************/
|
606 |
-
|
607 |
-
|
608 |
/**
|
609 |
* Gets the JS handler parameters.
|
610 |
*
|
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/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_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
34 |
*
|
35 |
* @since 4.7.0
|
36 |
*/
|
37 |
+
class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Frontend {
|
38 |
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/** @var string JS handler base class name, without the FW version */
|
41 |
protected $js_handler_base_class_name = 'SV_WC_Apple_Pay_Handler';
|
42 |
|
51 |
*/
|
52 |
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin, SV_WC_Payment_Gateway_Apple_Pay $handler ) {
|
53 |
|
54 |
+
parent::__construct( $plugin, $handler );
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
|
73 |
}
|
74 |
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
/**
|
77 |
* Gets the script ID.
|
78 |
*
|
99 |
}
|
100 |
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
/**
|
103 |
* Enqueues the scripts.
|
104 |
*
|
106 |
*/
|
107 |
public function enqueue_scripts() {
|
108 |
|
109 |
+
parent::enqueue_scripts();
|
110 |
+
|
111 |
+
wp_enqueue_style( 'sv-wc-apple-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', array(), $this->get_plugin()->get_version() ); // TODO: min
|
112 |
|
113 |
+
wp_enqueue_script( 'sv-wc-apple-pay-v5_10_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', array( 'jquery' ), $this->get_plugin()->get_version(), true );
|
114 |
}
|
115 |
|
116 |
|
143 |
}
|
144 |
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
/**
|
147 |
* Renders an Apple Pay button.
|
148 |
*
|
190 |
}
|
191 |
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
/**
|
194 |
* Gets the args passed to the product JS handler.
|
195 |
*
|
200 |
*/
|
201 |
protected function get_product_js_handler_args( \WC_Product $product ) {
|
202 |
|
|
|
203 |
$args = [];
|
204 |
|
205 |
try {
|
238 |
/** Cart functionality ****************************************************/
|
239 |
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
/**
|
242 |
* Gets the args passed to the cart JS handler.
|
243 |
*
|
286 |
/** Checkout functionality ************************************************/
|
287 |
|
288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
/**
|
290 |
* Gets the args passed to the checkout JS handler.
|
291 |
*
|
316 |
}
|
317 |
|
318 |
|
319 |
+
/** Deprecated methods ********************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
|
321 |
|
322 |
/**
|
323 |
+
* Gets the JS handler class name.
|
|
|
|
|
324 |
*
|
325 |
+
* Concrete implementations can override this with their own handler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
*
|
327 |
+
* @since 5.6.0
|
328 |
+
* @deprecated 5.7.0
|
329 |
*
|
330 |
+
* @return string
|
331 |
*/
|
332 |
+
protected function get_js_handler_name() {
|
|
|
|
|
|
|
333 |
|
334 |
+
wc_deprecated_function( __METHOD__, '5.7.0', __CLASS__ . '::get_js_handler_class_name()' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
|
336 |
+
return parent::get_js_handler_class_name();
|
337 |
}
|
338 |
|
339 |
|
|
|
|
|
|
|
340 |
/**
|
341 |
* Gets the JS handler parameters.
|
342 |
*
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/{apple-pay → External_Checkout/apple-pay}/class-sv-wc-payment-gateway-apple-pay.php
RENAMED
@@ -16,17 +16,19 @@
|
|
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/Payment-Gateway/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\
|
|
|
|
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -34,7 +36,7 @@ if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_7_1\\SV_WC_Pa
|
|
34 |
*
|
35 |
* @since 4.7.0
|
36 |
*/
|
37 |
-
class SV_WC_Payment_Gateway_Apple_Pay {
|
38 |
|
39 |
|
40 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_Admin the admin instance */
|
@@ -46,9 +48,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
46 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_AJAX the AJAX instance */
|
47 |
protected $ajax;
|
48 |
|
49 |
-
/** @var SV_WC_Payment_Gateway_Plugin the plugin instance */
|
50 |
-
protected $plugin;
|
51 |
-
|
52 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_API the Apple Pay API */
|
53 |
protected $api;
|
54 |
|
@@ -62,9 +61,10 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
62 |
*/
|
63 |
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin ) {
|
64 |
|
65 |
-
$this->
|
|
|
66 |
|
67 |
-
$
|
68 |
|
69 |
if ( $this->is_available() ) {
|
70 |
add_filter( 'woocommerce_customer_taxable_address', array( $this, 'set_customer_taxable_address' ) );
|
@@ -72,22 +72,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
72 |
}
|
73 |
|
74 |
|
75 |
-
/**
|
76 |
-
* Initializes the Apple Pay handlers.
|
77 |
-
*
|
78 |
-
* @since 4.7.0
|
79 |
-
*/
|
80 |
-
protected function init() {
|
81 |
-
|
82 |
-
if ( is_admin() && ! is_ajax() ) {
|
83 |
-
$this->init_admin();
|
84 |
-
} else {
|
85 |
-
$this->init_ajax();
|
86 |
-
$this->init_frontend();
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
/**
|
92 |
* Initializes the admin handler.
|
93 |
*
|
@@ -121,6 +105,20 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
121 |
}
|
122 |
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
/**
|
125 |
* Processes the payment after an Apple Pay authorization.
|
126 |
*
|
@@ -145,7 +143,7 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
145 |
|
146 |
$this->log( "Payment Response:\n" . $payment_response->to_string_safe() . "\n" );
|
147 |
|
148 |
-
$order =
|
149 |
|
150 |
$order->set_payment_method( $this->get_processing_gateway() );
|
151 |
|
@@ -221,31 +219,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
221 |
}
|
222 |
|
223 |
|
224 |
-
/**
|
225 |
-
* Simulates a successful gateway payment response.
|
226 |
-
*
|
227 |
-
* This provides an easy way for merchants to test that their certificates
|
228 |
-
* and other settings are correctly configured and communicating with Apple
|
229 |
-
* without processing actual payments to test.
|
230 |
-
*
|
231 |
-
* @since 4.7.0
|
232 |
-
*
|
233 |
-
* @param \WC_Order $order order object
|
234 |
-
* @return array
|
235 |
-
*/
|
236 |
-
protected function process_test_payment( \WC_Order $order ) {
|
237 |
-
|
238 |
-
$order->payment_complete();
|
239 |
-
|
240 |
-
WC()->cart->empty_cart();
|
241 |
-
|
242 |
-
return array(
|
243 |
-
'result' => 'success',
|
244 |
-
'redirect' => $this->get_processing_gateway()->get_return_url( $order ),
|
245 |
-
);
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
/**
|
250 |
* Gets a single product payment request.
|
251 |
*
|
@@ -780,9 +753,9 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
780 |
|
781 |
if ( ! $this->api instanceof SV_WC_Payment_Gateway_Apple_Pay_API ) {
|
782 |
|
783 |
-
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php');
|
784 |
-
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php');
|
785 |
-
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php');
|
786 |
|
787 |
$this->api = new SV_WC_Payment_Gateway_Apple_Pay_API( $this->get_processing_gateway() );
|
788 |
}
|
@@ -791,27 +764,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
791 |
}
|
792 |
|
793 |
|
794 |
-
/**
|
795 |
-
* Adds a log entry to the gateway's debug log.
|
796 |
-
*
|
797 |
-
* @since 4.7.0
|
798 |
-
*
|
799 |
-
* @param string $message the log message to add
|
800 |
-
*/
|
801 |
-
public function log( $message ) {
|
802 |
-
|
803 |
-
$gateway = $this->get_processing_gateway();
|
804 |
-
|
805 |
-
if ( ! $gateway ) {
|
806 |
-
return;
|
807 |
-
}
|
808 |
-
|
809 |
-
if ( $gateway->debug_log() ) {
|
810 |
-
$gateway->get_plugin()->log( '[Apple Pay] ' . $message, $gateway->get_id() );
|
811 |
-
}
|
812 |
-
}
|
813 |
-
|
814 |
-
|
815 |
/**
|
816 |
* Determines if Apple Pay is available.
|
817 |
*
|
@@ -825,14 +777,7 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
825 |
*/
|
826 |
public function is_available() {
|
827 |
|
828 |
-
$is_available = wc_site_is_https() &&
|
829 |
-
|
830 |
-
$accepted_currencies = $this->get_accepted_currencies();
|
831 |
-
|
832 |
-
if ( ! empty( $accepted_currencies ) ) {
|
833 |
-
|
834 |
-
$is_available = $is_available && in_array( get_woocommerce_currency(), $accepted_currencies, true );
|
835 |
-
}
|
836 |
|
837 |
/**
|
838 |
* Filters whether Apple Pay should be made available to users.
|
@@ -840,7 +785,7 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
840 |
* @since 4.7.0
|
841 |
* @param bool $is_available
|
842 |
*/
|
843 |
-
return apply_filters(
|
844 |
}
|
845 |
|
846 |
|
@@ -853,11 +798,7 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
853 |
*/
|
854 |
public function is_configured() {
|
855 |
|
856 |
-
|
857 |
-
return false;
|
858 |
-
}
|
859 |
-
|
860 |
-
$is_configured = $this->is_enabled() && $this->get_processing_gateway()->is_enabled();
|
861 |
|
862 |
if ( $this->requires_merchant_id() ) {
|
863 |
$is_configured = $is_configured && (bool) $this->get_merchant_id();
|
@@ -884,32 +825,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
884 |
}
|
885 |
|
886 |
|
887 |
-
/**
|
888 |
-
* Determines if Apple Pay is enabled.
|
889 |
-
*
|
890 |
-
* @since 4.7.0
|
891 |
-
*
|
892 |
-
* @return bool
|
893 |
-
*/
|
894 |
-
public function is_enabled() {
|
895 |
-
|
896 |
-
return 'yes' === get_option( 'sv_wc_apple_pay_enabled' );
|
897 |
-
}
|
898 |
-
|
899 |
-
|
900 |
-
/**
|
901 |
-
* Determines if test mode is enabled.
|
902 |
-
*
|
903 |
-
* @since 4.7.0
|
904 |
-
*
|
905 |
-
* @return bool
|
906 |
-
*/
|
907 |
-
public function is_test_mode() {
|
908 |
-
|
909 |
-
return 'yes' === get_option( 'sv_wc_apple_pay_test_mode' );
|
910 |
-
}
|
911 |
-
|
912 |
-
|
913 |
/**
|
914 |
* Determines if a merchant ID is required for configuration.
|
915 |
*
|
@@ -1025,7 +940,7 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
1025 |
|
1026 |
$accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : array();
|
1027 |
|
1028 |
-
$accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
1029 |
|
1030 |
$valid_networks = array(
|
1031 |
SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'amex',
|
@@ -1049,72 +964,6 @@ class SV_WC_Payment_Gateway_Apple_Pay {
|
|
1049 |
}
|
1050 |
|
1051 |
|
1052 |
-
/**
|
1053 |
-
* Gets the gateways that declare Apple Pay support.
|
1054 |
-
*
|
1055 |
-
* @since 4.7.0
|
1056 |
-
*
|
1057 |
-
* @return array the supporting gateways as `$gateway_id => \SV_WC_Payment_Gateway`
|
1058 |
-
*/
|
1059 |
-
public function get_supporting_gateways() {
|
1060 |
-
|
1061 |
-
$available_gateways = $this->get_plugin()->get_gateways();
|
1062 |
-
$supporting_gateways = array();
|
1063 |
-
|
1064 |
-
foreach ( $available_gateways as $key => $gateway ) {
|
1065 |
-
|
1066 |
-
if ( $gateway->supports_apple_pay() ) {
|
1067 |
-
$supporting_gateways[ $gateway->get_id() ] = $gateway;
|
1068 |
-
}
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
return $supporting_gateways;
|
1072 |
-
}
|
1073 |
-
|
1074 |
-
|
1075 |
-
/**
|
1076 |
-
* Gets the gateway set to process Apple Pay transactions.
|
1077 |
-
*
|
1078 |
-
* @since 4.7.0
|
1079 |
-
*
|
1080 |
-
* @return SV_WC_Payment_Gateway|null
|
1081 |
-
*/
|
1082 |
-
public function get_processing_gateway() {
|
1083 |
-
|
1084 |
-
$gateways = $this->get_supporting_gateways();
|
1085 |
-
|
1086 |
-
$gateway_id = get_option( 'sv_wc_apple_pay_payment_gateway' );
|
1087 |
-
|
1088 |
-
return isset( $gateways[ $gateway_id ] ) ? $gateways[ $gateway_id ] : null;
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
|
1092 |
-
/**
|
1093 |
-
* Gets the Apple Pay button style.
|
1094 |
-
*
|
1095 |
-
* @since 4.7.0
|
1096 |
-
*
|
1097 |
-
* @return string
|
1098 |
-
*/
|
1099 |
-
public function get_button_style() {
|
1100 |
-
|
1101 |
-
return get_option( 'sv_wc_apple_pay_button_style', 'black' );
|
1102 |
-
}
|
1103 |
-
|
1104 |
-
|
1105 |
-
/**
|
1106 |
-
* Gets the gateway plugin instance.
|
1107 |
-
*
|
1108 |
-
* @since 4.7.0
|
1109 |
-
*
|
1110 |
-
* @return SV_WC_Payment_Gateway_Plugin
|
1111 |
-
*/
|
1112 |
-
public function get_plugin() {
|
1113 |
-
|
1114 |
-
return $this->plugin;
|
1115 |
-
}
|
1116 |
-
|
1117 |
-
|
1118 |
}
|
1119 |
|
1120 |
|
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/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_5;
|
26 |
+
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Orders;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Apple_Pay' ) ) :
|
32 |
|
33 |
|
34 |
/**
|
36 |
*
|
37 |
* @since 4.7.0
|
38 |
*/
|
39 |
+
class SV_WC_Payment_Gateway_Apple_Pay extends Payment_Gateway\External_Checkout\External_Checkout {
|
40 |
|
41 |
|
42 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_Admin the admin instance */
|
48 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_AJAX the AJAX instance */
|
49 |
protected $ajax;
|
50 |
|
|
|
|
|
|
|
51 |
/** @var SV_WC_Payment_Gateway_Apple_Pay_API the Apple Pay API */
|
52 |
protected $api;
|
53 |
|
61 |
*/
|
62 |
public function __construct( SV_WC_Payment_Gateway_Plugin $plugin ) {
|
63 |
|
64 |
+
$this->id = 'apple_pay';
|
65 |
+
$this->label = __( 'Apple Pay', 'woocommerce-plugin-framework' );
|
66 |
|
67 |
+
parent::__construct( $plugin );
|
68 |
|
69 |
if ( $this->is_available() ) {
|
70 |
add_filter( 'woocommerce_customer_taxable_address', array( $this, 'set_customer_taxable_address' ) );
|
72 |
}
|
73 |
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* Initializes the admin handler.
|
77 |
*
|
105 |
}
|
106 |
|
107 |
|
108 |
+
/**
|
109 |
+
* Checks if the external checkout provides the customer billing address to WC before payment confirmation.
|
110 |
+
*
|
111 |
+
* @since 5.10.0
|
112 |
+
*
|
113 |
+
* @return bool
|
114 |
+
*/
|
115 |
+
public function is_billing_address_available_before_payment() {
|
116 |
+
|
117 |
+
// Apple Pay does not provide billing information until the payment is confirmed
|
118 |
+
return false;
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
/**
|
123 |
* Processes the payment after an Apple Pay authorization.
|
124 |
*
|
143 |
|
144 |
$this->log( "Payment Response:\n" . $payment_response->to_string_safe() . "\n" );
|
145 |
|
146 |
+
$order = Orders::create_order( WC()->cart, [ 'created_via' => 'apple_pay' ] );
|
147 |
|
148 |
$order->set_payment_method( $this->get_processing_gateway() );
|
149 |
|
219 |
}
|
220 |
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
/**
|
223 |
* Gets a single product payment request.
|
224 |
*
|
753 |
|
754 |
if ( ! $this->api instanceof SV_WC_Payment_Gateway_Apple_Pay_API ) {
|
755 |
|
756 |
+
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php');
|
757 |
+
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php');
|
758 |
+
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php');
|
759 |
|
760 |
$this->api = new SV_WC_Payment_Gateway_Apple_Pay_API( $this->get_processing_gateway() );
|
761 |
}
|
764 |
}
|
765 |
|
766 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
/**
|
768 |
* Determines if Apple Pay is available.
|
769 |
*
|
777 |
*/
|
778 |
public function is_available() {
|
779 |
|
780 |
+
$is_available = wc_site_is_https() && parent::is_available();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
781 |
|
782 |
/**
|
783 |
* Filters whether Apple Pay should be made available to users.
|
785 |
* @since 4.7.0
|
786 |
* @param bool $is_available
|
787 |
*/
|
788 |
+
return apply_filters( "sv_wc_apple_pay_is_available", $is_available );
|
789 |
}
|
790 |
|
791 |
|
798 |
*/
|
799 |
public function is_configured() {
|
800 |
|
801 |
+
$is_configured = parent::is_configured();
|
|
|
|
|
|
|
|
|
802 |
|
803 |
if ( $this->requires_merchant_id() ) {
|
804 |
$is_configured = $is_configured && (bool) $this->get_merchant_id();
|
825 |
}
|
826 |
|
827 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
/**
|
829 |
* Determines if a merchant ID is required for configuration.
|
830 |
*
|
940 |
|
941 |
$accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : array();
|
942 |
|
943 |
+
$accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types );
|
944 |
|
945 |
$valid_networks = array(
|
946 |
SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'amex',
|
964 |
}
|
965 |
|
966 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
967 |
}
|
968 |
|
969 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as FrameworkBase;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as FrameworkBase;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/Handlers/Capture.php
CHANGED
@@ -22,13 +22,13 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
32 |
|
33 |
|
34 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Handlers;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
28 |
|
29 |
defined( 'ABSPATH' ) or exit;
|
30 |
|
31 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Handlers\\Capture' ) ) :
|
32 |
|
33 |
|
34 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php
CHANGED
@@ -21,13 +21,13 @@
|
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
25 |
|
26 |
defined( 'ABSPATH' ) or exit;
|
27 |
|
28 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
29 |
|
30 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
31 |
|
32 |
|
33 |
/**
|
21 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
22 |
*/
|
23 |
|
24 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\Admin;
|
25 |
|
26 |
defined( 'ABSPATH' ) or exit;
|
27 |
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5 as Framework;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\Admin\\Setup_Wizard' ) ) :
|
31 |
|
32 |
|
33 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -111,7 +111,7 @@ class SV_WC_Payment_Gateway_Admin_Order {
|
|
111 |
*/
|
112 |
protected function enqueue_edit_order_assets( \WC_Order $order ) {
|
113 |
|
114 |
-
wp_enqueue_script( 'sv-wc-payment-gateway-admin-order', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/
|
115 |
|
116 |
wp_localize_script( 'sv-wc-payment-gateway-admin-order', 'sv_wc_payment_gateway_admin_order', array(
|
117 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
@@ -161,13 +161,13 @@ class SV_WC_Payment_Gateway_Admin_Order {
|
|
161 |
|
162 |
?>
|
163 |
<script type="text/javascript">
|
164 |
-
jQuery(
|
165 |
-
if ( 0
|
166 |
$( 'select[name^=action]' ).append(
|
167 |
$( '<option>' ).val( '<?php echo esc_js( 'wc_capture_charge' ); ?>' ).text( '<?php _e( 'Capture Charge', 'woocommerce-plugin-framework' ); ?>' )
|
168 |
);
|
169 |
}
|
170 |
-
});
|
171 |
</script>
|
172 |
<?php
|
173 |
}
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_Order' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
111 |
*/
|
112 |
protected function enqueue_edit_order_assets( \WC_Order $order ) {
|
113 |
|
114 |
+
wp_enqueue_script( 'sv-wc-payment-gateway-admin-order', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/admin/sv-wc-payment-gateway-admin-order.js', array( 'jquery' ), SV_WC_Plugin::VERSION, true );
|
115 |
|
116 |
wp_localize_script( 'sv-wc-payment-gateway-admin-order', 'sv_wc_payment_gateway_admin_order', array(
|
117 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
161 |
|
162 |
?>
|
163 |
<script type="text/javascript">
|
164 |
+
jQuery( function ( $ ) {
|
165 |
+
if ( 0 === $( 'select[name^=action] option[value=wc_capture_charge]' ).length ) {
|
166 |
$( 'select[name^=action]' ).append(
|
167 |
$( '<option>' ).val( '<?php echo esc_js( 'wc_capture_charge' ); ?>' ).text( '<?php _e( 'Capture Charge', 'woocommerce-plugin-framework' ); ?>' )
|
168 |
);
|
169 |
}
|
170 |
+
} );
|
171 |
</script>
|
172 |
<?php
|
173 |
}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -82,7 +82,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
82 |
wp_enqueue_style( 'sv-wc-payment-gateway-token-editor', $this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/admin/sv-wc-payment-gateway-token-editor.min.css', array(), SV_WC_Plugin::VERSION );
|
83 |
|
84 |
// Main editor script
|
85 |
-
wp_enqueue_script( 'sv-wc-payment-gateway-token-editor', $this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/
|
86 |
|
87 |
wp_localize_script( 'sv-wc-payment-gateway-token-editor', 'wc_payment_gateway_token_editor', array(
|
88 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
@@ -159,15 +159,17 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
159 |
*/
|
160 |
public function save( $user_id ) {
|
161 |
|
162 |
-
$tokens = ( isset( $_POST[ $this->get_input_name() ] ) ) ? $_POST[ $this->get_input_name() ] :
|
163 |
|
164 |
-
$
|
|
|
165 |
|
166 |
foreach ( $tokens as $data ) {
|
167 |
|
168 |
-
$token_id
|
|
|
169 |
|
170 |
-
unset( $data['id'] );
|
171 |
|
172 |
if ( ! $token_id ) {
|
173 |
continue;
|
@@ -178,10 +180,18 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
178 |
}
|
179 |
|
180 |
// Set the default method
|
181 |
-
$data['default'] = $token_id ===
|
182 |
|
183 |
if ( $data = $this->validate_token_data( $token_id, $data ) ) {
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
}
|
187 |
|
@@ -300,7 +310,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
300 |
|
301 |
|
302 |
/**
|
303 |
-
*
|
304 |
*
|
305 |
* This method allows concrete gateways to add special token data.
|
306 |
* See Authorize.net CIM for an example.
|
@@ -318,6 +328,33 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
318 |
}
|
319 |
|
320 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
/**
|
322 |
* Update the user's token data.
|
323 |
*
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_Payment_Token_Editor' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
82 |
wp_enqueue_style( 'sv-wc-payment-gateway-token-editor', $this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/admin/sv-wc-payment-gateway-token-editor.min.css', array(), SV_WC_Plugin::VERSION );
|
83 |
|
84 |
// Main editor script
|
85 |
+
wp_enqueue_script( 'sv-wc-payment-gateway-token-editor', $this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/admin/sv-wc-payment-gateway-token-editor.js', array( 'jquery' ), SV_WC_Plugin::VERSION, true );
|
86 |
|
87 |
wp_localize_script( 'sv-wc-payment-gateway-token-editor', 'wc_payment_gateway_token_editor', array(
|
88 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
159 |
*/
|
160 |
public function save( $user_id ) {
|
161 |
|
162 |
+
$tokens = ( isset( $_POST[ $this->get_input_name() ] ) ) ? $_POST[ $this->get_input_name() ] : [];
|
163 |
|
164 |
+
$default_token_id = SV_WC_Helper::get_posted_value( $this->get_input_name() . '_default' );
|
165 |
+
$built_tokens = [];
|
166 |
|
167 |
foreach ( $tokens as $data ) {
|
168 |
|
169 |
+
$token_id = isset( $data['id'] ) ? $data['id'] : '';
|
170 |
+
$original_token_id = isset( $data['original_id'] ) ? $data['original_id'] : '';
|
171 |
|
172 |
+
unset( $data['id'], $data['original_id'] );
|
173 |
|
174 |
if ( ! $token_id ) {
|
175 |
continue;
|
180 |
}
|
181 |
|
182 |
// Set the default method
|
183 |
+
$data['default'] = $token_id === $default_token_id || $original_token_id === $default_token_id;
|
184 |
|
185 |
if ( $data = $this->validate_token_data( $token_id, $data ) ) {
|
186 |
+
|
187 |
+
$token = $original_token_id ? $this->get_gateway()->get_payment_tokens_handler()->get_token( $user_id, $original_token_id ) : null;
|
188 |
+
|
189 |
+
// update the token props if a token with the original ID already exists to avoid creating another core token in SV_WC_Payment_Gateway_Payment_Token::save()
|
190 |
+
if ( $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
191 |
+
$built_tokens[ $token_id ] = $this->set_token_props( $token, $token_id, $data );
|
192 |
+
} else {
|
193 |
+
$built_tokens[ $token_id ] = $this->build_token( $user_id, $token_id, $data );
|
194 |
+
}
|
195 |
}
|
196 |
}
|
197 |
|
310 |
|
311 |
|
312 |
/**
|
313 |
+
* Builds a token object from data saved in the admin.
|
314 |
*
|
315 |
* This method allows concrete gateways to add special token data.
|
316 |
* See Authorize.net CIM for an example.
|
328 |
}
|
329 |
|
330 |
|
331 |
+
/**
|
332 |
+
* Updates a token object with data saved in the admin.
|
333 |
+
*
|
334 |
+
* @since 5.8.0
|
335 |
+
*
|
336 |
+
* @param SV_WC_Payment_Gateway_Payment_Token the payment token object to update
|
337 |
+
* @param string $token_id the token ID
|
338 |
+
* @param array $data the token data
|
339 |
+
* @return SV_WC_Payment_Gateway_Payment_Token
|
340 |
+
*/
|
341 |
+
protected function set_token_props( $token, $token_id, $data ) {
|
342 |
+
|
343 |
+
unset( $data['type'] );
|
344 |
+
|
345 |
+
foreach ( $data as $key => $value ) {
|
346 |
+
|
347 |
+
if ( is_callable( [ $token, "set_{$key}" ] ) ) {
|
348 |
+
$token->{"set_{$key}"}( $value );
|
349 |
+
}
|
350 |
+
}
|
351 |
+
|
352 |
+
$token->set_id( $token_id );
|
353 |
+
|
354 |
+
return $token;
|
355 |
+
}
|
356 |
+
|
357 |
+
|
358 |
/**
|
359 |
* Update the user's token data.
|
360 |
*
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-order-partial-capture.php
CHANGED
@@ -68,3 +68,8 @@
|
|
68 |
<div class="clear"></div>
|
69 |
</div>
|
70 |
</div>
|
|
|
|
|
|
|
|
|
|
68 |
<div class="clear"></div>
|
69 |
</div>
|
70 |
</div>
|
71 |
+
<script type="text/javascript">
|
72 |
+
if ( window.sv_wc_payment_gateway_admin_order_add_capture_events ) {
|
73 |
+
window.sv_wc_payment_gateway_admin_order_add_capture_events();
|
74 |
+
}
|
75 |
+
</script>
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php
CHANGED
@@ -21,6 +21,15 @@
|
|
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 |
|
26 |
<?php $token_input_name = $input_name . '[' . $index . ']'; ?>
|
@@ -29,7 +38,7 @@
|
|
29 |
|
30 |
<?php foreach ( $fields as $field_id => $field ) : ?>
|
31 |
|
32 |
-
<?php $is_select = '
|
33 |
|
34 |
<td class="token-<?php echo esc_attr( $field_id ); ?>">
|
35 |
|
@@ -76,6 +85,7 @@
|
|
76 |
|
77 |
<?php endforeach; ?>
|
78 |
|
|
|
79 |
<input name="<?php echo esc_attr( $token_input_name ); ?>[type]" value="<?php echo esc_attr( $type ); ?>" type="hidden" />
|
80 |
|
81 |
<td class="token-default token-attribute">
|
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 |
+
/**
|
26 |
+
* @type string $index token index while adding tokens in AJAX requests
|
27 |
+
* @type string $input_name HTML name for the token fields
|
28 |
+
* @type array $fields token editor fields
|
29 |
+
* @type array $token default payment token
|
30 |
+
* @type string $type payment type
|
31 |
+
* @type array $actions payment token actions
|
32 |
+
*/
|
33 |
?>
|
34 |
|
35 |
<?php $token_input_name = $input_name . '[' . $index . ']'; ?>
|
38 |
|
39 |
<?php foreach ( $fields as $field_id => $field ) : ?>
|
40 |
|
41 |
+
<?php $is_select = isset( $field['type'], $field['options'] ) && 'select' === $field['type'] && ! empty( $field['options'] ); ?>
|
42 |
|
43 |
<td class="token-<?php echo esc_attr( $field_id ); ?>">
|
44 |
|
85 |
|
86 |
<?php endforeach; ?>
|
87 |
|
88 |
+
<input name="<?php echo esc_attr( $token_input_name ); ?>[original_id]" value="<?php echo esc_attr( $token['id'] ); ?>" type="hidden" />
|
89 |
<input name="<?php echo esc_attr( $token_input_name ); ?>[type]" value="<?php echo esc_attr( $type ); ?>" type="hidden" />
|
90 |
|
91 |
<td class="token-default token-attribute">
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Response_Message_Helper' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Authorization_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Create_Payment_Token_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Customer_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_API_Get_Tokenized_Payment_Methods_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_Credit_Card_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_eCheck_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Payment_Notification_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Notification_Tokenization_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Request' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API_Response' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_API' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php
DELETED
@@ -1,416 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce Payment Gateway 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/Payment-Gateway/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_7_1;
|
26 |
-
|
27 |
-
defined( 'ABSPATH' ) or exit;
|
28 |
-
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_7_1\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) :
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Sets up the Apple Pay settings screen.
|
34 |
-
*
|
35 |
-
* @since 4.7.0
|
36 |
-
*/
|
37 |
-
class SV_WC_Payment_Gateway_Apple_Pay_Admin {
|
38 |
-
|
39 |
-
|
40 |
-
/** @var SV_WC_Payment_Gateway_Apple_Pay the Apple Pay handler instance */
|
41 |
-
protected $handler;
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Construct the class.
|
46 |
-
*
|
47 |
-
* @since 4.7.0
|
48 |
-
*
|
49 |
-
* @param SV_WC_Payment_Gateway_Apple_Pay $handler main Apple Pay handler instance
|
50 |
-
*/
|
51 |
-
public function __construct( $handler ) {
|
52 |
-
|
53 |
-
$this->handler = $handler;
|
54 |
-
|
55 |
-
// add Apple Pay to the checkout settings sections
|
56 |
-
add_filter( 'woocommerce_get_sections_checkout', array( $this, 'add_settings_section' ), 99 );
|
57 |
-
|
58 |
-
// output the settings
|
59 |
-
add_action( 'woocommerce_settings_checkout', array( $this, 'add_settings' ) );
|
60 |
-
|
61 |
-
// render the special "static" gateway select
|
62 |
-
add_action( 'woocommerce_admin_field_static', array( $this, 'render_static_setting' ) );
|
63 |
-
|
64 |
-
// save the settings
|
65 |
-
add_action( 'woocommerce_settings_save_checkout', array( $this, 'save_settings' ) );
|
66 |
-
|
67 |
-
// add admin notices for configuration options that need attention
|
68 |
-
add_action( 'admin_footer', array( $this, 'add_admin_notices' ), 10 );
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Adds Apple Pay to the checkout settings sections.
|
74 |
-
*
|
75 |
-
* @internal
|
76 |
-
*
|
77 |
-
* @since 4.7.0
|
78 |
-
*
|
79 |
-
* @param array $sections the existing sections
|
80 |
-
* @return array
|
81 |
-
*/
|
82 |
-
public function add_settings_section( $sections ) {
|
83 |
-
|
84 |
-
$sections['apple-pay'] = __( 'Apple Pay', 'woocommerce-plugin-framework' );
|
85 |
-
|
86 |
-
return $sections;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Gets all of the combined settings.
|
92 |
-
*
|
93 |
-
* @since 4.7.0
|
94 |
-
*
|
95 |
-
* @return array $settings The combined settings.
|
96 |
-
*/
|
97 |
-
public function get_settings() {
|
98 |
-
|
99 |
-
$settings = array(
|
100 |
-
|
101 |
-
array(
|
102 |
-
'title' => __( 'Apple Pay', 'woocommerce-plugin-framework' ),
|
103 |
-
'type' => 'title',
|
104 |
-
),
|
105 |
-
|
106 |
-
array(
|
107 |
-
'id' => 'sv_wc_apple_pay_enabled',
|
108 |
-
'title' => __( 'Enable / Disable', 'woocommerce-plugin-framework' ),
|
109 |
-
'desc' => __( 'Accept Apple Pay', 'woocommerce-plugin-framework' ),
|
110 |
-
'type' => 'checkbox',
|
111 |
-
'default' => 'no',
|
112 |
-
),
|
113 |
-
|
114 |
-
array(
|
115 |
-
'id' => 'sv_wc_apple_pay_display_locations',
|
116 |
-
'title' => __( 'Allow Apple Pay on', 'woocommerce-plugin-framework' ),
|
117 |
-
'type' => 'multiselect',
|
118 |
-
'class' => 'wc-enhanced-select',
|
119 |
-
'css' => 'width: 350px;',
|
120 |
-
'options' => $this->get_display_location_options(),
|
121 |
-
'default' => array_keys( $this->get_display_location_options() ),
|
122 |
-
),
|
123 |
-
|
124 |
-
array(
|
125 |
-
'id' => 'sv_wc_apple_pay_button_style',
|
126 |
-
'title' => __( 'Button Style', 'woocommerce-plugin-framework' ),
|
127 |
-
'type' => 'select',
|
128 |
-
'options' => array(
|
129 |
-
'black' => __( 'Black', 'woocommerce-plugin-framework' ),
|
130 |
-
'white' => __( 'White', 'woocommerce-plugin-framework' ),
|
131 |
-
'white-with-line' => __( 'White with outline', 'woocommerce-plugin-framework' ),
|
132 |
-
),
|
133 |
-
'default' => 'black',
|
134 |
-
),
|
135 |
-
|
136 |
-
array(
|
137 |
-
'type' => 'sectionend',
|
138 |
-
),
|
139 |
-
);
|
140 |
-
|
141 |
-
$connection_settings = array(
|
142 |
-
array(
|
143 |
-
'title' => __( 'Connection Settings', 'woocommerce-plugin-framework' ),
|
144 |
-
'type' => 'title',
|
145 |
-
),
|
146 |
-
);
|
147 |
-
|
148 |
-
if ( $this->handler->requires_merchant_id() ) {
|
149 |
-
|
150 |
-
$connection_settings[] = [
|
151 |
-
'id' => 'sv_wc_apple_pay_merchant_id',
|
152 |
-
'title' => __( 'Apple Merchant ID', 'woocommerce-plugin-framework' ),
|
153 |
-
'type' => 'text',
|
154 |
-
'desc' => sprintf(
|
155 |
-
/** translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag */
|
156 |
-
__( 'This is found in your %1$sApple developer account%2$s', 'woocommerce-plugin-framework' ),
|
157 |
-
'<a href="https://developer.apple.com" target="_blank">', '</a>'
|
158 |
-
),
|
159 |
-
];
|
160 |
-
}
|
161 |
-
|
162 |
-
if ( $this->handler->requires_certificate() ) {
|
163 |
-
|
164 |
-
$connection_settings[] = [
|
165 |
-
'id' => 'sv_wc_apple_pay_cert_path',
|
166 |
-
'title' => __( 'Certificate Path', 'woocommerce-plugin-framework' ),
|
167 |
-
'type' => 'text',
|
168 |
-
'desc_tip' => 'The full system path to your certificate file from Apple. For security reasons you should store this outside of your web root.',
|
169 |
-
'desc' => sprintf(
|
170 |
-
/* translators: Placeholders: %s - the server's web root path */
|
171 |
-
__( 'For reference, your current web root path is: %s', 'woocommerce-plugin-framework' ),
|
172 |
-
'<code>' . ABSPATH . '</code>'
|
173 |
-
),
|
174 |
-
];
|
175 |
-
}
|
176 |
-
|
177 |
-
$gateway_setting_id = 'sv_wc_apple_pay_payment_gateway';
|
178 |
-
$gateway_options = $this->get_gateway_options();
|
179 |
-
|
180 |
-
if ( 1 === count( $gateway_options ) ) {
|
181 |
-
|
182 |
-
$connection_settings[] = array(
|
183 |
-
'id' => $gateway_setting_id,
|
184 |
-
'title' => __( 'Processing Gateway', 'woocommerce-plugin-framework' ),
|
185 |
-
'type' => 'static',
|
186 |
-
'value' => key( $gateway_options ),
|
187 |
-
'label' => current( $gateway_options ),
|
188 |
-
);
|
189 |
-
|
190 |
-
} else {
|
191 |
-
|
192 |
-
$connection_settings[] = array(
|
193 |
-
'id' => $gateway_setting_id,
|
194 |
-
'title' => __( 'Processing Gateway', 'woocommerce-plugin-framework' ),
|
195 |
-
'type' => 'select',
|
196 |
-
'options' => $this->get_gateway_options(),
|
197 |
-
);
|
198 |
-
}
|
199 |
-
|
200 |
-
$connection_settings[] = array(
|
201 |
-
'id' => 'sv_wc_apple_pay_test_mode',
|
202 |
-
'title' => __( 'Test Mode', 'woocommerce-plugin-framework' ),
|
203 |
-
'desc' => __( 'Enable to test Apple Pay functionality throughout your sites without processing real payments.', 'woocommerce-plugin-framework' ),
|
204 |
-
'type' => 'checkbox',
|
205 |
-
'default' => 'no',
|
206 |
-
);
|
207 |
-
|
208 |
-
$connection_settings[] = array(
|
209 |
-
'type' => 'sectionend',
|
210 |
-
);
|
211 |
-
|
212 |
-
$settings = array_merge( $settings, $connection_settings );
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Filter the combined settings.
|
216 |
-
*
|
217 |
-
* @since 1.0.0
|
218 |
-
* @param array $settings The combined settings.
|
219 |
-
*/
|
220 |
-
return apply_filters( 'woocommerce_get_settings_apple_pay', $settings );
|
221 |
-
}
|
222 |
-
|
223 |
-
|
224 |
-
/**
|
225 |
-
* Outputs the settings fields.
|
226 |
-
*
|
227 |
-
* @internal
|
228 |
-
*
|
229 |
-
* @since 4.7.0
|
230 |
-
*/
|
231 |
-
public function add_settings() {
|
232 |
-
global $current_section;
|
233 |
-
|
234 |
-
if ( 'apple-pay' === $current_section ) {
|
235 |
-
\WC_Admin_Settings::output_fields( $this->get_settings() );
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Saves the settings.
|
242 |
-
*
|
243 |
-
* @internal
|
244 |
-
*
|
245 |
-
* @since 4.7.0
|
246 |
-
*
|
247 |
-
* @global string $current_section The current settings section.
|
248 |
-
*/
|
249 |
-
public function save_settings() {
|
250 |
-
global $current_section;
|
251 |
-
|
252 |
-
// Output the general settings
|
253 |
-
if ( 'apple-pay' == $current_section ) {
|
254 |
-
|
255 |
-
\WC_Admin_Settings::save_fields( $this->get_settings() );
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Renders a static setting.
|
262 |
-
*
|
263 |
-
* This "setting" just displays simple text instead of a <select> with only
|
264 |
-
* one option.
|
265 |
-
*
|
266 |
-
* @since 4.7.0
|
267 |
-
*
|
268 |
-
* @param array $setting
|
269 |
-
*/
|
270 |
-
public function render_static_setting( $setting ) {
|
271 |
-
|
272 |
-
?>
|
273 |
-
|
274 |
-
<tr valign="top">
|
275 |
-
<th scope="row" class="titledesc">
|
276 |
-
<label for="<?php echo esc_attr( $setting['id'] ); ?>"><?php echo esc_html( $setting['title'] ); ?></label>
|
277 |
-
</th>
|
278 |
-
<td class="forminp forminp-<?php echo sanitize_title( $setting['type'] ) ?>">
|
279 |
-
<?php echo esc_html( $setting['label'] ); ?>
|
280 |
-
<input
|
281 |
-
name="<?php echo esc_attr( $setting['id'] ); ?>"
|
282 |
-
id="<?php echo esc_attr( $setting['id'] ); ?>"
|
283 |
-
value="<?php echo esc_html( $setting['value'] ); ?>"
|
284 |
-
type="hidden"
|
285 |
-
>
|
286 |
-
</td>
|
287 |
-
</tr><?php
|
288 |
-
}
|
289 |
-
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Adds admin notices for configuration options that need attention.
|
293 |
-
*
|
294 |
-
* @since 4.7.0
|
295 |
-
*/
|
296 |
-
public function add_admin_notices() {
|
297 |
-
|
298 |
-
// if the feature is not enabled, bail
|
299 |
-
if ( ! $this->handler->is_enabled() ) {
|
300 |
-
return;
|
301 |
-
}
|
302 |
-
|
303 |
-
// if not on the settings screen, bail
|
304 |
-
if ( ! $this->is_settings_screen() ) {
|
305 |
-
return;
|
306 |
-
}
|
307 |
-
|
308 |
-
$errors = array();
|
309 |
-
|
310 |
-
// HTTPS notice
|
311 |
-
if ( ! wc_site_is_https() ) {
|
312 |
-
$errors[] = __( 'Your site must be served over HTTPS with a valid SSL certificate.', 'woocommerce-plugin-framework' );
|
313 |
-
}
|
314 |
-
|
315 |
-
// Currency notice
|
316 |
-
$accepted_currencies = $this->handler->get_accepted_currencies();
|
317 |
-
|
318 |
-
if ( ! empty( $accepted_currencies ) && ! in_array( get_woocommerce_currency(), $accepted_currencies, true ) ) {
|
319 |
-
|
320 |
-
$errors[] = sprintf(
|
321 |
-
/* translators: Placeholders: %1$s - plugin name, %2$s - a currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag */
|
322 |
-
_n(
|
323 |
-
'Accepts payment in %1$s only. %2$sConfigure%3$s WooCommerce to accept %1$s to enable Apple Pay.',
|
324 |
-
'Accepts payment in one of %1$s only. %2$sConfigure%3$s WooCommerce to accept one of %1$s to enable Apple Pay.',
|
325 |
-
count( $accepted_currencies ),
|
326 |
-
'woocommerce-plugin-framework'
|
327 |
-
),
|
328 |
-
'<strong>' . implode( ', ', $accepted_currencies ) . '</strong>',
|
329 |
-
'<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=general' ) ) . '">',
|
330 |
-
'</a>'
|
331 |
-
);
|
332 |
-
}
|
333 |
-
|
334 |
-
// bad cert config notice
|
335 |
-
// this first checks if the option has been set so the notice is not
|
336 |
-
// displayed without the user having the chance to set it.
|
337 |
-
if ( false !== $this->handler->get_cert_path() && ! $this->handler->is_cert_configured() ) {
|
338 |
-
|
339 |
-
$errors[] = sprintf(
|
340 |
-
/** translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag */
|
341 |
-
__( 'Your %1$sMerchant Identity Certificate%2$s cannot be found. Please check your path configuration.', 'woocommerce-plugin-framework' ),
|
342 |
-
'<strong>', '</strong>'
|
343 |
-
);
|
344 |
-
}
|
345 |
-
|
346 |
-
if ( ! empty( $errors ) ) {
|
347 |
-
|
348 |
-
$message = '<strong>' . __( 'Apple Pay is disabled.', 'woocommerce-plugin-framework' ) . '</strong>';
|
349 |
-
|
350 |
-
if ( 1 === count( $errors ) ) {
|
351 |
-
$message .= ' ' . current( $errors );
|
352 |
-
} else {
|
353 |
-
$message .= '<ul><li>' . implode( '</li><li>', $errors ) . '</li></ul>';
|
354 |
-
}
|
355 |
-
|
356 |
-
$this->handler->get_plugin()->get_admin_notice_handler()->add_admin_notice( $message, 'apple-pay-https-required', array(
|
357 |
-
'notice_class' => 'error',
|
358 |
-
'dismissible' => false,
|
359 |
-
) );
|
360 |
-
}
|
361 |
-
}
|
362 |
-
|
363 |
-
|
364 |
-
/**
|
365 |
-
* Determines if the user is currently on the settings screen.
|
366 |
-
*
|
367 |
-
* @since 4.7.0
|
368 |
-
*
|
369 |
-
* @return bool
|
370 |
-
*/
|
371 |
-
protected function is_settings_screen() {
|
372 |
-
|
373 |
-
return 'wc-settings' === SV_WC_Helper::get_requested_value( 'page' ) && 'apple-pay' === SV_WC_Helper::get_requested_value( 'section' );
|
374 |
-
}
|
375 |
-
|
376 |
-
|
377 |
-
/**
|
378 |
-
* Gets the available display location options.
|
379 |
-
*
|
380 |
-
* @since 4.7.0
|
381 |
-
*
|
382 |
-
* @return array
|
383 |
-
*/
|
384 |
-
protected function get_display_location_options() {
|
385 |
-
|
386 |
-
return array(
|
387 |
-
'product' => __( 'Single products', 'woocommerce-plugin-framework' ),
|
388 |
-
'cart' => __( 'Cart', 'woocommerce-plugin-framework' ),
|
389 |
-
'checkout' => __( 'Checkout', 'woocommerce-plugin-framework' ),
|
390 |
-
);
|
391 |
-
}
|
392 |
-
|
393 |
-
|
394 |
-
/**
|
395 |
-
* Gets the available gateway options.
|
396 |
-
*
|
397 |
-
* @since 4.7.0
|
398 |
-
*
|
399 |
-
* @return array
|
400 |
-
*/
|
401 |
-
protected function get_gateway_options() {
|
402 |
-
|
403 |
-
$gateways = $this->handler->get_supporting_gateways();
|
404 |
-
|
405 |
-
foreach ( $gateways as $id => $gateway ) {
|
406 |
-
$gateways[ $id ] = $gateway->get_method_title();
|
407 |
-
}
|
408 |
-
|
409 |
-
return $gateways;
|
410 |
-
}
|
411 |
-
|
412 |
-
|
413 |
-
}
|
414 |
-
|
415 |
-
|
416 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-apple-pay.css
CHANGED
@@ -5,10 +5,6 @@
|
|
5 |
margin: 0 0 1em 0;
|
6 |
}
|
7 |
|
8 |
-
.sv-wc-apple-pay-terms {
|
9 |
-
display: none;
|
10 |
-
}
|
11 |
-
|
12 |
@supports ( -webkit-appearance: -apple-pay-button ) {
|
13 |
|
14 |
.sv-wc-apple-pay-button {
|
@@ -104,22 +100,3 @@
|
|
104 |
background-color: white;
|
105 |
}
|
106 |
}
|
107 |
-
|
108 |
-
.sv-wc-apply-pay-checkout {
|
109 |
-
display: none;
|
110 |
-
max-width: 510px;
|
111 |
-
margin: 0 auto 2em;
|
112 |
-
text-align: center;
|
113 |
-
}
|
114 |
-
.sv-wc-apply-pay-checkout .sv-wc-apple-pay-button {
|
115 |
-
display: block;
|
116 |
-
}
|
117 |
-
.sv-wc-apply-pay-checkout .divider {
|
118 |
-
font-size: 1.15em;
|
119 |
-
font-style: italic;
|
120 |
-
text-transform: uppercase;
|
121 |
-
}
|
122 |
-
.sv-wc-apply-pay-checkout .divider::before,
|
123 |
-
.sv-wc-apply-pay-checkout .divider::after {
|
124 |
-
content: "\2014";
|
125 |
-
}
|
5 |
margin: 0 0 1em 0;
|
6 |
}
|
7 |
|
|
|
|
|
|
|
|
|
8 |
@supports ( -webkit-appearance: -apple-pay-button ) {
|
9 |
|
10 |
.sv-wc-apple-pay-button {
|
100 |
background-color: white;
|
101 |
}
|
102 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-external-checkout.css
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.sv-wc-external-checkout {
|
2 |
+
max-width: 510px;
|
3 |
+
margin: 0 auto 2em;
|
4 |
+
text-align: center;
|
5 |
+
}
|
6 |
+
|
7 |
+
.sv-wc-external-checkout .terms-notice {
|
8 |
+
margin-top: 1em;
|
9 |
+
}
|
10 |
+
|
11 |
+
.sv-wc-external-checkout .divider {
|
12 |
+
font-size: 1.15em;
|
13 |
+
font-style: italic;
|
14 |
+
text-transform: uppercase;
|
15 |
+
}
|
16 |
+
.sv-wc-external-checkout .divider::before,
|
17 |
+
.sv-wc-external-checkout .divider::after {
|
18 |
+
content: "\2014";
|
19 |
+
}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/css/frontend/sv-wc-payment-gateway-my-payment-methods.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
table.
|
1 |
+
table.woocommerce-MyAccount-paymentMethods{font-size:0.85em}table.woocommerce-MyAccount-paymentMethods th,table.woocommerce-MyAccount-paymentMethods td{vertical-align:middle}table.woocommerce-MyAccount-paymentMethods .woocommerce-PaymentMethod--title{display:none}table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--details span,table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--default span,table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--actions span{display:none}table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--expires,table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--default{text-align:center}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--method input{width:100%}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--details{white-space:nowrap}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--details img{width:40px;height:25px;margin-right:0.5em;vertical-align:middle;display:inline !important}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--expires{text-align:center}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--default{text-align:center}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--default mark{display:none;color:white;background-color:#3d9cd2;font-size:0.75em;text-transform:uppercase;padding:2px 4px;border-radius:2px}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--default mark:first-child{display:inline-block}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions{text-align:center}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions .button{margin:.125em}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions .button.save{display:none}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions .button.delete{display:inline-block}table.woocommerce-MyAccount-paymentMethods.editing .payment-method:not(.editing){opacity:0.5}table.woocommerce-MyAccount-paymentMethods.editing .payment-method:hover{opacity:1}table.woocommerce-MyAccount-paymentMethods.editing .payment-method.editing td.woocommerce-PaymentMethod--actions .button.save{display:inline-block}table.woocommerce-MyAccount-paymentMethods.editing .payment-method.editing td.woocommerce-PaymentMethod--actions .button.delete{display:none}table.woocommerce-MyAccount-paymentMethods .button{white-space:nowrap}table.woocommerce-MyAccount-paymentMethods tbody tr.error td{color:white;text-align:center;background-color:#e26838;border-radius:0 0 3px 3px;padding:5px}@media screen and (max-width: 768px){table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--expires,table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--default{text-align:right}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions{text-align:center}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions:before{display:none}table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--actions .button{float:none;margin:.125em}}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js
ADDED
@@ -0,0 +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}({"U07d":[function(require,module,exports) {
|
2 |
+
(function(){jQuery(function(a){"use strict";var t,e,r,n,c,o,i,u,m;return i=null!=(e=window.sv_wc_payment_gateway_admin_order)?e:{},u=null!=(r=window.woocommerce_admin)?r:{},m=null!=(n=window.woocommerce_admin_meta_boxes)?n:{},t=null!=(c=window.accounting)?c:{},window.sv_wc_payment_gateway_admin_order_add_capture_events=function(){if(!a(".sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events").length)return a(".sv-wc-payment-gateway-partial-capture").addClass("sv-wc-payment-gateway-partial-capture-with-events").appendTo("#woocommerce-order-items .inside"),a("#woocommerce-order-items").on("click",".sv-wc-payment-gateway-capture:not(.disabled)",function(t){return t.preventDefault(),a(this).hasClass("partial-capture")?(a("div.sv-wc-payment-gateway-partial-capture").slideDown(),a("div.wc-order-data-row-toggle").not("div.sv-wc-payment-gateway-partial-capture").slideUp(),a("div.wc-order-totals-items").slideUp()):o()}),a(".sv-wc-payment-gateway-partial-capture").on("change keyup","#capture_amount",function(e){var r;return(r=t.unformat(a(this).val(),u.mon_decimal_point))?a("button.capture-action").removeAttr("disabled"):a("button.capture-action").attr("disabled","disabled"),a("button .capture-amount .amount").text(t.formatMoney(r,{symbol:m.currency_format_symbol,decimal:m.currency_format_decimal_sep,thousand:m.currency_format_thousand_sep,precision:m.currency_format_num_decimals,format:m.currency_format}))}),a(".sv-wc-payment-gateway-partial-capture").on("click",".capture-action",function(t){var e,r;return t.preventDefault(),e=a(".sv-wc-payment-gateway-partial-capture #capture_amount").val(),r=a(".sv-wc-payment-gateway-partial-capture #capture_comment").val(),o(e,r)})},o=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(confirm(i.capture_ays))return a("#woocommerce-order-items").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),t={action:i.capture_action,nonce:i.capture_nonce,gateway_id:i.gateway_id,order_id:i.order_id,amount:e,comment:r},a.ajax({url:i.ajax_url,data:t}).done(function(a){if(null!=a.data&&null!=a.data.message&&alert(a.data.message),a.success)return location.reload()}).fail(function(){return alert(i.capture_error)}).always(function(){return a("#woocommerce-order-items").unblock()})},window.sv_wc_payment_gateway_admin_order_add_capture_events()})}).call(this);
|
3 |
+
},{}]},{},["U07d"], null)
|
4 |
+
//# sourceMappingURL=../admin/sv-wc-payment-gateway-admin-order.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map
ADDED
@@ -0,0 +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,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-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"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js
ADDED
@@ -0,0 +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}({"YLvv":[function(require,module,exports) {
|
2 |
+
(function(){jQuery(function(t){"use strict";var e,n,a;return a=null!=(n=window.wc_payment_gateway_token_editor)?n:{},t(".sv_wc_payment_gateway_token_editor").each(function(){return 0===t(this).find("tr.token").length?t(this).find("tr.no-tokens").show():t(this).find("tr.no-tokens").hide()}),t(".sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="remove"]',function(n){var o,r,i;if(n.preventDefault(),confirm(a.actions.remove_token.ays))return(r=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),r.find(".error").remove(),(i=t(this).closest("tr")).hasClass("new-token")?(r.unblock(),i.remove()):(o={action:"wc_payment_gateway_"+r.data("gateway-id")+"_admin_remove_payment_token",user_id:t(this).data("user-id"),token_id:t(this).data("token-id"),security:a.actions.remove_token.nonce},t.post(a.ajax_url,o).done(function(n){return n.success?(t(i).remove(),0===r.find("tr.token").length?r.find("tr.no-tokens").show():void 0):e(r,n.data)}).fail(function(t,n,a){return e(r,n+": "+a)}).always(function(){return r.unblock()}))}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="add-new"]',function(e){var n,o,r,i;return e.preventDefault(),(i=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),o=(n=i.find("tbody.tokens")).find("tr.token").length,r={action:"wc_payment_gateway_"+i.data("gateway-id")+"_admin_get_blank_payment_token",index:o+1,security:a.actions.add_token.nonce},t.post(a.ajax_url,r,function(t){return!0===t.success&&n.append(t.data),i.find("tr.no-tokens").hide(),i.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="refresh"]',function(n){var o,r,i;return n.preventDefault(),(i=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),i.find(".error").remove(),(o=i.find("tbody.tokens")).find("tr.token").length,r={action:"wc_payment_gateway_"+i.data("gateway-id")+"_admin_refresh_payment_tokens",user_id:t(this).data("user-id"),security:a.actions.refresh.nonce},t.post(a.ajax_url,r).done(function(t){return t.success?null!=t.data?(i.find("tr.no-tokens").hide(),o.html(t.data)):(o.empty(),i.find("tr.no-tokens").show()):e(i,t.data)}).fail(function(t,n,a){return e(i,n+": "+a)}).always(function(){return i.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.sv-wc-payment-gateway-token-editor-action-button[data-action="save"]',function(e){var n,o,r,i;return o=t(this).closest("table"),n=o.find("tfoot th"),o.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),n.find(".error, .success").remove(),i=o.find('tbody.tokens tr.token input[type="text"]'),r=!1,i.each(function(i){var s,c,d;if(t(this).removeClass("error"),d=t(this).val(),c=t(this).prop("required"),s=t(this).attr("pattern"),c||d)return!d.match(s)||c&&!d?(e.preventDefault(),t(this).addClass("error"),r||(n.prepend('<span class="error">'+a.actions.save.error+"</span>"),t(this).focus(),r=!0),o.unblock()):void 0})}),e=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(e),n||(n=a.i18n.general_error),t.find("th.actions").prepend('<span class="error">'+n+"</span>")}})}).call(this);
|
3 |
+
},{}]},{},["YLvv"], null)
|
4 |
+
//# sourceMappingURL=../admin/sv-wc-payment-gateway-token-editor.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["admin/sv-wc-payment-gateway-token-editor.coffee"],"names":[],"mappings":";CAOG,WACH,OAAO,SAAE,GACR,aAAD,IAAA,EAAA,EAAA,EA4KC,OA1KA,EAAA,OAAA,EAAA,OAAA,iCAAA,EAA2E,GAG3E,EAAG,uCAAwC,KAAK,WAI1C,OAAiB,IAFb,EAAG,MAAO,KAAM,YAEb,OACX,EAAG,MAAO,KAAM,gBAAiB,OAEjC,EAAG,MAAO,KAAM,gBAAiB,SAInC,EAAG,uCAAwC,GAAG,QAAS,gCAAiC,SAAE,GAE3F,IAAA,EAAA,EAAA,EAEE,GAFA,EAAE,iBAEY,QAAS,EAAgC,QAAQ,aAAa,KAWzE,OATH,EAAS,EAAG,MAAO,QAAS,UAErB,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,MAErE,EAAO,KAAM,UAAW,UAExB,EAAM,EAAG,MAAO,QAAS,OAGlB,SAAU,cAChB,EAAO,UACA,EAAI,WAEZ,EACC,CAAA,OAAU,sBAAwB,EAAO,KAAM,cAAiB,8BAChE,QAAU,EAAG,MAAO,KAAM,WAC1B,SAAU,EAAG,MAAO,KAAM,YAC1B,SAAU,EAAgC,QAAQ,aAAa,OAEhE,EAAE,KAAK,EAAgC,SAAU,GAE/C,KAAK,SAAE,GAEP,OAAmD,EAAS,SAE5D,EAAG,GAAM,SAGgC,IAApC,EAAO,KAAM,YAAa,OAC9B,EAAO,KAAM,gBAAiB,YAD1B,GALE,EAAa,EAAQ,EAAS,QAQrC,KAAK,SAAE,EAAO,EAAY,GAE1B,OAAA,EAAa,EAAQ,EAAa,KAAO,KAEzC,OAAO,WAEP,OAAA,EAAO,eAMV,EAAG,4CAA6C,GAAG,QAAS,iCAAkC,SAAE,GAEjG,IAAA,EAAA,EAAA,EAAA,EAcE,OAdA,EAAE,kBAEF,EAAS,EAAG,MAAO,QAAS,UAErB,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,MAGrE,GADA,EAAQ,EAAO,KAAM,iBACR,KAAM,YAAa,OAEhC,EACC,CAAA,OAAU,sBAAwB,EAAO,KAAM,cAAiB,iCAChE,MAAU,EAAQ,EAClB,SAAU,EAAgC,QAAQ,UAAU,OAE7D,EAAE,KAAK,EAAgC,SAAU,EAAM,SAAE,GAMxD,OAJuB,IAApB,EAAS,SAAqB,EAAK,OAAQ,EAAS,MAEvD,EAAO,KAAM,gBAAiB,OAE9B,EAAO,cAIT,EAAG,4CAA6C,GAAG,QAAS,iCAAkC,SAAE,GAEjG,IAAA,EAAA,EAAA,EAgBE,OAhBA,EAAE,kBAEF,EAAS,EAAG,MAAO,QAAS,UAErB,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,MAErE,EAAO,KAAM,UAAW,UAExB,EAAQ,EAAO,KAAM,iBACR,KAAM,YAAa,OAEhC,EACC,CAAA,OAAU,sBAAwB,EAAO,KAAM,cAAiB,gCAChE,QAAU,EAAG,MAAO,KAAM,WAC1B,SAAU,EAAgC,QAAQ,QAAQ,OAE3D,EAAE,KAAK,EAAgC,SAAU,GAE/C,KAAK,SAAE,GAEP,OAAmD,EAAS,QAEzD,MAAA,EAAA,MACF,EAAO,KAAM,gBAAiB,OAC9B,EAAK,KAAM,EAAS,QAEpB,EAAK,QACL,EAAO,KAAM,gBAAiB,QAPxB,EAAa,EAAQ,EAAS,QASrC,KAAK,SAAE,EAAO,EAAY,GAE1B,OAAA,EAAa,EAAQ,EAAa,KAAO,KAEzC,OAAO,WAEP,OAAA,EAAO,cAGV,EAAG,4CAA6C,GAAG,QAAS,wEAAyE,SAAE,GAExI,IAAA,EAAA,EAAA,EAAA,EAYE,OAZA,EAAc,EAAG,MAAO,QAAS,SACjC,EAAc,EAAO,KAAM,YAE3B,EAAO,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,MAErE,EAAY,KAAM,oBAAqB,SAIvC,EAAU,EAAO,KAAM,4CACvB,GAAU,EAEV,EAAO,KAAK,SAAE,GAEhB,IAAA,EAAA,EAAA,EAMG,GANA,EAAG,MAAO,YAAa,SAEvB,EAAW,EAAG,MAAO,MACrB,EAAW,EAAG,MAAO,KAAM,YAC3B,EAAW,EAAG,MAAO,KAAM,WAEb,GAAY,EAErB,OAAE,EAAM,MAAO,IAAe,IAAe,GAEjD,EAAE,iBAEF,EAAG,MAAO,SAAU,SAEb,IACN,EAAY,QAAS,uBAAyB,EAAgC,QAAQ,KAAK,MAAQ,WACnG,EAAG,MAAO,QACV,GAAU,GAEX,EAAO,gBAXH,MAiBP,EAAc,SAAE,EAAQ,GAAO,IAAA,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAMxC,OAJA,QAAQ,MAAM,GAEsD,IAApE,EAAU,EAAgC,KAAK,eAE/C,EAAO,KAAM,cAAe,QAAS,uBAAyB,EAAU,gBApLvE,KAAA","file":"sv-wc-payment-gateway-token-editor.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Token Editor CoffeeScript\n Version 4.3.0-beta\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###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\twc_payment_gateway_token_editor = window.wc_payment_gateway_token_editor ? {}\n\n\n\t$( '.sv_wc_payment_gateway_token_editor' ).each () ->\n\n\t\ttokens = $( this ).find( 'tr.token' )\n\n\t\tif ( tokens.length is 0 )\n\t\t\t$( this ).find( 'tr.no-tokens' ).show()\n\t\telse\n\t\t\t$( this ).find( 'tr.no-tokens' ).hide()\n\n\n\t# Remove a token\n\t$( '.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"remove\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\treturn unless confirm( wc_payment_gateway_token_editor.actions.remove_token.ays )\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\teditor.find( '.error' ).remove()\n\n\t\trow = $( this ).closest( 'tr' )\n\n\t\t# if this is an unsaved token, just remove the row\n\t\tif row.hasClass( 'new-token' )\n\t\t\teditor.unblock()\n\t\t\treturn row.remove()\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_remove_payment_token'\n\t\t\tuser_id: $( this ).data( 'user-id' )\n\t\t\ttoken_id: $( this ).data( 'token-id' )\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.remove_token.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data\n\n\t\t\t.done ( response ) =>\n\n\t\t\t\treturn handleError( editor, response.data ) unless response.success\n\n\t\t\t\t$( row ).remove()\n\n\t\t\t\t# no more tokens? Display a message\n\t\t\t\tif ( editor.find( 'tr.token' ).length is 0 )\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).show()\n\n\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\thandleError( editor, textStatus + ': ' + error )\n\n\t\t\t.always =>\n\n\t\t\t\teditor.unblock()\n\n\n\n\n\t# Add a new (blank) token\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"add-new\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\tbody = editor.find( 'tbody.tokens' )\n\t\tcount = body.find( 'tr.token' ).length\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_get_blank_payment_token'\n\t\t\tindex: count + 1\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.add_token.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data, ( response ) ->\n\n\t\t\tif response.success is true then body.append( response.data )\n\n\t\t\teditor.find( 'tr.no-tokens' ).hide()\n\n\t\t\teditor.unblock()\n\n\n\t# Refresh the tokens\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"refresh\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\teditor.find( '.error' ).remove()\n\n\t\tbody = editor.find( 'tbody.tokens' )\n\t\tcount = body.find( 'tr.token' ).length\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_refresh_payment_tokens'\n\t\t\tuser_id: $( this ).data( 'user-id' )\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.refresh.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data\n\n\t\t\t.done ( response ) =>\n\n\t\t\t\treturn handleError( editor, response.data ) unless response.success\n\n\t\t\t\tif response.data?\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).hide()\n\t\t\t\t\tbody.html( response.data )\n\t\t\t\telse\n\t\t\t\t\tbody.empty()\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).show()\n\n\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\thandleError( editor, textStatus + ': ' + error )\n\n\t\t\t.always =>\n\n\t\t\t\teditor.unblock()\n\n\t# Save the tokens\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.sv-wc-payment-gateway-token-editor-action-button[data-action=\"save\"]', ( e ) ->\n\n\t\teditor = $( this ).closest( 'table' )\n\t\tactions_row = editor.find( 'tfoot th' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\tactions_row.find( '.error, .success' ).remove();\n\n\t\t# Validate the input data\n\n\t\tinputs = editor.find( 'tbody.tokens tr.token input[type=\"text\"]' )\n\t\tfocused = false\n\n\t\tinputs.each ( index ) ->\n\n\t\t\t$( this ).removeClass( 'error' )\n\n\t\t\tvalue = $( this ).val()\n\t\t\trequired = $( this ).prop( 'required' )\n\t\t\tpattern = $( this ).attr( 'pattern' )\n\n\t\t\treturn unless required or value\n\n\t\t\tif ( ! value.match( pattern ) or ( required and ! value ) )\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\t$( this ).addClass( 'error' )\n\n\t\t\t\tif ( ! focused )\n\t\t\t\t\tactions_row.prepend( '<span class=\"error\">' + wc_payment_gateway_token_editor.actions.save.error + '</span>' )\n\t\t\t\t\t$( this ).focus()\n\t\t\t\t\tfocused = true\n\n\t\t\t\teditor.unblock()\n\n\n\t# Handles any AJAX errors.\n\t#\n\t# @since 5.1.0\n\thandleError = ( editor, error, message = '' ) ->\n\n\t\tconsole.error error\n\n\t\tmessage = wc_payment_gateway_token_editor.i18n.general_error unless message\n\n\t\teditor.find( 'th.actions' ).prepend( '<span class=\"error\">' + message + '</span>' )\n"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"L57g":[function(require,module,exports) {
|
2 |
+
function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Apple_Pay_Handler_v5_10_5=function(){function i(t){e(this,i),this.init_product_page=this.init_product_page.bind(this),this.init_cart_page=this.init_cart_page.bind(this),this.init_checkout_page=this.init_checkout_page.bind(this),this.on_validate_merchant=this.on_validate_merchant.bind(this),this.validate_merchant=this.validate_merchant.bind(this),this.on_payment_method_selected=this.on_payment_method_selected.bind(this),this.on_shipping_contact_selected=this.on_shipping_contact_selected.bind(this),this.on_shipping_method_selected=this.on_shipping_method_selected.bind(this),this.on_payment_authorized=this.on_payment_authorized.bind(this),this.process_authorization=this.process_authorization.bind(this),this.on_cancel_payment=this.on_cancel_payment.bind(this),this.reset_payment_request=this.reset_payment_request.bind(this),this.get_payment_request=this.get_payment_request.bind(this),this.gateway_id=t.gateway_id,this.gateway_slug=t.gateway_slug,this.merchant_id=t.merchant_id,this.ajax_url=t.ajax_url,this.validate_nonce=t.validate_nonce,this.recalculate_totals_nonce=t.recalculate_totals_nonce,this.process_nonce=t.process_nonce,this.payment_request=t.payment_request,this.generic_error=t.generic_error,this.wrapper=".sv-wc-external-checkout",this.container=".buttons-container",this.button=".sv-wc-apple-pay-button"}return n(i,[{key:"is_available",value:function(){return!!window.ApplePaySession&&ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then(function(e){return e})}},{key:"init",value:function(){var e=this;if(1===t(this.container).children().length&&t(this.wrapper).hide(),this.is_available()&&(t("form.cart").length?this.init_product_page():t("form.woocommerce-cart-form").length?this.init_cart_page():t("form.woocommerce-checkout").length&&this.init_checkout_page(),this.ui_element))return this.payment_request&&(t(this.button).show(),t(this.wrapper).show()),t(document.body).on("click",".sv-wc-apple-pay-button",function(t){var n;t.preventDefault(),e.block_ui();try{return e.session=e.get_new_session(e.payment_request),e.session.onvalidatemerchant=function(t){return e.on_validate_merchant(t)},e.session.onpaymentmethodselected=function(t){return e.on_payment_method_selected(t)},e.session.onshippingcontactselected=function(t){return e.on_shipping_contact_selected(t)},e.session.onshippingmethodselected=function(t){return e.on_shipping_method_selected(t)},e.session.onpaymentauthorized=function(t){return e.on_payment_authorized(t)},e.session.oncancel=function(t){return e.on_cancel_payment(t)},e.session.begin()}catch(i){return n=i,e.fail_payment(n)}})}},{key:"init_product_page",value:function(){return this.ui_element=t("form.cart")}},{key:"init_cart_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){return e.reset_payment_request()})}},{key:"init_checkout_page",value:function(){var e=this;return this.ui_element=t("form.woocommerce-checkout"),t(document.body).on("updated_checkout",function(){return e.reset_payment_request()})}},{key:"get_new_session",value:function(e){return new ApplePaySession(this.get_sdk_version(),e)}},{key:"get_sdk_version",value:function(){return 2}},{key:"on_validate_merchant",value:function(e){var t=this;return this.validate_merchant(e.validationURL).then(function(e){return e=JSON.parse(e),t.session.completeMerchantValidation(e)},function(e){return t.session.abort(),t.fail_payment("Merchant could no be validated. "+e.message)})}},{key:"validate_merchant",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_validate_merchant"),nonce:n.validate_nonce,merchant_id:n.merchant_id,url:e},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_payment_method_selected",value:function(e){var n=this;return new Promise(function(e,i){var a;return a={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce},t.post(n.ajax_url,a,function(t){return t.success?(a=t.data,e(n.session.completePaymentMethodSelection(a.total,a.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+t.data.message),i(n.session.completePaymentMethodSelection(n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_contact_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,contact:e.shippingContact},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,o.shipping_methods,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping contact. "+e.data.message),a(n.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_shipping_method_selected",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_recalculate_totals"),nonce:n.recalculate_totals_nonce,method:e.shippingMethod.identifier},t.post(n.ajax_url,o,function(e){return e.success?(o=e.data,i(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,o.total,o.line_items))):(console.error("[Apple Pay] Error selecting a shipping method. "+e.data.message),a(n.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,n.payment_request.total,n.payment_request.lineItems)))})})}},{key:"on_payment_authorized",value:function(e){var t=this;return this.process_authorization(e.payment).then(function(e){return t.set_payment_status(!0),t.complete_purchase(e)},function(e){return t.set_payment_status(!1),t.fail_payment("Payment could no be processed. "+e.message)})}},{key:"process_authorization",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_process_payment"),nonce:n.process_nonce,payment:JSON.stringify(e)},t.post(n.ajax_url,o,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"on_cancel_payment",value:function(e){return this.unblock_ui()}},{key:"complete_purchase",value:function(e){return window.location=e.redirect}},{key:"fail_payment",value:function(e){return console.error("[Apple Pay] "+e),this.unblock_ui(),this.render_errors([this.generic_error])}},{key:"set_payment_status",value:function(e){var t;return t=e?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE,this.session.completePayment(t)}},{key:"reset_payment_request",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.block_ui(),this.get_payment_request(n).then(function(n){return t(e.button).show(),t(e.wrapper).show(),e.payment_request=JSON.parse(n),e.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),t(e.button).hide(),1===t(e.container).children().length&&t(e.wrapper).hide(),e.unblock_ui()})}},{key:"get_payment_request",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},t.extend(e,o),t.post(n.ajax_url,e,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.ui_element.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.ui_element.offset().top-100},1e3)}},{key:"block_ui",value:function(){return this.ui_element.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.ui_element.unblock()}}]),i}(),t(document.body).trigger("sv_wc_apple_pay_handler_v5_10_5_loaded")})}).call(this);
|
3 |
+
},{}]},{},["L57g"], null)
|
4 |
+
//# sourceMappingURL=../frontend/sv-wc-payment-gateway-apple-pay.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["frontend/sv-wc-payment-gateway-apple-pay.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAEH,OAAO,SAAE,GAAF,aAibN,OA1aM,OAAO,gCAAP,WAMS,SAAA,EAAA,GAAD,EAAA,KAAA,GAoFb,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAQA,KAAA,eAAA,KAAA,eAAA,KAAA,MAaA,KAAA,mBAAA,KAAA,mBAAA,KAAA,MAiCA,KAAA,qBAAA,KAAA,qBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAqBA,KAAA,2BAAA,KAAA,2BAAA,KAAA,MA4BA,KAAA,6BAAA,KAAA,6BAAA,KAAA,MA6BA,KAAA,4BAAA,KAAA,4BAAA,KAAA,MA6BA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAkBA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MAmBA,KAAA,kBAAA,KAAA,kBAAA,KAAA,MA2CA,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,oBAAA,KAAA,oBAAA,KAAA,MAlXE,KAAA,WAA2B,EAAK,WAChC,KAAA,aAA2B,EAAK,aAChC,KAAA,YAA2B,EAAK,YAChC,KAAA,SAA2B,EAAK,SAChC,KAAA,eAA2B,EAAK,eAChC,KAAA,yBAA2B,EAAK,yBAChC,KAAA,cAA2B,EAAK,cAChC,KAAA,gBAA2B,EAAK,gBAChC,KAAA,cAA2B,EAAK,cAEhC,KAAA,QAAY,2BACZ,KAAA,UAAY,qBACZ,KAAA,OAAY,0BApBT,OAAA,EAAA,EAAA,CAAA,CAAA,IAAA,eA2BS,MAAA,WAEb,QAAoB,OAAO,iBAE3B,gBAAgB,8BAA+B,KAAC,aAAc,KAAK,SAAE,GAE7D,OAAA,MAjCJ,CAAA,IAAA,OAuCC,MAAA,WAAA,IAAA,EAAA,KAML,GAHwC,IAArC,EAAG,KAAC,WAAY,WAAW,QAC7B,EAAG,KAAC,SAAU,OAED,KAAK,iBAGhB,EAAG,aAAc,OACd,KAAA,oBACE,EAAG,8BAA+B,OACpC,KAAA,iBACE,EAAG,6BAA8B,QACnC,KAAA,qBAGQ,KAAC,YAMf,OAJG,KAAC,kBACH,EAAG,KAAC,QAAS,OACb,EAAG,KAAC,SAAU,QAEf,EAAG,SAAS,MAAO,GAAG,QAAS,0BAA2B,SAAE,GAE/D,IAAA,EAAI,EAAE,iBAEF,EAAK,WAEL,IAYC,OAVA,EAAC,QAAU,EAAK,gBAAiB,EAAC,iBAGlC,EAAC,QAAQ,mBAA4B,SAAE,GAAW,OAAA,EAAK,qBAAsB,IAC7E,EAAC,QAAQ,wBAA4B,SAAE,GAAW,OAAA,EAAK,2BAA4B,IACnF,EAAC,QAAQ,0BAA4B,SAAE,GAAW,OAAA,EAAK,6BAA8B,IACrF,EAAC,QAAQ,yBAA4B,SAAE,GAAW,OAAA,EAAK,4BAA6B,IACpF,EAAC,QAAQ,oBAA4B,SAAE,GAAW,OAAA,EAAK,sBAAuB,IAC9E,EAAC,QAAQ,SAA4B,SAAE,GAAW,OAAA,EAAK,kBAAmB,IAE1E,EAAC,QAAQ,QAEV,MAAA,GAEC,OAFK,EAAA,EAEL,EAAK,aAAc,QApFjB,CAAA,IAAA,oBA0Fc,MAAA,WAElB,OAAA,KAAC,WAAa,EAAG,eA5Fb,CAAA,IAAA,iBAkGW,MAAA,WAAA,IAAA,EAAA,KAKf,OAHC,KAAA,WAAa,EAAG,8BAA+B,QAAS,mBAGzD,EAAG,SAAS,MAAO,GAAG,sBAAuB,WAE5C,OAAA,EAAK,4BAzGF,CAAA,IAAA,qBA+Ge,MAAA,WAAA,IAAA,EAAA,KAInB,OAFC,KAAA,WAAa,EAAG,6BAEjB,EAAG,SAAS,MAAO,GAAG,mBAAoB,WAGzC,OAAA,EAAK,4BAtHF,CAAA,IAAA,kBA+Hc,MAAA,SAAA,GAEX,OAAA,IAAI,gBAAiB,KAAK,kBAAmB,KAjIhD,CAAA,IAAA,kBAwIY,MAAA,WAET,OAAA,IA1IH,CAAA,IAAA,uBAgJmB,MAAA,SAAA,GAAF,IAAA,EAAA,KAErB,OAAA,KAAK,kBAAmB,EAAM,eAAgB,KAAK,SAAE,GAIpD,OAFA,EAAmB,KAAK,MAAO,GAE/B,EAAC,QAAQ,2BAA4B,IAEpC,SAAE,GAIH,OAFA,EAAC,QAAQ,QAET,EAAK,aAAa,mCAAqC,EAAS,aA5J7D,CAAA,IAAA,oBAmKgB,MAAA,SAAA,GAAF,IAAA,EAAA,KAAW,OAAA,IAAI,QAAQ,SAAE,EAAS,GAEvD,IAAA,EAQG,OARA,EAAO,CACgB,OAAA,MAAA,OAAA,EAAC,WADjB,gCAES,MAAA,EAAC,eACD,YAAA,EAAC,YACD,IAAA,GAIhB,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,QACX,EAAQ,EAAS,MAEjB,EAAO,EAAS,YAlLd,CAAA,IAAA,6BAwLyB,MAAA,SAAA,GAAF,IAAA,EAAA,KAE3B,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1B,IAAA,EAMI,OANA,EAAO,CACW,OAAA,MAAA,OAAA,EAAC,WADZ,iCAEI,MAAA,EAAC,0BAIZ,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,SAEX,EAAO,EAAS,KAEhB,EAAQ,EAAC,QAAQ,+BAAgC,EAAK,MAAO,EAAK,eAIlE,QAAQ,MAAM,mDAAqD,EAAS,KAAK,SAEjF,EAAO,EAAC,QAAQ,+BAAgC,EAAC,gBAAgB,MAAO,EAAC,gBAAgB,mBA9MxF,CAAA,IAAA,+BAoN2B,MAAA,SAAA,GAAF,IAAA,EAAA,KAE7B,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1B,IAAA,EAOI,OAPA,EAAO,CACY,OAAA,MAAA,OAAA,EAAC,WADb,iCAEK,MAAA,EAAC,yBACD,QAAA,EAAM,iBAIlB,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,SAEX,EAAO,EAAS,KAEhB,EAAQ,EAAC,QAAQ,iCAAkC,gBAAgB,eAAgB,EAAK,iBAAkB,EAAK,MAAO,EAAK,eAI3H,QAAQ,MAAM,mDAAqD,EAAS,KAAK,SAEjF,EAAO,EAAC,QAAQ,iCAAkC,gBAAgB,eAAgB,GAAI,EAAC,gBAAgB,MAAO,EAAC,gBAAgB,mBA3O9H,CAAA,IAAA,8BAiP0B,MAAA,SAAA,GAAF,IAAA,EAAA,KAE5B,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1B,IAAA,EAOI,OAPA,EAAO,CACW,OAAA,MAAA,OAAA,EAAC,WADZ,iCAEI,MAAA,EAAC,yBACD,OAAA,EAAM,eAAe,YAIhC,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,SAEX,EAAO,EAAS,KAEhB,EAAQ,EAAC,QAAQ,gCAAiC,gBAAgB,eAAgB,EAAK,MAAO,EAAK,eAInG,QAAQ,MAAM,kDAAoD,EAAS,KAAK,SAEhF,EAAO,EAAC,QAAQ,gCAAiC,gBAAgB,eAAgB,EAAC,gBAAgB,MAAO,EAAC,gBAAgB,mBAxQzH,CAAA,IAAA,wBA8QoB,MAAA,SAAA,GAAF,IAAA,EAAA,KAEtB,OAAA,KAAK,sBAAuB,EAAM,SAAU,KAAK,SAAE,GAIlD,OAFA,EAAK,oBAAoB,GAEzB,EAAK,kBAAmB,IAEvB,SAAE,GAIH,OAFA,EAAK,oBAAoB,GAEzB,EAAK,aAAa,kCAAoC,EAAS,aA1R5D,CAAA,IAAA,wBAgSoB,MAAA,SAAA,GAAF,IAAA,EAAA,KAAe,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE/D,IAAA,EAMG,OANA,EAAO,CACN,OAAgB,MAAA,OAAA,EAAC,WADX,8BAEN,MAAS,EAAC,cACV,QAAS,KAAK,UAAW,IAG1B,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,QACX,EAAQ,EAAS,MAEjB,EAAO,EAAS,YA7Sd,CAAA,IAAA,oBAmTgB,MAAA,SAAA,GAEpB,OAAA,KAAK,eArTD,CAAA,IAAA,oBA2TgB,MAAA,SAAA,GAEpB,OAAA,OAAO,SAAW,EAAS,WA7TvB,CAAA,IAAA,eAmUW,MAAA,SAAA,GAMf,OAJA,QAAQ,MAAM,eAAiB,GAE1B,KAAA,aAEL,KAAK,cAAe,CAAE,KAAC,kBAzUnB,CAAA,IAAA,qBA+UiB,MAAA,SAAA,GAExB,IAAA,EAKG,OAJC,EADE,EACO,gBAAgB,eAEhB,gBAAgB,eAE1B,KAAC,QAAQ,gBAAiB,KAtVtB,CAAA,IAAA,wBA8VkB,MAAA,WAAA,IAAA,EAAA,KAAE,EAAO,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAI/B,OAFK,KAAA,WAEL,KAAK,oBAAqB,GAAO,KAAK,SAAE,GAOvC,OALA,EAAG,EAAC,QAAS,OACb,EAAG,EAAC,SAAU,OAEd,EAAC,gBAAkB,KAAK,MAAO,GAE/B,EAAK,cAEJ,SAAE,GASH,OAPA,QAAQ,MAAM,gDAAkD,EAAS,SAEzE,EAAG,EAAC,QAAS,OAE2B,IAArC,EAAG,EAAC,WAAY,WAAW,QAC7B,EAAG,EAAC,SAAU,OAEf,EAAK,iBApXF,CAAA,IAAA,sBA0XkB,MAAA,SAAA,GAAF,IAAA,EAAA,KAAY,OAAA,IAAI,QAAQ,SAAE,EAAS,GAE1D,IAAA,EAOG,OAPA,EAAY,CACM,OAAA,MAAA,OAAA,EAAC,WAAlB,mCAGD,EAAE,OAAO,EAAM,GAGf,EAAE,KAAK,EAAC,SAAU,EAAM,SAAE,GAEtB,OAAA,EAAS,QACX,EAAQ,EAAS,MAEjB,EAAO,EAAS,YAxYd,CAAA,IAAA,gBA8YY,MAAA,SAAA,GAYhB,OATA,EAAG,4CAA6C,SAG/C,KAAA,WAAW,QAAQ,qCAAuC,EAAO,KAAM,aAAgB,cAGvF,KAAA,WAAW,YAAa,cAAe,UAGxC,EAAG,cAAe,QAAS,CAAE,UAAW,KAAC,WAAW,SAAS,IAAM,KAAO,OA1ZtE,CAAA,IAAA,WAgaK,MAAA,WAAG,OAAA,KAAC,WAAW,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QAhanF,CAAA,IAAA,aAsaO,MAAA,WAAG,OAAA,KAAC,WAAW,cAtatB,EAAA,GA0aN,EAAG,SAAS,MAAO,QAAS,8CAnb1B,KAAA","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\n\njQuery ( $ ) ->\n\n\t\"use strict\"\n\n\t# The WooCommerce Apple Pay handler base class.\n\t#\n\t# @since 4.7.0\n\tclass window.SV_WC_Apple_Pay_Handler_v5_10_5\n\n\n\t\t# Constructs the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tconstructor: (args) ->\n\n\t\t\t@gateway_id = args.gateway_id\n\t\t\t@gateway_slug = args.gateway_slug\n\t\t\t@merchant_id = args.merchant_id\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@validate_nonce = args.validate_nonce\n\t\t\t@recalculate_totals_nonce = args.recalculate_totals_nonce\n\t\t\t@process_nonce = args.process_nonce\n\t\t\t@payment_request = args.payment_request\n\t\t\t@generic_error = args.generic_error\n\n\t\t\t@wrapper = '.sv-wc-external-checkout'\n\t\t\t@container = '.buttons-container'\n\t\t\t@button = '.sv-wc-apple-pay-button'\n\n\n\t\t# Determines if Apple Pay is available.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return bool\n\t\tis_available: ->\n\n\t\t\treturn false unless window.ApplePaySession\n\n\t\t\tApplePaySession.canMakePaymentsWithActiveCard( @merchant_id ).then ( canMakePayments ) =>\n\n\t\t\t\treturn canMakePayments\n\n\n\t\t# Initializes the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tinit: ->\n\n\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\tif $( @container ).children().length is 1\n\t\t\t\t$( @wrapper ).hide()\n\n\t\t\treturn unless this.is_available()\n\n\t\t\t# initialize for the various pages\n\t\t\tif $( 'form.cart' ).length\n\t\t\t\tthis.init_product_page()\n\t\t\telse if $( 'form.woocommerce-cart-form' ).length\n\t\t\t\tthis.init_cart_page()\n\t\t\telse if $( 'form.woocommerce-checkout' ).length\n\t\t\t\tthis.init_checkout_page()\n\n\t\t\t# bail if no UI was initialized\n\t\t\treturn unless @ui_element\n\n\t\t\tif @payment_request\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t$( document.body ).on 'click', '.sv-wc-apple-pay-button', ( e ) =>\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\tthis.block_ui()\n\n\t\t\t\ttry\n\n\t\t\t\t\t@session = this.get_new_session( @payment_request )\n\n\t\t\t\t\t# set the payment card events\n\t\t\t\t\t@session.onvalidatemerchant = ( event ) => this.on_validate_merchant( event )\n\t\t\t\t\t@session.onpaymentmethodselected = ( event ) => this.on_payment_method_selected( event )\n\t\t\t\t\t@session.onshippingcontactselected = ( event ) => this.on_shipping_contact_selected( event )\n\t\t\t\t\t@session.onshippingmethodselected = ( event ) => this.on_shipping_method_selected( event )\n\t\t\t\t\t@session.onpaymentauthorized = ( event ) => this.on_payment_authorized( event )\n\t\t\t\t\t@session.oncancel = ( event ) => this.on_cancel_payment( event )\n\n\t\t\t\t\t@session.begin()\n\n\t\t\t\tcatch error\n\n\t\t\t\t\tthis.fail_payment( error )\n\n\n\t\t# Initializes the product page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_product_page: =>\n\n\t\t\t@ui_element = $( 'form.cart' )\n\n\n\t\t# Initializes the cart page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_cart_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' )\n\n\t\t\t# re-init if the cart totals are updated\n\t\t\t$( document.body ).on 'updated_cart_totals', =>\n\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Initializes the checkout page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_checkout_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-checkout' )\n\n\t\t\t$( document.body ).on 'updated_checkout', =>\n\n\t\t\t\t# re-init if the checkout is updated\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Gets a new Apple Pay session.\n\t\t#\n\t\t# @since 5.6.0\n\t\t#\n\t\t# @param [Object] payment_request payment request object\n\t\t# @return ApplePaySession\n\t\tget_new_session: ( payment_request ) ->\n\n\t\t\treturn new ApplePaySession( this.get_sdk_version(), payment_request )\n\n\n\t\t# Gets the Apple SDK version to use.\n\t\t#\n\t\t# @since 5.6.0\n\t\t# @return int\n\t\tget_sdk_version: ->\n\n\t\t\treturn 2\n\n\n\t\t# The callback for after the merchant data is validated.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_validate_merchant: ( event ) =>\n\n\t\t\tthis.validate_merchant( event.validationURL ).then ( merchant_session ) =>\n\n\t\t\t\tmerchant_session = JSON.parse( merchant_session )\n\n\t\t\t\t@session.completeMerchantValidation( merchant_session )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\t@session.abort()\n\n\t\t\t\tthis.fail_payment 'Merchant could no be validated. ' + response.message\n\n\n\t\t# Validates the merchant data.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return object\n\t\tvalidate_merchant: ( url ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_validate_merchant\",\n\t\t\t\t'nonce': @validate_nonce,\n\t\t\t\t'merchant_id': @merchant_id,\n\t\t\t\t'url': url\n\t\t\t}\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Fires after a payment method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completePaymentMethodSelection( data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completePaymentMethodSelection( @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping contact has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_contact_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'contact': event.shippingContact\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingContactSelection( ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingContactSelection( ApplePaySession.STATUS_FAILURE, [], @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'method': event.shippingMethod.identifier\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingMethodSelection( ApplePaySession.STATUS_SUCCESS, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping method. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingMethodSelection( ApplePaySession.STATUS_FAILURE, @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# The callback for after the payment data is authorized.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_authorized: ( event ) =>\n\n\t\t\tthis.process_authorization( event.payment ).then ( response ) =>\n\n\t\t\t\tthis.set_payment_status( true )\n\n\t\t\t\tthis.complete_purchase( response )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tthis.set_payment_status( false )\n\n\t\t\t\tthis.fail_payment 'Payment could no be processed. ' + response.message\n\n\n\t\t# Processes the transaction data.\n\t\t#\n\t\t# @since 4.7.0\n\t\tprocess_authorization: ( payment ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\taction: \"wc_#{ @gateway_id }_apple_pay_process_payment\",\n\t\t\t\tnonce: @process_nonce,\n\t\t\t\tpayment: JSON.stringify( payment )\n\t\t\t}\n\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# The callback for when the payment card is cancelled/dismissed.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_cancel_payment: ( event ) =>\n\n\t\t\tthis.unblock_ui()\n\n\n\t\t# Completes the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tcomplete_purchase: ( response ) ->\n\n\t\t\twindow.location = response.redirect\n\n\n\t\t# Fails the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tfail_payment: ( error ) ->\n\n\t\t\tconsole.error '[Apple Pay] ' + error\n\n\t\t\tthis.unblock_ui()\n\n\t\t\tthis.render_errors( [ @generic_error ] )\n\n\n\t\t# Sets the Apple Pay payment status depending on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tset_payment_status: ( success ) ->\n\n\t\t\tif success\n\t\t\t\tstatus = ApplePaySession.STATUS_SUCCESS\n\t\t\telse\n\t\t\t\tstatus = ApplePaySession.STATUS_FAILURE\n\n\t\t\t@session.completePayment( status )\n\n\n\t\t# Resets the payment request via AJAX.\n\t\t#\n\t\t# Extending handlers can call this on change events to refresh the data.\n\t\t#\n\t\t# @since 4.7.0\n\t\treset_payment_request: ( data = {} ) =>\n\n\t\t\tthis.block_ui()\n\n\t\t\tthis.get_payment_request( data ).then ( response ) =>\n\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t\t@payment_request = JSON.parse( response )\n\n\t\t\t\tthis.unblock_ui()\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tconsole.error '[Apple Pay] Could not build payment request. ' + response.message\n\n\t\t\t\t$( @button ).hide()\n\t\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\t\tif $( @container ).children().length is 1\n\t\t\t\t\t$( @wrapper ).hide()\n\n\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Gets the payment request via AJAX.\n\t\t#\n\t\t# @since 4.7.0\n\t\tget_payment_request: ( data ) => new Promise ( resolve, reject ) =>\n\n\t\t\tbase_data = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_get_payment_request\"\n\t\t\t}\n\n\t\t\t$.extend data, base_data\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Renders any new errors and bring them into the viewport.\n\t\t#\n\t\t# @since 4.7.0\n\t\trender_errors: ( errors ) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@ui_element.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@ui_element.removeClass( 'processing' ).unblock()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @ui_element.offset().top - 100 }, 1000 )\n\n\n\t\t# Blocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tblock_ui: -> @ui_element.block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tunblock_ui: -> @ui_element.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_10_5_loaded' )\n"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"O8A1":[function(require,module,exports) {
|
2 |
+
function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}jQuery(function(t){"use strict";window.SV_WC_Google_Pay_Handler_v5_10_5=function(){function n(t){e(this,n);var a=t.plugin_id,o=t.merchant_id,i=t.merchant_name,r=t.gateway_id,s=(t.gateway_id_dasherized,t.ajax_url),c=t.recalculate_totals_nonce,l=t.process_nonce,u=t.button_style,d=t.card_types,h=t.available_countries,m=t.currency_code,y=t.needs_shipping,g=t.generic_error;this.gatewayID=r,this.merchantID=o,this.merchantName=i,this.ajaxURL=s,this.recalculateTotalsNonce=c,this.processNonce=l,this.buttonStyle=u,this.availableCountries=h,this.currencyCode=m,this.needsShipping=y,this.genericError=g,t.product_id&&(this.productID=t.product_id);var p=d;this.baseRequest={apiVersion:2,apiVersionMinor:0};var f={type:"PAYMENT_GATEWAY",parameters:{gateway:a,gatewayMerchantId:this.merchantID}};this.baseCardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:p,billingAddressRequired:!0,billingAddressParameters:{format:"FULL",phoneNumberRequired:!0}}},this.cardPaymentMethod=Object.assign({},this.baseCardPaymentMethod,{tokenizationSpecification:f}),this.paymentsClient=null}return a(n,[{key:"getGoogleIsReadyToPayRequest",value:function(){return Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.baseCardPaymentMethod]})}},{key:"getGooglePaymentDataRequest",value:function(e){var t=this;return this.getGoogleTransactionInfo(function(a){var n=Object.assign({},t.baseRequest);n.allowedPaymentMethods=[t.cardPaymentMethod],n.transactionInfo=a,n.merchantInfo={merchantId:t.merchantID,merchantName:t.merchantName},n.emailRequired=!0,n.callbackIntents=["PAYMENT_AUTHORIZATION"],t.needsShipping&&(n.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"],n.shippingAddressRequired=!0,n.shippingAddressParameters=t.getGoogleShippingAddressParameters(),n.shippingOptionRequired=!0),e(n)})}},{key:"getGooglePaymentsClient",value:function(){var e=this;if(null===this.paymentsClient){var t={merchantInfo:{merchantName:this.merchantName,merchantId:this.merchantID},paymentDataCallbacks:{onPaymentAuthorized:function(t){return e.onPaymentAuthorized(t)}}};this.needsShipping&&(t.paymentDataCallbacks.onPaymentDataChanged=function(t){return e.onPaymentDataChanged(t)}),this.paymentsClient=new google.payments.api.PaymentsClient(t)}return this.paymentsClient}},{key:"onPaymentAuthorized",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{t.processPayment(e,a)}catch(o){n({transactionState:"ERROR",error:{intent:"PAYMENT_AUTHORIZATION",message:"Payment could not be processed",reason:"PAYMENT_DATA_INVALID"}})}t.unblockUI()})}},{key:"onPaymentDataChanged",value:function(e){var t=this;return this.blockUI(),new Promise(function(a,n){try{var o=e.shippingAddress,i=e.shippingOptionData,r="";"SHIPPING_OPTION"==e.callbackTrigger&&(r=i.id),t.getUpdatedTotals(o,r,function(e){0==e.newShippingOptionParameters.shippingOptions.length&&(e={error:t.getGoogleUnserviceableAddressError()}),a(e)})}catch(s){t.failPayment("Could not load updated totals or process payment data request update. "+s)}t.unblockUI()})}},{key:"getGoogleTransactionInfo",value:function(e){var a=this,n={action:"wc_".concat(this.gatewayID,"_google_pay_get_transaction_info")};this.productID&&(n.productID=this.productID),t.post(this.ajaxURL,n,function(t){t.success?e(JSON.parse(t.data)):a.failPayment("Could not build transaction info. "+t.data.message)})}},{key:"getUpdatedTotals",value:function(e,a,n){var o=this,i={action:"wc_".concat(this.gatewayID,"_google_pay_recalculate_totals"),nonce:this.recalculateTotalsNonce,shippingAddress:e,shippingMethod:a};this.productID&&(i.productID=this.productID),t.post(this.ajaxURL,i,function(e){e.success?n(JSON.parse(e.data)):o.failPayment("Could not recalculate totals. "+e.data.message)})}},{key:"getGoogleShippingAddressParameters",value:function(){return{allowedCountryCodes:this.availableCountries}}},{key:"getGoogleUnserviceableAddressError",value:function(){return{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:"Cannot ship to the selected address",intent:"SHIPPING_ADDRESS"}}},{key:"addGooglePayButton",value:function(){var e=this,t=this.getGooglePaymentsClient().createButton({onClick:function(t){return e.onGooglePaymentButtonClicked(t)},buttonColor:this.buttonStyle,buttonSizeMode:"fill"});document.getElementById("sv-wc-google-pay-button-container").appendChild(t)}},{key:"prefetchGooglePaymentData",value:function(){var e=this;this.getGooglePaymentDataRequest(function(t){t.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:e.currencyCode},e.getGooglePaymentsClient().prefetchPaymentData(t)})}},{key:"processPayment",value:function(e,a){var n=this,o={action:"wc_".concat(this.gatewayID,"_google_pay_process_payment"),nonce:this.processNonce,paymentData:JSON.stringify(e)};return this.productID&&!this.needsShipping&&(o.productID=this.productID),t.post(this.ajaxURL,o,function(e){e.success?(a({transactionState:"SUCCESS"}),window.location=e.data.redirect):(a({transactionState:"ERROR",error:{intent:"SHIPPING_ADDRESS",message:"Invalid data",reason:"PAYMENT_DATA_INVALID"}}),n.failPayment("Payment could not be processed. "+e.data.message))})}},{key:"onGooglePaymentButtonClicked",value:function(e){var t=this;e.preventDefault(),this.blockUI(),this.getGooglePaymentDataRequest(function(e){var a=t.getGooglePaymentsClient();try{a.loadPaymentData(e)}catch(n){t.failPayment("Could not load payment data. "+n)}t.unblockUI()})}},{key:"init",value:function(){if(t("form.cart").length)this.initProductPage();else if(t("form.woocommerce-cart-form").length)this.initCartPage();else{if(!t("form.woocommerce-checkout").length)return;this.initCheckoutPage()}this.initGooglePay()}},{key:"initGooglePay",value:function(){var e=this;this.getGooglePaymentsClient().isReadyToPay(this.getGoogleIsReadyToPayRequest()).then(function(t){t.result&&(e.addGooglePayButton(),e.prefetchGooglePaymentData())}).catch(function(t){e.failPayment("Google Pay is not ready. "+t)})}},{key:"initProductPage",value:function(){this.uiElement=t("form.cart")}},{key:"initCartPage",value:function(){var e=this;this.uiElement=t("form.woocommerce-cart-form").parents("div.woocommerce"),t(document.body).on("updated_cart_totals",function(){e.initGooglePay()})}},{key:"initCheckoutPage",value:function(){this.uiElement=t("form.woocommerce-checkout")}},{key:"failPayment",value:function(e){console.error("[Google Pay] "+e),this.unblockUI(),this.renderErrors([this.genericError])}},{key:"renderErrors",value:function(e){t(".woocommerce-error, .woocommerce-message").remove(),this.uiElement.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.uiElement.removeClass("processing").unblock(),t("html, body").animate({scrollTop:this.uiElement.offset().top-100},1e3)}},{key:"blockUI",value:function(){this.uiElement.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblockUI",value:function(){this.uiElement.unblock()}}]),n}(),t(document.body).trigger("sv_wc_google_pay_handler_v5_10_5_loaded")});
|
3 |
+
},{}]},{},["O8A1"], null)
|
4 |
+
//# sourceMappingURL=../frontend/sv-wc-payment-gateway-google-pay.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_10_5","params","plugin_id","merchant_id","merchant_name","gateway_id","ajax_url","gateway_id_dasherized","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","merchantID","merchantName","ajaxURL","recalculateTotalsNonce","processNonce","buttonStyle","availableCountries","currencyCode","needsShipping","genericError","product_id","productID","allowedCardNetworks","baseRequest","apiVersion","apiVersionMinor","allowedCardAuthMethods","tokenizationSpecification","type","parameters","baseCardPaymentMethod","allowedAuthMethods","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","cardPaymentMethod","Object","assign","paymentsClient","allowedPaymentMethods","resolve","getGoogleTransactionInfo","transactionInfo","paymentDataRequest","merchantInfo","merchantId","emailRequired","callbackIntents","shippingAddressRequired","shippingAddressParameters","getGoogleShippingAddressParameters","shippingOptionRequired","args","paymentDataCallbacks","onPaymentAuthorized","paymentData","onPaymentDataChanged","google","payments","api","PaymentsClient","blockUI","Promise","reject","processPayment","err","transactionState","error","intent","message","reason","unblockUI","intermediatePaymentData","shippingAddress","shippingOptionData","chosenShippingMethod","callbackTrigger","id","getUpdatedTotals","paymentDataRequestUpdate","newShippingOptionParameters","shippingOptions","length","getGoogleUnserviceableAddressError","failPayment","data","action","post","response","success","JSON","parse","shippingMethod","allowedCountryCodes","button","getGooglePaymentsClient","createButton","onClick","event","onGooglePaymentButtonClicked","buttonColor","buttonSizeMode","document","getElementById","appendChild","getGooglePaymentDataRequest","totalPriceStatus","prefetchPaymentData","nonce","stringify","location","redirect","preventDefault","loadPaymentData","initProductPage","initCartPage","initCheckoutPage","initGooglePay","isReadyToPay","getGoogleIsReadyToPayRequest","then","result","addGooglePayButton","prefetchGooglePaymentData","catch","uiElement","parents","body","on","console","renderErrors","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger"],"mappings":";AAGA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,EAAAA,OAAQ,SAAUC,GAEjB,aASAC,OAAOC,iCAAP,WAwBcC,SAAAA,EAAAA,GAAS,EAAA,KAAA,GAGpBC,IAAAA,EAcGD,EAdHC,UACAC,EAaGF,EAbHE,YACAC,EAYGH,EAZHG,cACAC,EAWGJ,EAXHI,WAEAC,GASGL,EAVHM,sBAUGN,EATHK,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,IAAAA,EAAsBlB,EAOvBmB,KAAAA,YAAc,CAClBC,WAAY,EACZC,gBAAiB,GAUZC,IAUAC,EAA4B,CACjCC,KAAM,kBACNC,WAAY,CACAlC,QAAAA,EACU,kBAAA,KAAKe,aASvBoB,KAAAA,sBAAwB,CAC5BF,KAAM,OACNC,WAAY,CACXE,mBA1B6B,CAAE,WAAY,kBA2B3CT,oBAAqBA,EACrBU,wBAAwB,EACxBC,yBAA0B,CACzBC,OAAQ,OACRC,qBAAqB,KAUnBC,KAAAA,kBAAoBC,OAAOC,OAC/B,GACA,KAAKR,sBACL,CACCH,0BAA2BA,IASxBY,KAAAA,eAAiB,KAzIxB,OAAA,EAAA,EAAA,CAAA,CAAA,IAAA,+BAsJgC,MAAA,WAEvBF,OAAAA,OAAOC,OACb,GACA,KAAKf,YACL,CACCiB,sBAAuB,CAAE,KAAKV,2BA5JlC,CAAA,IAAA,8BAyK8BW,MAAAA,SAAAA,GAAU,IAAA,EAAA,KAE/B,OAAA,KAAKC,yBAA0B,SAAEC,GAEjCC,IAAAA,EAAqBP,OAAOC,OAAQ,GAAI,EAAKf,aACnDqB,EAAmBJ,sBAAwB,CAAE,EAAKJ,mBAClDQ,EAAmBD,gBAAkBA,EACrCC,EAAmBC,aAAe,CACjCC,WAAY,EAAKpC,WACjBC,aAAc,EAAKA,cAGpBiC,EAAmBG,eAAgB,EACnCH,EAAmBI,gBAAkB,CAAE,yBAElC,EAAK9B,gBACT0B,EAAmBI,gBAAkB,CAAE,mBAAoB,kBAAmB,yBAC9EJ,EAAmBK,yBAA0B,EAC7CL,EAAmBM,0BAA4B,EAAKC,qCACpDP,EAAmBQ,wBAAyB,GAG7CX,EAASG,OA/LZ,CAAA,IAAA,0BAyM2B,MAAA,WAAA,IAAA,EAAA,KACpB,GAAwB,OAAxB,KAAKL,eAA0B,CAC/Bc,IAAAA,EAAO,CACVR,aAAc,CACblC,aAAc,KAAKA,aACnBmC,WAAY,KAAKpC,YAElB4C,qBAAsB,CACrBC,oBAAqB,SAAEC,GAAiB,OAAA,EAAKD,oBAAqBC,MAI/D,KAAKtC,gBACTmC,EAAKC,qBAAqBG,qBAAuB,SAAED,GAAiB,OAAA,EAAKC,qBAAsBD,KAG3FjB,KAAAA,eAAiB,IAAImB,OAAOC,SAASC,IAAIC,eAAgBR,GAExD,OAAA,KAAKd,iBA3Nd,CAAA,IAAA,sBAsOsBiB,MAAAA,SAAAA,GAAc,IAAA,EAAA,KAI3B,OAFFM,KAAAA,UAEE,IAAIC,QAAS,SAACtB,EAASuB,GAGzB,IACH,EAAKC,eAAgBT,EAAaf,GACjC,MAAOyB,GACRF,EAAQ,CACPG,iBAAkB,QAClBC,MAAO,CACNC,OAAQ,wBACRC,QAAS,iCACTC,OAAQ,0BAKX,EAAKC,gBA1PR,CAAA,IAAA,uBAuQuBC,MAAAA,SAAAA,GAA0B,IAAA,EAAA,KAIxC,OAFFX,KAAAA,UAEE,IAAIC,QAAQ,SAAEtB,EAASuB,GAEzB,IACCU,IAAAA,EAAkBD,EAAwBC,gBAC1CC,EAAqBF,EAAwBE,mBAC7CC,EAAuB,GAEqB,mBAA3CH,EAAwBI,kBAC5BD,EAAuBD,EAAmBG,IAG3C,EAAKC,iBAAkBL,EAAiBE,EAAsB,SAAEI,GAEqB,GAA/EA,EAAyBC,4BAA4BC,gBAAgBC,SACzEH,EAA2B,CAC1BZ,MAAO,EAAKgB,uCAId3C,EAASuC,KAGT,MAAOd,GACR,EAAKmB,YAAa,yEAA2EnB,GAG9F,EAAKM,gBArSR,CAAA,IAAA,2BAiT2B/B,MAAAA,SAAAA,GAAU,IAAA,EAAA,KAG7B6C,EAAO,CACZC,OAAc,MAAA,OAAA,KAAK9E,UAAb,qCAGF,KAAKY,YACTiE,EAAKjE,UAAY,KAAKA,WAGvB9B,EAAEiG,KAAM,KAAK5E,QAAS0E,EAAM,SAAEG,GAExBA,EAASC,QACbjD,EAASkD,KAAKC,MAAOH,EAASH,OAE9B,EAAKD,YAAa,qCAAuCI,EAASH,KAAKhB,aAjU3E,CAAA,IAAA,mBA+UmBI,MAAAA,SAAAA,EAAiBmB,EAAgBpD,GAAU,IAAA,EAAA,KAEtD6C,EAAO,CACZC,OAAc,MAAA,OAAA,KAAK9E,UADP,kCAEH,MAAA,KAAKI,uBACd6D,gBAAAA,EACAmB,eAAAA,GAGI,KAAKxE,YACTiE,EAAKjE,UAAY,KAAKA,WAGvB9B,EAAEiG,KAAM,KAAK5E,QAAS0E,EAAM,SAAEG,GAExBA,EAASC,QACbjD,EAASkD,KAAKC,MAAOH,EAASH,OAE9B,EAAKD,YAAa,iCAAmCI,EAASH,KAAKhB,aAjWvE,CAAA,IAAA,qCA4WsC,MAAA,WAE7B,MAAA,CACNwB,oBAAqB,KAAK9E,sBA/W7B,CAAA,IAAA,qCAyXsC,MAAA,WAC7B,MAAA,CACNuD,OAAQ,iCACRD,QAAS,sCACTD,OAAQ,sBA7XX,CAAA,IAAA,qBAuYsB,MAAA,WAAA,IAAA,EAAA,KAGd0B,EADiB,KAAKC,0BACEC,aAAc,CAC3CC,QAAS,SAAEC,GAAW,OAAA,EAAKC,6BAA8BD,IACzDE,YAAa,KAAKtF,YAClBuF,eAAgB,SAEjBC,SAASC,eAAgB,qCAAsCC,YAAaV,KA/Y9E,CAAA,IAAA,4BAuZ6B,MAAA,WAAA,IAAA,EAAA,KAEtBW,KAAAA,4BAA6B,SAAE9D,GAGnCA,EAAmBD,gBAAkB,CACpCgE,iBAAkB,sBAClB1F,aAAc,EAAKA,cAEG,EAAK+E,0BACbY,oBAAqBhE,OAjavC,CAAA,IAAA,iBA6aiBY,MAAAA,SAAAA,EAAaf,GAAU,IAAA,EAAA,KAGhC6C,EAAO,CACZC,OAAc,MAAA,OAAA,KAAK9E,UADP,+BAEZoG,MAAO,KAAK/F,aACZ0C,YAAamC,KAAKmB,UAAWtD,IAOvBjE,OAJF,KAAK8B,YAAe,KAAKH,gBAC7BoE,EAAKjE,UAAY,KAAKA,WAGhB9B,EAAEiG,KAAM,KAAK5E,QAAS0E,EAAM,SAAEG,GAC/BA,EAASC,SACbjD,EAAS,CACR0B,iBAAkB,YAEnB3E,OAAOuH,SAAWtB,EAASH,KAAK0B,WAEhCvE,EAAS,CACR0B,iBAAkB,QAClBC,MAAO,CACNC,OAAQ,mBACRC,QAAS,eACTC,OAAQ,0BAGV,EAAKc,YAAa,mCAAqCI,EAASH,KAAKhB,cAzczE,CAAA,IAAA,+BAid+B6B,MAAAA,SAAAA,GAAQ,IAAA,EAAA,KAErCA,EAAMc,iBAEDnD,KAAAA,UAEA4C,KAAAA,4BAA6B,SAAE9D,GAE7BL,IAAAA,EAAiB,EAAKyD,0BACxB,IACHzD,EAAe2E,gBAAiBtE,GAC/B,MAAQsB,GACT,EAAKmB,YAAa,gCAAkCnB,GAGrD,EAAKM,gBAheR,CAAA,IAAA,OA0eQ,MAAA,WAGDjF,GAAAA,EAAG,aAAc4F,OAChBgC,KAAAA,uBACC,GAAK5H,EAAG,8BAA+B4F,OACxCiC,KAAAA,mBACC,CAAA,IAAK7H,EAAG,6BAA8B4F,OAG5C,OAFKkC,KAAAA,mBAKDC,KAAAA,kBAvfP,CAAA,IAAA,gBA6fiB,MAAA,WAAA,IAAA,EAAA,KAEQ,KAAKtB,0BACbuB,aAAc,KAAKC,gCAChCC,KAAM,SAAEhC,GACHA,EAASiC,SACb,EAAKC,qBAEL,EAAKC,+BAGNC,MAAO,SAAE3D,GACT,EAAKmB,YAAa,4BAA8BnB,OAzgBpD,CAAA,IAAA,kBAghBmB,MAAA,WACZ4D,KAAAA,UAAYvI,EAAG,eAjhBtB,CAAA,IAAA,eAuhBgB,MAAA,WAAA,IAAA,EAAA,KACTuI,KAAAA,UAAYvI,EAAG,8BAA+BwI,QAAS,mBAG5DxI,EAAGgH,SAASyB,MAAOC,GAAI,sBAAuB,WAC7C,EAAKX,oBA5hBR,CAAA,IAAA,mBAmiBoB,MAAA,WACbQ,KAAAA,UAAYvI,EAAG,+BApiBtB,CAAA,IAAA,cA0iBc6E,MAAAA,SAAAA,GAEZ8D,QAAQ9D,MAAO,gBAAkBA,GAE5BI,KAAAA,YAEA2D,KAAAA,aAAc,CAAE,KAAKhH,iBAhjB5B,CAAA,IAAA,eAsjBeiH,MAAAA,SAAAA,GAGb7I,EAAG,4CAA6C8I,SAG3CP,KAAAA,UAAUQ,QAAS,qCAAuCF,EAAOG,KAAM,aAAgB,cAGvFT,KAAAA,UAAUU,YAAa,cAAeC,UAG3ClJ,EAAG,cAAemJ,QAAS,CAAEC,UAAW,KAAKb,UAAUc,SAASC,IAAM,KAAO,OAlkB/E,CAAA,IAAA,UAwkBW,MAAA,WACJf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBa,MAAA,WACNnB,KAAAA,UAAUW,cAhlBjB,EAAA,GAolBAlJ,EAAGgH,SAASyB,MAAOkB,QAAS","file":"sv-wc-payment-gateway-google-pay.js","sourceRoot":"../js","sourcesContent":["/**\n * Version 5.10.5\n */\njQuery( function( $ ) {\n\n\t\"use strict\"\n\n\t/**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_10_5} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_10_5 = class SV_WC_Google_Pay_Handler_v5_10_5 {\n\n\t\t/**\n\t\t * Handler constructor.\n\t\t *\n\t\t * @since 5.10.0\n\t\t *\n\t\t * @param {Object} params The plugin ID\n\t\t * @param {string} params.plugin_id The plugin ID\n\t\t * @param {string} params.merchant_id The merchant ID\n\t\t * @param {string} params.merchant_name The site name\n\t\t * @param {string} params.gateway_id The gateway ID\n\t\t * @param {string} params.gateway_id_dasherized The gateway ID dasherized\n\t\t * @param {string} params.ajax_url The AJAX URL\n\t\t * @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action\n\t\t * @param {string} params.process_nonce Nonce for the process AJAX action\n\t\t * @param {string} params.button_style The button style\n\t\t * @param {string[]} params.card_types The supported card types\n\t\t * @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for\n\t\t * @param {string[]} params.currency_code WC configured currency\n\t\t * @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping\n\t\t * @param {string} params.generic_error The generic error message\n\t\t * @param {string} params.product_id The product ID if we are on a Product page\n\t\t */\n\t\tconstructor( params ) {\n\n\t\t\tlet {\n\t\t\t\tplugin_id,\n\t\t\t\tmerchant_id,\n\t\t\t\tmerchant_name,\n\t\t\t\tgateway_id,\n\t\t\t\tgateway_id_dasherized,\n\t\t\t\tajax_url,\n\t\t\t\trecalculate_totals_nonce,\n\t\t\t\tprocess_nonce,\n\t\t\t\tbutton_style,\n\t\t\t\tcard_types,\n\t\t\t\tavailable_countries,\n\t\t\t\tcurrency_code,\n\t\t\t\tneeds_shipping,\n\t\t\t\tgeneric_error\n\t\t\t} = params;\n\n\t\t\tthis.gatewayID = gateway_id;\n\t\t\tthis.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\n\t\t\tthis.ajaxURL = ajax_url;\n\t\t\tthis.recalculateTotalsNonce = recalculate_totals_nonce;\n\t\t\tthis.processNonce = process_nonce;\n\t\t\tthis.buttonStyle = button_style;\n\t\t\tthis.availableCountries = available_countries;\n\t\t\tthis.currencyCode = currency_code;\n\t\t\tthis.needsShipping = needs_shipping;\n\t\t\tthis.genericError = generic_error;\n\n\t\t\tif ( params.product_id ) {\n\t\t\t\tthis.productID = params.product_id;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tconst allowedCardNetworks = card_types;\n\n\t\t\t/**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */\n\t\t\tthis.baseRequest = {\n\t\t\t\tapiVersion: 2,\n\t\t\t\tapiVersionMinor: 0\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */\n\t\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\n\t\t\t/**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */\n\t\t\tconst tokenizationSpecification = {\n\t\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\t\tparameters: {\n\t\t\t\t\t'gateway': plugin_id,\n\t\t\t\t\t'gatewayMerchantId': this.merchantID\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.baseCardPaymentMethod = {\n\t\t\t\ttype: 'CARD',\n\t\t\t\tparameters: {\n\t\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\t\tbillingAddressRequired: true,\n\t\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\t\tformat: 'FULL',\n\t\t\t\t\t\tphoneNumberRequired: true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.cardPaymentMethod = Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseCardPaymentMethod,\n\t\t\t\t{\n\t\t\t\t\ttokenizationSpecification: tokenizationSpecification\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */\n\t\t\tthis.paymentsClient = null;\n\t\t}\n\n\t\t/**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */\n\t\tgetGoogleIsReadyToPayRequest() {\n\n\t\t\treturn Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseRequest,\n\t\t\t\t{\n\t\t\t\t\tallowedPaymentMethods: [ this.baseCardPaymentMethod ]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */\n\t\tgetGooglePaymentDataRequest( resolve ) {\n\n\t\t\treturn this.getGoogleTransactionInfo( ( transactionInfo ) => {\n\n\t\t\t\tconst paymentDataRequest = Object.assign( {}, this.baseRequest );\n\t\t\t\tpaymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];\n\t\t\t\tpaymentDataRequest.transactionInfo = transactionInfo;\n\t\t\t\tpaymentDataRequest.merchantInfo = {\n\t\t\t\t\tmerchantId: this.merchantID,\n\t\t\t\t\tmerchantName: this.merchantName\n\t\t\t\t};\n\n\t\t\t\tpaymentDataRequest.emailRequired = true;\n\t\t\t\tpaymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\tpaymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];\n\t\t\t\t\tpaymentDataRequest.shippingAddressRequired = true;\n\t\t\t\t\tpaymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();\n\t\t\t\t\tpaymentDataRequest.shippingOptionRequired = true;\n\t\t\t\t}\n\n\t\t\t\tresolve( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */\n\t\tgetGooglePaymentsClient() {\n\t\t\tif ( this.paymentsClient === null ) {\n\t\t\t\tlet args = {\n\t\t\t\t\tmerchantInfo: {\n\t\t\t\t\t\tmerchantName: this.merchantName,\n\t\t\t\t\t\tmerchantId: this.merchantID\n\t\t\t\t\t},\n\t\t\t\t\tpaymentDataCallbacks: {\n\t\t\t\t\t\tonPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\targs.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );\n\t\t\t\t}\n\n\t\t\t\tthis.paymentsClient = new google.payments.api.PaymentsClient( args );\n\t\t\t}\n\t\t\treturn this.paymentsClient;\n\t\t}\n\n\t\t/**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */\n\t\tonPaymentAuthorized( paymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise( (resolve, reject) => {\n\n\t\t\t\t// handle the response\n\t\t\t\ttry {\n\t\t\t\t\tthis.processPayment( paymentData, resolve );\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\treject( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'PAYMENT_AUTHORIZATION',\n\t\t\t\t\t\t\tmessage: 'Payment could not be processed',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */\n\t\tonPaymentDataChanged( intermediatePaymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise(( resolve, reject ) => {\n\n\t\t\t\ttry {\n\t\t\t\t\tlet shippingAddress = intermediatePaymentData.shippingAddress;\n\t\t\t\t\tlet shippingOptionData = intermediatePaymentData.shippingOptionData;\n\t\t\t\t\tlet chosenShippingMethod = '';\n\n\t\t\t\t\tif ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {\n\t\t\t\t\t\tchosenShippingMethod = shippingOptionData.id;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {\n\n\t\t\t\t\t\tif ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {\n\t\t\t\t\t\t\tpaymentDataRequestUpdate = {\n\t\t\t\t\t\t\t\terror: this.getGoogleUnserviceableAddressError()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( paymentDataRequestUpdate );\n\t\t\t\t\t} );\n\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load updated totals or process payment data request update. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleTransactionInfo( resolve ) {\n\n\t\t\t// get transaction info from cart\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_get_transaction_info`,\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not build transaction info. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tgetUpdatedTotals( shippingAddress, shippingMethod, resolve ) {\n\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_recalculate_totals`,\n\t\t\t\t'nonce': this.recalculateTotalsNonce,\n\t\t\t\tshippingAddress,\n\t\t\t\tshippingMethod\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not recalculate totals. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleShippingAddressParameters() {\n\n\t\t\treturn {\n\t\t\t\tallowedCountryCodes: this.availableCountries\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */\n\t\tgetGoogleUnserviceableAddressError() {\n\t\t\treturn {\n\t\t\t\treason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n\t\t\t\tmessage: 'Cannot ship to the selected address',\n\t\t\t\tintent: 'SHIPPING_ADDRESS'\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */\n\t\taddGooglePayButton() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tconst button = paymentsClient.createButton( {\n\t\t\t\tonClick: ( event ) => this.onGooglePaymentButtonClicked( event ),\n\t\t\t\tbuttonColor: this.buttonStyle,\n\t\t\t\tbuttonSizeMode: 'fill'\n\t\t\t} );\n\t\t\tdocument.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );\n\t\t}\n\n\t\t/**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */\n\t\tprefetchGooglePaymentData() {\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\t// transactionInfo must be set but does not affect cache\n\t\t\t\tpaymentDataRequest.transactionInfo = {\n\t\t\t\t\ttotalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n\t\t\t\t\tcurrencyCode: this.currencyCode\n\t\t\t\t};\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\tpaymentsClient.prefetchPaymentData( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tprocessPayment( paymentData, resolve ) {\n\n\t\t\t// pass payment token to your gateway to process payment\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_process_payment`,\n\t\t\t\tnonce: this.processNonce,\n\t\t\t\tpaymentData: JSON.stringify( paymentData ),\n\t\t\t}\n\n\t\t\tif ( this.productID && ! this.needsShipping ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\treturn $.post( this.ajaxURL, data, ( response ) => {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'SUCCESS'\n\t\t\t\t\t} );\n\t\t\t\t\twindow.location = response.data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'SHIPPING_ADDRESS',\n\t\t\t\t\t\t\tmessage: 'Invalid data',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tthis.failPayment( 'Payment could not be processed. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */\n\t\tonGooglePaymentButtonClicked( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.blockUI();\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\ttry {\n\t\t\t\t\tpaymentsClient.loadPaymentData( paymentDataRequest );\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load payment data. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */\n\t\tinit() {\n\n\t\t\t// initialize for the various pages\n\t\t\tif ( $( 'form.cart' ).length ) {\n\t\t\t\tthis.initProductPage();\n\t\t\t} else if ( $( 'form.woocommerce-cart-form' ).length ) {\n\t\t\t\tthis.initCartPage();\n\t\t\t} else if ( $( 'form.woocommerce-checkout' ).length) {\n\t\t\t\tthis.initCheckoutPage()\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.initGooglePay();\n\t\t}\n\n\t\t/**\n\t\t * Initializes Google Pay.\n\t\t */\n\t\tinitGooglePay() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tpaymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( response.result ) {\n\t\t\t\t\t\tthis.addGooglePayButton();\n\t\t\t\t\t\t// prefetch payment data to improve performance\n\t\t\t\t\t\tthis.prefetchGooglePaymentData();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tthis.failPayment( 'Google Pay is not ready. ' + err );\n\t\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the product page.\n\t\t */\n\t\tinitProductPage() {\n\t\t\tthis.uiElement = $( 'form.cart' );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the cart page.\n\t\t */\n\t\tinitCartPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );\n\n\t\t\t// re-init if the cart totals are updated\n\t\t\t$( document.body ).on( 'updated_cart_totals', () => {\n\t\t\t\tthis.initGooglePay();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the checkout page.\n\t\t */\n\t\tinitCheckoutPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-checkout' );\n\t\t}\n\n\t\t/**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */\n\t\tfailPayment( error ) {\n\n\t\t\tconsole.error( '[Google Pay] ' + error );\n\n\t\t\tthis.unblockUI();\n\n\t\t\tthis.renderErrors( [ this.genericError ] );\n\t\t}\n\n\t\t/**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */\n\t\trenderErrors( errors ) {\n\n\t\t\t// hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove();\n\n\t\t\t// add errors\n\t\t\tthis.uiElement.prepend( '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>' );\n\n\t\t\t// unblock UI\n\t\t\tthis.uiElement.removeClass( 'processing' ).unblock();\n\n\t\t\t// scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );\n\t\t}\n\n\t\t/**\n\t\t * Blocks the payment form UI.\n\t\t */\n\t\tblockUI() {\n\t\t\tthis.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );\n\t\t}\n\n\t\t/**\n\t\t * Unblocks the payment form UI.\n\t\t */\n\t\tunblockUI() {\n\t\t\tthis.uiElement.unblock();\n\t\t}\n\t}\n\n\t$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_5_loaded' );\n\n} );\n"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"nDDW":[function(require,module,exports) {
|
2 |
+
function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}(function(){jQuery(function(t){"use strict";return window.SV_WC_Payment_Methods_Handler_v5_10_5=function(){function i(n){var o=this;e(this,i),this.replace_method_column=this.replace_method_column.bind(this),this.remove_duplicate_default_marks=this.remove_duplicate_default_marks.bind(this),this.edit_method=this.edit_method.bind(this),this.save_method=this.save_method.bind(this),this.cancel_edit=this.cancel_edit.bind(this),this.id=n.id,this.slug=n.slug,this.i18n=n.i18n,this.ajax_url=n.ajax_url,this.ajax_nonce=n.ajax_nonce,this.replace_method_column(),this.remove_duplicate_default_marks(),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.edit",function(e){return o.edit_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.save",function(e){return o.save_method(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .cancel-edit",function(e){return o.cancel_edit(e)}),t(".woocommerce-MyAccount-paymentMethods").on("click",".woocommerce-PaymentMethod--actions .button.delete",function(e){if(0!==t(e.currentTarget).parents("tr").find("input[name=plugin-id][value=".concat(o.slug,"]")).length)return t(e.currentTarget).hasClass("disabled")||!confirm(o.i18n.delete_ays)?e.preventDefault():void 0}),t('.button[href*="add-payment-method"]').click(function(e){if(t(this).hasClass("disabled"))return e.preventDefault()})}return n(i,[{key:"replace_method_column",value:function(){var e=this;return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(n,i){var o;if(0!==t(i).find("input[name=plugin-id][value=".concat(e.slug,"]")).length)return t(i).find("th.woocommerce-PaymentMethod--title").remove(),(o=t(i).find("td.woocommerce-PaymentMethod--title")).children().length>0&&t(i).find("td.woocommerce-PaymentMethod--method").html(o.html()),t(i).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(e,n){return t(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").hide(),i.find("div.edit").show(),i.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(e){var n,i,o,a=this;if(e.preventDefault(),n=t(e.currentTarget),0!==(o=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),o.next(".error").remove(),i={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:o.find("input[name=token-id]").val(),data:o.find("input[name]").serialize()},t.post(this.ajax_url,i).done(function(e){return e.success?(null!=e.data.title&&o.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.nonce&&(a.ajax_nonce=e.data.nonce),n.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(a.i18n.edit_button).addClass("button"),a.disable_editing_ui()):a.display_error(o,e.data)}).fail(function(e,t,n){return a.display_error(o,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").show(),i.find("div.edit").hide(),i.removeClass("editing"),n.removeClass("cancel-edit").addClass("edit").text(this.i18n.edit_button).addClass("button"),this.disable_editing_ui()}},{key:"enable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").addClass("editing"),t('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),t('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),o||(o=this.i18n.save_error),i=t(".woocommerce-MyAccount-paymentMethods thead tr th").length,t('<tr class="error"><td colspan="'+i+'">'+o+"</td></tr>").insertAfter(e).find("td").delay(8e3).slideUp(200)}}]),i}(),t(document.body).trigger("sv_wc_payment_methods_handler_v5_10_5_loaded")})}).call(this);
|
3 |
+
},{}]},{},["nDDW"], null)
|
4 |
+
//# sourceMappingURL=../frontend/sv-wc-payment-gateway-my-payment-methods.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"names":[],"mappings":";AAOG,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WACH,OAAO,SAAE,GAAF,aAsQN,OAhQM,OAAO,sCAAP,WAaU,SAAA,EAAA,GAAF,IAAA,EAAA,KAAA,EAAA,KAAA,GA8Cb,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,+BAAA,KAAA,+BAAA,KAAA,MAYA,KAAA,YAAA,KAAA,YAAA,KAAA,MA0BA,KAAA,YAAA,KAAA,YAAA,KAAA,MAqDA,KAAA,YAAA,KAAA,YAAA,KAAA,MAnKE,KAAA,GAAa,EAAK,GAClB,KAAA,KAAa,EAAK,KAClB,KAAA,KAAa,EAAK,KAClB,KAAA,SAAa,EAAK,SAClB,KAAA,WAAa,EAAK,WAGd,KAAA,wBAGA,KAAA,iCAGL,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,SAAE,GAAW,OAAA,EAAK,YAAa,KAG7I,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,SAAE,GAAW,OAAA,EAAK,YAAa,KAG7I,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,SAAE,GAAW,OAAA,EAAK,YAAa,KAG7I,EAAG,yCAA0C,GAAI,QAAS,qDAAsD,SAAE,GAM9G,GAA8D,IAJxD,EAAG,EAAM,eACF,QAAS,MAGlB,KAAqC,+BAAA,OAAA,EAAC,KAAU,MAAA,OAGpD,OAAA,EAAG,EAAM,eAAgB,SAAU,cAAoB,QAAS,EAAC,KAAK,YACxE,EAAM,sBADJ,IAMJ,EAAG,uCAAwC,MAAM,SAAE,GACxB,GAAA,EAAG,MAAO,SAAU,YAA9C,OAAA,EAAM,mBArDH,OAAA,EAAA,EAAA,CAAA,CAAA,IAAA,wBA2DkB,MAAA,WAAA,IAAA,EAAA,KAEtB,OAAA,EAAG,yCAA0C,KAAM,MAAO,KAAK,SAAE,EAAO,GAE3E,IAAA,EACO,GAAuE,IAAvE,EAAG,GAAU,KAAqC,+BAAA,OAAA,EAAC,KAAU,MAAA,OAehE,OAXA,EAAG,GAAU,KAAM,uCAAwC,UAE3D,EAAc,EAAG,GAAU,KAAM,wCAGhB,WAAW,OAAS,GAGpC,EAAG,GAAU,KAAM,wCAAyC,KAAM,EAAY,QAG/E,EAAG,GAAU,KAAM,uCAAwC,aA/ExD,CAAA,IAAA,iCAuF2B,MAAA,WAE/B,OAAA,EAAG,yCAA0C,KAAM,MAAO,KAAK,SAAE,EAAO,GAEvE,OAAA,EAAG,GAAU,KAAM,yCAA0C,KAAM,kCAAmC,aA3FnG,CAAA,IAAA,cAmGU,MAAA,SAAA,GAEjB,IAAA,EAAA,EAMM,GANH,EAAM,iBAM2D,KAHjE,GADA,EAAS,EAAG,EAAM,gBACF,QAAS,OAGlB,KAAqC,+BAAA,OAAA,KAAC,KAAU,MAAA,OAUvD,OAPA,EAAI,KAAM,YAAa,OACvB,EAAI,KAAM,YAAa,OACvB,EAAI,SAAU,WAGd,EAAO,KAAM,KAAC,KAAK,eAAgB,YAAa,QAAS,SAAU,eAAgB,YAAa,UAEhG,KAAK,sBArHD,CAAA,IAAA,cA6HU,MAAA,SAAA,GAAF,IAEf,EAAA,EAAA,EAFe,EAAA,KAQT,GANH,EAAM,iBAEN,EAAS,EAAG,EAAM,eAI+C,KAHjE,EAAS,EAAO,QAAS,OAGlB,KAAqC,+BAAA,OAAA,KAAC,KAAU,MAAA,OAcvD,OAXK,KAAA,WAGL,EAAI,KAAM,UAAW,SAErB,EACC,CAAA,OAAgB,MAAA,OAAA,KAAC,GAAjB,wBACA,MAAU,KAAC,WACX,SAAU,EAAI,KAAM,wBAAyB,MAC7C,KAAU,EAAI,KAAM,eAAgB,aAErC,EAAE,KAAM,KAAC,SAAU,GAEjB,KAAK,SAAE,GAEP,OAAuD,EAAS,SAE7D,MAAA,EAAA,KAAA,OACF,EAAI,KAAK,sCAAsC,KAAM,EAAS,KAAK,OAEjE,MAAA,EAAA,KAAA,QACF,EAAC,WAAa,EAAS,KAAK,OAG7B,EAAO,SAAU,gBAAiB,YAAa,eAAgB,SAAU,QAAS,KAAM,EAAC,KAAK,aAAc,SAAU,UAEtH,EAAK,sBAXE,EAAK,cAAe,EAAK,EAAS,QAazC,KAAK,SAAE,EAAO,EAAY,GAE1B,OAAA,EAAK,cAAe,EAAK,KAEzB,OAAO,WAEP,OAAA,EAAK,iBA1KH,CAAA,IAAA,cAkLU,MAAA,SAAA,GAEjB,IAAA,EAAA,EAMM,GANH,EAAM,iBAM2D,KAHjE,GADA,EAAS,EAAG,EAAM,gBACF,QAAS,OAGlB,KAAqC,+BAAA,OAAA,KAAC,KAAU,MAAA,OAUvD,OAPA,EAAI,KAAM,YAAa,OACvB,EAAI,KAAM,YAAa,OACvB,EAAI,YAAa,WAGjB,EAAO,YAAa,eAAgB,SAAU,QAAS,KAAM,KAAC,KAAK,aAAc,SAAU,UAE3F,KAAK,uBApMD,CAAA,IAAA,oBA6Mc,MAAA,WAMlB,OAHA,EAAG,yCAA0C,SAAU,WAGvD,EAAG,uCAAwC,SAAU,cAnNjD,CAAA,IAAA,qBAyNe,MAAA,WAMnB,OAHA,EAAG,yCAA0C,YAAa,WAG1D,EAAG,uCAAwC,YAAa,cA/NpD,CAAA,IAAA,WAqOK,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QArOpI,CAAA,IAAA,aA2OO,MAAA,WAAG,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,YA3OvE,CAAA,IAAA,gBAqPY,MAAA,SAAA,EAAK,GAAO,IAE/B,EAF+B,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAOtC,OALA,QAAQ,MAAO,GAEmB,IAAlC,EAAU,KAAC,KAAK,YAChB,EAAU,EAAG,qDAAsD,OAEnE,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,YAAa,GAAM,KAAM,MAAO,MAAO,KAAO,QAAS,SA5PpI,EAAA,GAgQN,EAAG,SAAS,MAAO,QAAS,oDAvQ1B,KAAA","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\t# The My Payment Methods handler.\n\t#\n\t# @since 5.1.0\n\tclass window.SV_WC_Payment_Methods_Handler_v5_10_5\n\n\n\t\t# Constructs the class.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] args, with the properties:\n\t\t# id: [String] plugin ID\n\t\t# slug: [String] plugin slug or dasherized ID\n\t\t# i18n: [Object] localized text strings\n\t\t# ajax_url: [String] URL for AJAX requests\n\t\t# ajax_nonce: [String] nonce for AJAX requests\n\t\tconstructor: ( args ) ->\n\n\t\t\t@id = args.id\n\t\t\t@slug = args.slug\n\t\t\t@i18n = args.i18n\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@ajax_nonce = args.ajax_nonce\n\n\t\t\t# replace the \"Method\" column content for FW tokens\n\t\t\tthis.replace_method_column()\n\n\t\t\t# remove duplicate \"Default\" marks\n\t\t\tthis.remove_duplicate_default_marks()\n\n\t\t\t# handle the edit action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.edit\", ( event ) => this.edit_method( event ) )\n\n\t\t\t# handle the save action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.save\", ( event ) => this.save_method( event ) )\n\n\t\t\t# handle the cancel action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .cancel-edit\", ( event ) => this.cancel_edit( event ) )\n\n\t\t\t# handle the delete action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.delete\", ( event ) =>\n\n\t\t\t\tbutton = $( event.currentTarget )\n\t\t\t\trow = button.parents( 'tr' )\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\tif $( event.currentTarget ).hasClass( 'disabled' ) or not confirm( @i18n.delete_ays )\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t)\n\n\t\t\t# don't follow the Add Payment Method button URL if it's disabled\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).click ( event ) ->\n\t\t\t\tevent.preventDefault() if $( this ).hasClass( 'disabled' )\n\n\n\t\t# Replace Method column content with Title column content, for FW tokens.\n\t\t#\n\t\t# @since 5.8.0\n\t\treplace_method_column: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif $( element ).find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\t# delete the Title header\n\t\t\t\t$( element ).find( 'th.woocommerce-PaymentMethod--title' ).remove()\n\n\t\t\t\ttitleColumn = $( element ).find( 'td.woocommerce-PaymentMethod--title' )\n\n\t\t\t\t# Title column is not empty, this is a FW token\n\t\t\t\tif ( titleColumn.children().length > 0 )\n\n\t\t\t\t\t# replace Method column\n\t\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--method' ).html( titleColumn.html() )\n\n\t\t\t\t# delete Title column\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--title' ).remove()\n\n\n\t\t# Removes duplicate \"Default\" marks.\n\t\t#\n\t\t# They are already hidden using CSS, but should also be removed for accessibility.\n\t\t#\n\t\t# @since 5.8.0\n\t\tremove_duplicate_default_marks: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--default' ).find( 'mark.default:not(:first-child)' ).remove()\n\n\n\t\t# Edits a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tedit_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).hide()\n\t\t\trow.find( 'div.edit' ).show()\n\t\t\trow.addClass( 'editing' )\n\n\t\t\t# change the Edit button to \"Cancel\"\n\t\t\tbutton.text( @i18n.cancel_button ).removeClass( 'edit' ).addClass( 'cancel-edit' ).removeClass( 'button' )\n\n\t\t\tthis.enable_editing_ui()\n\n\n\t\t# Saves a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tsave_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\tthis.block_ui()\n\n\t\t\t# remove any previous errors\n\t\t\trow.next( '.error' ).remove()\n\n\t\t\tdata =\n\t\t\t\taction: \"wc_#{@id}_save_payment_method\"\n\t\t\t\tnonce: @ajax_nonce\n\t\t\t\ttoken_id: row.find( 'input[name=token-id]' ).val()\n\t\t\t\tdata: row.find( 'input[name]' ).serialize()\n\n\t\t\t$.post( @ajax_url, data )\n\n\t\t\t\t.done ( response ) =>\n\n\t\t\t\t\treturn this.display_error( row, response.data ) unless response.success\n\n\t\t\t\t\tif response.data.title?\n\t\t\t\t\t\trow.find('.woocommerce-PaymentMethod--method').html( response.data.title )\n\n\t\t\t\t\tif response.data.nonce?\n\t\t\t\t\t\t@ajax_nonce = response.data.nonce\n\n\t\t\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\t\t\tbutton.siblings( '.cancel-edit' ).removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\t\t\tthis.disable_editing_ui()\n\n\t\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\t\tthis.display_error( row, error )\n\n\t\t\t\t.always =>\n\n\t\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Cancels/stop editing a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tcancel_edit: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).show()\n\t\t\trow.find( 'div.edit' ).hide()\n\t\t\trow.removeClass( 'editing' )\n\n\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\tbutton.removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\tthis.disable_editing_ui()\n\n\n\t\t# Sets the page UI to the \"editing\" state.\n\t\t#\n\t\t# This brings proper focus to the method being edited and prevents\n\t\t# other available buttons/actions until the editing is finished or cancelled.\n\t\t#\n\t\t# @since 5.1.1\n\t\tenable_editing_ui: ->\n\n\t\t\t# set the methods table as 'editing'\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).addClass( 'editing' )\n\n\t\t\t# disable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).addClass( 'disabled' )\n\n\n\t\t# Sets the page UI back to the default state.\n\t\t#\n\t\t# @since 5.1.1\n\t\tdisable_editing_ui: ->\n\n\t\t\t# removes the methods table's \"editing\" status\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).removeClass( 'editing' )\n\n\t\t\t# re-enable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).removeClass( 'disabled' )\n\n\n\t\t# Blocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tunblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).unblock()\n\n\n\t\t# Displays an error message to the user.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] row payment method table row\n\t\t# @param [String] error raw error message\n\t\t# @param [String] message user error message\n\t\tdisplay_error: ( row, error, message = '' ) ->\n\n\t\t\tconsole.error( error )\n\n\t\t\tmessage = @i18n.save_error unless message\n\t\t\tcolumns = $( \".woocommerce-MyAccount-paymentMethods thead tr th\" ).length\n\n\t\t\t$( '<tr class=\"error\"><td colspan=\"' + columns + '\">' + message + '</td></tr>' ).insertAfter( row ).find( 'td' ).delay( 8000 ).slideUp( 200 )\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_10_5_loaded' )\n"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"JA8d":[function(require,module,exports) {
|
2 |
+
function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}(function(){var t=[].indexOf;jQuery(function(n){"use strict";return window.SV_WC_Payment_Form_Handler_v5_10_5=function(){function r(t){var a=this;if(e(this,r),this.id=t.id,this.id_dasherized=t.id_dasherized,this.plugin_id=t.plugin_id,this.type=t.type,this.csc_required=t.csc_required,this.csc_required_for_tokens=t.csc_required_for_tokens,this.enabled_card_types=t.enabled_card_types,n("form.checkout").length)this.form=n("form.checkout"),this.handle_checkout_page();else if(n("form#order_review").length)this.form=n("form#order_review"),this.handle_pay_page();else{if(!n("form#add_payment_method").length)return void console.log("No payment form found!");this.form=n("form#add_payment_method"),this.handle_add_payment_method_page()}this.params=window.sv_wc_payment_gateway_payment_form_params,"echeck"===this.type&&this.form.on("click",".js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check",function(){return a.handle_sample_check_hint()}),n(document).trigger("sv_wc_payment_form_handler_init",{id:this.id,instance:this})}return a(r,[{key:"handle_checkout_page",value:function(){var e=this;return"credit-card"===this.type&&n(document.body).on("updated_checkout",function(){return e.format_credit_card_inputs()}),n(document.body).on("updated_checkout",function(){return e.set_payment_fields()}),n(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),this.form.on("checkout_place_order_".concat(this.id),function(){return e.validate_payment_data()})}},{key:"handle_pay_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.handle_saved_payment_methods(),this.form.submit(function(){if(n("#order_review input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.form.submit(function(){if(n("#add_payment_method input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"set_payment_fields",value:function(){return this.payment_fields=n(".payment_method_".concat(this.id)),this.payment_fields.find(".validate-required .input-text").each(function(e,t){return!n(t).val()&&n(t).trigger("input")})}},{key:"validate_payment_data",value:function(){var e,t;return!this.form.is(".processing")&&(this.saved_payment_method_selected=this.payment_fields.find(".js-sv-wc-payment-gateway-payment-token:checked").val(),t="credit-card"===this.type?this.validate_card_data():this.validate_account_data(),e=!1!==n(document.body).triggerHandler("sv_wc_payment_form_valid_payment_data",{payment_form:this,passed_validation:t}),t&&e)}},{key:"format_credit_card_inputs",value:function(){var e,t,a,r=this;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number").payment("formatCardNumber"),a=n(".js-sv-wc-payment-gateway-credit-card-form-expiry").payment("formatCardExpiry"),t=n(".js-sv-wc-payment-gateway-credit-card-form-csc").payment("formatCardCVC"),e.val()&&e.val().length>0&&e.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return r.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.push(this.params.cvv_missing))),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),r=n.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||(t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)return e.removeClass("form-row-first").addClass("form-row-last"),t.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_10_5_loaded")})}).call(this);
|
3 |
+
},{}]},{},["JA8d"], null)
|
4 |
+
//# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map
ADDED
@@ -0,0 +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,uGAAwG,WAAG,OAAA,EAAK,6BAEnI,EAAG,UAAW,QAAS,kCAAmC,CAAE,GAAI,KAAC,GAAI,SAAU,OA9C3E,OAAA,EAAA,EAAA,CAAA,CAAA,IAAA,uBAoDiB,MAAA,WAAA,IAAA,EAAA,KAcrB,MAX6F,gBAAT,KAAC,MAArF,EAAG,SAAS,MAAO,GAAI,mBAAoB,WAAG,OAAA,EAAK,8BAGnD,EAAG,SAAS,MAAO,GAAI,mBAAoB,WAAG,OAAA,EAAK,uBAKnD,EAAG,SAAS,MAAO,GAAI,mBAAoB,WAAG,OAAA,EAAK,iCAGnD,KAAC,KAAK,GAA6B,wBAAA,OAAA,KAAC,IAAO,WAAG,OAAA,EAAK,4BAlE/C,CAAA,IAAA,kBAwEY,MAAA,WAAA,IAAA,EAAA,KAYhB,OAVK,KAAA,qBAGO,gBAAT,KAAC,MACE,KAAA,4BAGD,KAAA,+BAGL,KAAC,KAAK,OAAO,WAG2B,GAAA,EAAG,oDAAqD,QAAS,EAAC,GAAlG,OAAA,EAAK,4BAvFT,CAAA,IAAA,iCA6F2B,MAAA,WAAA,IAAA,EAAA,KAS/B,OAPK,KAAA,qBAGO,gBAAT,KAAC,MACE,KAAA,4BAGN,KAAC,KAAK,OAAO,WAG2B,GAAA,EAAG,0DAA2D,QAAS,EAAC,GAAxG,OAAA,EAAK,4BAzGT,CAAA,IAAA,qBAmHe,MAAA,WAMnB,OAJC,KAAA,eAAiB,EAAuB,mBAAA,OAAA,KAAC,KAEvB,KAAC,eAAe,KAAM,kCAExB,KAAM,SAAE,EAAG,GAGxB,OAAA,EAAG,GAAQ,OAId,EAAG,GAAQ,QAAS,aAhIjB,CAAA,IAAA,wBAuIkB,MAAA,WAEzB,IAAA,EAAA,EACmB,OAAA,KAAC,KAAK,GAAI,iBAEzB,KAAA,8BAAgC,KAAC,eAAe,KAAM,mDAAoD,MAG3G,EAAoB,gBAAT,KAAC,KAA2B,KAAK,qBAA0B,KAAK,wBAG3E,GAA8I,IAApI,EAAG,SAAS,MAAO,eAAgB,wCAAyC,CAAE,aAAc,KAAM,kBAAmB,IAExH,GAAS,KApJZ,CAAA,IAAA,4BA0JsB,MAAA,WAAA,IAC7B,EAAA,EAAA,EAD6B,EAAA,KAW1B,OAVA,EAAe,EAAE,6DAA6D,QAAQ,oBACtF,EAAe,EAAE,qDAAqD,QAAQ,oBAC9E,EAAe,EAAE,kDAAkD,QAAQ,iBAGxC,EAAa,OAAS,EAAa,MAAM,OAAS,GAArF,EAAa,QAAS,UACQ,EAAQ,OAAS,EAAQ,MAAM,OAAS,GAAtE,EAAQ,QAAS,UACU,EAAK,OAAS,EAAK,MAAM,OAAS,GAA7D,EAAK,QAAS,UAGd,EAAG,oDAAqD,GAAI,qBAAsB,WAAG,OAAA,EAAK,uCArKtF,CAAA,IAAA,mCA2K6B,MAAA,WAEpC,IAAA,EAAA,EAAA,EAAA,EAgBM,OAhBH,EAAe,EAAG,6DAClB,EAAe,EAAG,qDAClB,EAAe,EAAG,kDAElB,EAAa,EAAE,QAAQ,SAAU,EAAa,OAE9C,EAAA,KAAqB,KAAC,mBAAnB,GAAA,EACF,EAAa,SAAU,qBAEvB,EAAa,YAAa,qBAExB,EAAE,QAAQ,mBAAoB,EAAQ,QAAS,kBACjD,EAAQ,SAAU,cAElB,EAAQ,YAAa,cAEnB,EAAE,QAAQ,gBAAiB,EAAK,OAClC,EAAK,SAAU,cAEf,EAAK,YAAa,gBAhMf,CAAA,IAAA,qBAsMe,MAAA,WAEtB,IAAA,EAAA,EAAA,EAAA,EAkCM,OAlCH,EAAS,GAKN,OAHH,EAAM,KAAC,eAAe,KAAM,kDAAmD,SAK3E,GAC2C,KAAK,KAAM,IAAxD,EAAO,KAAM,KAAC,OAAO,qBACwB,EAAI,OAAS,GAAK,EAAI,OAAS,IAA5E,EAAO,KAAM,KAAC,OAAO,qBACd,KAAC,eACD,KAAC,gCAAiC,KAAC,yBACzC,EAAO,KAAM,KAAC,OAAO,eAGjB,KAAC,gCAEP,EAAiB,KAAC,eAAe,KAAM,6DAA8D,MACrG,EAAiB,EAAE,QAAQ,cAAe,KAAC,eAAe,KAAM,qDAAsD,QAGtH,EAAiB,EAAe,QAAS,QAAS,OAMI,EAAe,OAAS,IAAM,EAAe,OAAS,KAA3G,EAAO,KAAM,KAAC,OAAO,4BACgC,KAAK,KAAM,IAAhE,EAAO,KAAM,KAAC,OAAO,4BAC6B,EAAE,QAAQ,mBAAoB,IAAhF,EAAO,KAAM,KAAC,OAAO,sBAJrB,EAAO,KAAM,KAAC,OAAO,qBAO8B,EAAE,QAAQ,mBAAoB,IAAlF,EAAO,KAAM,KAAC,OAAO,wBAEnB,EAAO,OAAS,GACb,KAAA,cAAe,IACb,IAGN,KAAA,eAAe,KAAM,6DAA8D,IAAK,IAClF,KAhPJ,CAAA,IAAA,wBAsPkB,MAAA,WAEzB,IAAA,EAAA,EAAA,EAAkB,QAAA,KAAC,gCAEhB,EAAS,GAET,EAAiB,KAAC,eAAe,KAAK,wDAAwD,MAC9F,EAAiB,KAAC,eAAe,KAAK,wDAAwD,MAGvF,GAGkD,IAAK,EAAe,QAA5E,EAAO,KAAM,KAAC,OAAO,+BACmC,KAAK,KAAM,IAAnE,EAAO,KAAM,KAAC,OAAO,gCAHrB,EAAO,KAAM,KAAC,OAAO,wBAMf,IAGkD,EAAe,OAAS,GAAK,EAAe,OAAS,KAA7G,EAAO,KAAM,KAAC,OAAO,+BAC4B,KAAK,KAAM,IAA5D,EAAO,KAAM,KAAC,OAAO,yBAHrB,EAAO,KAAM,KAAC,OAAO,wBAKnB,EAAO,OAAS,GACb,KAAA,cAAe,IACb,IAGN,KAAA,eAAe,KAAM,wDAAyD,IAAK,IAC7E,MAnRJ,CAAA,IAAA,gBAyRW,MAAA,SAAA,GAaf,OAVA,EAAG,4CAA6C,SAG/C,KAAA,KAAK,QAAQ,qCAAuC,EAAO,KAAM,aAAgB,cAGjF,KAAA,KAAK,YAAa,cAAe,UACjC,KAAA,KAAK,KAAM,uBAAwB,OAGpC,EAAG,cAAe,QAAS,CAAE,UAAW,KAAC,KAAK,SAAS,IAAM,KAAO,OAtShE,CAAA,IAAA,+BA4SyB,MAAA,WAEhC,IAAA,EAAA,EAAA,EAAA,EA8CG,GA7CA,EAAgB,KAAC,cAEU,KAAC,aAC5B,EAA2B,KAAC,wBAE5B,EAAgC,EAAiB,aAAA,OAAA,EAAjD,6BACA,EAAa,EAA8B,KAAM,kDAAmD,QAAS,aAG7G,EAAmB,eAAA,OAAA,KAAC,cAApB,mBAAqD,OAAO,WAIxD,GAFiC,EAAmB,eAAA,OAAA,EAAnB,2BAA4D,OAQ5F,GAHH,EAA8B,QAAS,KAGpC,EAEF,OADA,EAAW,YAAa,iBAAkB,SAAU,kBACpD,EAA8B,MAAO,QAOnC,GAHH,EAA8B,UAAW,KAGtC,EAEF,OADA,EAAW,YAAa,kBAAmB,SAAU,iBACrD,EAA8B,KAAM,qDAAsD,QAAS,aAAc,MAAO,KAC1H,SAID,EAAG,uBAAwB,OAAO,WACrC,IAAA,EAEO,OAFH,EAAc,EAAmB,eAAA,OAAA,EAAnB,6BAA8D,QAAS,cAElF,EAAG,MAAO,GAAI,aAChB,EAAY,YACZ,EAAY,OAAO,SAEnB,EAAY,OACZ,EAAY,OAAO,WAEsB,EAAG,uBAAwB,GAAI,YAA1E,OAAA,EAAG,uBAAwB,WA5VvB,CAAA,IAAA,2BAkWqB,MAAA,WAE5B,IAAA,EAEM,OAFH,EAAgB,KAAC,eAAe,KAAM,uDAErB,GAAI,YAAkB,EAAc,UAAe,EAAc,cAtW9E,CAAA,IAAA,WA6WK,MAAA,WAAG,OAAA,KAAC,KAAK,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,QA7W5E,CAAA,IAAA,aAmXO,MAAA,WAAG,OAAA,KAAC,KAAK,cAnXhB,EAAA,GAuXN,EAAG,SAAS,MAAO,QAAS,iDA5X1B,KAAA","file":"sv-wc-payment-gateway-payment-form.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0-beta\n\n Copyright (c) 2014-2020, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\n\tclass window.SV_WC_Payment_Form_Handler_v5_10_5\n\n\n\t\t# Public: Instantiate Payment Form Handler\n\t\t#\n\t\t# args - object with properties:\n\t\t# id - gateway ID\n\t\t# id_dasherized - gateway ID dasherized\n\t\t# plugin_id - plugin ID\n\t\t# type - gateway type, either `credit-card` or `echeck`\n\t\t# csc_required - true if the gateway requires the CSC field to be displayed\n\t\t#\n\t\t# Returns SV_WC_Payment_Form_Handler_v5_10_5 instance\n\t\tconstructor: (args) ->\n\n\t\t\t@id = args.id\n\t\t\t@id_dasherized = args.id_dasherized\n\t\t\t@plugin_id = args.plugin_id\n\t\t\t@type = args.type\n\t\t\t@csc_required = args.csc_required\n\t\t\t@csc_required_for_tokens = args.csc_required_for_tokens\n\t\t\t@enabled_card_types = args.enabled_card_types\n\n\t\t\t# which payment form?\n\t\t\tif $( 'form.checkout' ).length\n\t\t\t\t@form = $( 'form.checkout' )\n\t\t\t\tthis.handle_checkout_page()\n\n\t\t\telse if $( 'form#order_review' ).length\n\t\t\t\t@form = $( 'form#order_review' )\n\t\t\t\tthis.handle_pay_page()\n\n\t\t\telse if $( 'form#add_payment_method' ).length\n\t\t\t\t@form = $( 'form#add_payment_method' )\n\t\t\t\tthis.handle_add_payment_method_page()\n\n\t\t\telse\n\t\t\t\tconsole.log( 'No payment form found!' )\n\t\t\t\treturn\n\n\t\t\t# localized error messages\n\t\t\t@params = window[ \"sv_wc_payment_gateway_payment_form_params\" ]\n\n\t\t\t# handle sample check image hint\n\t\t\t@form.on( 'click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', => this.handle_sample_check_hint() ) if @type is 'echeck'\n\n\t\t\t$( document ).trigger( 'sv_wc_payment_form_handler_init', { id: @id, instance: @ } )\n\n\n\t\t# Public: Handle required actions on the checkout page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_checkout_page: ->\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\t$( document.body ).on( 'updated_checkout', => this.format_credit_card_inputs() ) if @type is 'credit-card'\n\n\t\t\t# updated payment fields jQuery object on each checkout update (prevents stale data)\n\t\t\t$( document.body ).on( 'updated_checkout', => this.set_payment_fields() )\n\n\t\t\t# handle saved payment methods\n\t\t\t# note on the checkout page, this is bound to `updated_checkout` so it\n\t\t\t# fires even when other parts of the checkout are changed\n\t\t\t$( document.body ).on( 'updated_checkout', => this.handle_saved_payment_methods() )\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.on( \"checkout_place_order_#{ @id }\", => this.validate_payment_data() )\n\n\n\t\t# Public: Handle required actions on the Order > Pay page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_pay_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# handle saved payment methods\n\t\t\tthis.handle_saved_payment_methods()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#order_review input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Handle required actions on the Add Payment Method page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_add_payment_method_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#add_payment_method input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Set payment fields class variable, this is done\n\t\t# during the updated_checkout event as otherwise the reference to\n\t\t# the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n\t\t#\n\t\t# This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n\t\t#\n\t\t# Returns nothing.\n\t\tset_payment_fields: ->\n\n\t\t\t@payment_fields = $( \".payment_method_#{ @id }\" )\n\n\t\t\t$required_fields = @payment_fields.find( '.validate-required .input-text' )\n\n\t\t\t$required_fields.each( ( i, input ) =>\n\n\t\t\t\t# if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n\t\t\t\tif $( input ).val()\n\t\t\t\t\treturn false\n\n\t\t\t\t# otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n\t\t\t\t$( input ).trigger( 'input' )\n\t\t\t)\n\n\n\t\t# Public: Validate Payment data when order is placed\n\t\t#\n\t\t# Returns boolean, true if payment data is valid, false otherwise\n\t\tvalidate_payment_data: ->\n\n\t\t\t# bail when already processing\n\t\t\treturn false if @form.is( '.processing' )\n\n\t\t\t@saved_payment_method_selected = @payment_fields.find( '.js-sv-wc-payment-gateway-payment-token:checked' ).val()\n\n\t\t\t# perform internal validations (all fields present & valid, etc)\n\t\t\tvalid = if @type is 'credit-card' then this.validate_card_data() else this.validate_account_data()\n\n\t\t\t# let gateways perform their own validation prior to form submission\n\t\t\thandler = $( document.body ).triggerHandler( 'sv_wc_payment_form_valid_payment_data', { payment_form: this, passed_validation: valid } ) isnt false\n\n\t\t\treturn valid && handler\n\n\n\t\t# Public: format card data using jQuery.Payment\n\t\t#\n\t\t# Returns nothing.\n\t\tformat_credit_card_inputs: ->\n\t\t\t$card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n\t\t\t$expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n\t\t\t$csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n\n\t\t\t# trigger a 'change' event for non empty fields only\n\t\t\t$card_number.trigger( 'change') if $card_number.val() && $card_number.val().length > 0\n\t\t\t$expiry.trigger( 'change') if $expiry.val() && $expiry.val().length > 0\n\t\t\t$csc.trigger( 'change') if $csc.val() && $csc.val().length > 0\n\n\t\t\t# perform inline validation on credit card inputs\n\t\t\t$( '.js-sv-wc-payment-gateway-credit-card-form-input' ).on( 'change paste keyup', => this.do_inline_credit_card_validation() )\n\n\n\t\t# Public: perform inline validation on credit card fields\n\t\t#\n\t\t# Returns nothing.\n\t\tdo_inline_credit_card_validation: ->\n\n\t\t\t$card_number = $( '.js-sv-wc-payment-gateway-credit-card-form-account-number' )\n\t\t\t$expiry = $( '.js-sv-wc-payment-gateway-credit-card-form-expiry' )\n\t\t\t$csc = $( '.js-sv-wc-payment-gateway-credit-card-form-csc' )\n\n\t\t\t$card_type = $.payment.cardType( $card_number.val() )\n\n\t\t\tif $card_type not in @enabled_card_types\n\t\t\t\t$card_number.addClass( 'invalid-card-type' )\n\t\t\telse\n\t\t\t\t$card_number.removeClass( 'invalid-card-type' )\n\n\t\t\tif $.payment.validateCardExpiry( $expiry.payment( 'cardExpiryVal' ) )\n\t\t\t\t$expiry.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$expiry.removeClass( 'identified' )\n\n\t\t\tif $.payment.validateCardCVC( $csc.val() )\n\t\t\t\t$csc.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$csc.removeClass( 'identified' )\n\n\n\t\t# Public: Perform validation on the credit card info entered\n\t\t#\n\t\t# Return boolean, true if credit card info is valid, false otherwise\n\t\tvalidate_card_data: ->\n\n\t\t\terrors = []\n\n\t\t\tcsc = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).val()\n\n\t\t\t# always validate the CSC if present\n\t\t\tif csc?\n\n\t\t\t\tif csc\n\t\t\t\t\terrors.push( @params.cvv_digits_invalid ) if /\\D/.test( csc )\n\t\t\t\t\terrors.push( @params.cvv_length_invalid ) if csc.length < 3 || csc.length > 4\n\t\t\t\telse if @csc_required\n\t\t\t\t\tif not @saved_payment_method_selected or @csc_required_for_tokens\n\t\t\t\t\t\terrors.push( @params.cvv_missing )\n\n\t\t\t# Only validate the other CC fields if necessary\n\t\t\tif not @saved_payment_method_selected\n\n\t\t\t\taccount_number = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val()\n\t\t\t\texpiry = $.payment.cardExpiryVal( @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).val() )\n\n\t\t\t\t# replace any dashes or spaces in the card number\n\t\t\t\taccount_number = account_number.replace( /-|\\s/g, '' )\n\n\t\t\t\t# validate card number\n\t\t\t\tif not account_number\n\t\t\t\t\terrors.push( @params.card_number_missing )\n\t\t\t\telse\n\t\t\t\t\terrors.push( @params.card_number_length_invalid ) if account_number.length < 12 || account_number.length > 19\n\t\t\t\t\terrors.push( @params.card_number_digits_invalid ) if /\\D/.test( account_number )\n\t\t\t\t\terrors.push( @params.card_number_invalid ) unless $.payment.validateCardNumber( account_number ) # performs luhn check\n\n\t\t\t\t# validate expiration date\n\t\t\t\terrors.push( @params.card_exp_date_invalid ) unless $.payment.validateCardExpiry( expiry ) # validates future date\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Perform validation on the eCheck info entered\n\t\t#\n\t\t# Return boolean, true if eCheck info is valid, false otherwise\n\t\tvalidate_account_data: ->\n\n\t\t\treturn true if @saved_payment_method_selected\n\n\t\t\terrors = []\n\n\t\t\trouting_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val()\n\t\t\taccount_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val()\n\n\t\t\t# validate routing number\n\t\t\tif not routing_number\n\t\t\t\terrors.push( @params.routing_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.routing_number_length_invalid ) if 9 != routing_number.length\n\t\t\t\terrors.push( @params.routing_number_digits_invalid ) if /\\D/.test( routing_number )\n\n\t\t\t# validate account number\n\t\t\tif not account_number\n\t\t\t\terrors.push( @params.account_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.account_number_length_invalid ) if account_number.length < 3 || account_number.length > 17\n\t\t\t\terrors.push( @params.account_number_invalid ) if /\\D/.test( account_number )\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Render any new errors and bring them into the viewport\n\t\t#\n\t\t# Returns nothing.\n\t\trender_errors: (errors) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@form.prepend '<ul class=\"woocommerce-error\"><li>' + errors.join( '</li><li>' ) + '</li></ul>'\n\n\t\t\t# unblock UI\n\t\t\t@form.removeClass( 'processing' ).unblock()\n\t\t\t@form.find( '.input-text, select' ).blur()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @form.offset().top - 100 }, 1000 )\n\n\n\t\t# Public: Handle associated actions for saved payment methods\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_saved_payment_methods: ->\n\n\t\t\t# make available inside change events\n\t\t\tid_dasherized = @id_dasherized\n\n\t\t\tcsc_required = @csc_required\n\t\t\tcsc_required_for_tokens = @csc_required_for_tokens\n\n\t\t\t$new_payment_method_selection = $( \"div.js-wc-#{ id_dasherized }-new-payment-method-form\" )\n\t\t\t$csc_field = $new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).closest( '.form-row' )\n\n\t\t\t# show/hide the saved payment methods when a saved payment method is de-selected/selected\n\t\t\t$( \"input.js-wc-#{ @id_dasherized }-payment-token\" ).change ->\n\n\t\t\t\ttokenized_payment_method_selected = $( \"input.js-wc-#{ id_dasherized }-payment-token:checked\" ).val()\n\n\t\t\t\tif tokenized_payment_method_selected\n\n\t\t\t\t\t# using an existing tokenized payment method, hide the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideUp( 200 )\n\n\t\t\t\t\t# move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-last' ).addClass( 'form-row-first' )\n\t\t\t\t\t\t$new_payment_method_selection.after( $csc_field )\n\n\t\t\t\telse\n\t\t\t\t\t# use new payment method, display the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideDown( 200 )\n\n\t\t\t\t\t# move the CSC field back into its regular spot\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-first' ).addClass( 'form-row-last' )\n\t\t\t\t\t\t$new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).closest( '.form-row' ).after( $csc_field )\n\t\t\t.change()\n\n\t\t\t# display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n\t\t\t# but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n\t\t\t$( 'input#createaccount' ).change ->\n\t\t\t\t$parent_row = $( \"input.js-wc-#{ id_dasherized }-tokenize-payment-method\" ).closest( 'p.form-row' )\n\n\t\t\t\tif $( this ).is( ':checked' )\n\t\t\t\t\t$parent_row.slideDown()\n\t\t\t\t\t$parent_row.next().show()\n\t\t\t\telse\n\t\t\t\t\t$parent_row.hide()\n\t\t\t\t\t$parent_row.next().hide()\n\n\t\t\t$( 'input#createaccount' ).change() unless $( 'input#createaccount' ).is( ':checked' )\n\n\n\t\t# Public: Handle showing/hiding the sample check image\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_sample_check_hint: ->\n\n\t\t\t$sample_check = @payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-sample-check' )\n\n\t\t\tif $sample_check.is( \":visible\" ) then $sample_check.slideUp() else $sample_check.slideDown()\n\n\n\n\t\t# Blocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tblock_ui: -> @form.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tunblock_ui: -> @form.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( \"sv_wc_payment_form_handler_v5_10_5_loaded\" )\n"]}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-admin-order.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript Version 5.0.0 Copyright (c) 2017-2020, SkyVerge, Inc. Licensed under the GNU General Public License v3.0 http://www.gnu.org/licenses/gpl-3.0.html */(function() { jQuery(document).ready(function($) { "use strict"; var accounting, ref, ref1, ref2, ref3, submitCapture, sv_wc_payment_gateway_admin_order, woocommerce_admin, woocommerce_admin_meta_boxes; sv_wc_payment_gateway_admin_order = (ref = window.sv_wc_payment_gateway_admin_order) != null ? ref : {}; woocommerce_admin = (ref1 = window.woocommerce_admin) != null ? ref1 : {}; woocommerce_admin_meta_boxes = (ref2 = window.woocommerce_admin_meta_boxes) != null ? ref2 : {}; accounting = (ref3 = window.accounting) != null ? ref3 : {}; $('.sv-wc-payment-gateway-partial-capture').appendTo('#woocommerce-order-items .inside'); $('#woocommerce-order-items').on('click', '.sv-wc-payment-gateway-capture:not(.disabled)', function(e) { e.preventDefault(); if ($(this).hasClass('partial-capture')) { $('div.sv-wc-payment-gateway-partial-capture').slideDown(); $('div.wc-order-data-row-toggle').not('div.sv-wc-payment-gateway-partial-capture').slideUp(); return $('div.wc-order-totals-items').slideUp(); } else { return submitCapture(); } }); $('.sv-wc-payment-gateway-partial-capture').on('change keyup', '#capture_amount', function(e) { var total; total = accounting.unformat($(this).val(), woocommerce_admin.mon_decimal_point); if (total) { $('button.capture-action').removeAttr('disabled'); } else { $('button.capture-action').attr('disabled', 'disabled'); } return $('button .capture-amount .amount').text(accounting.formatMoney(total, { symbol: woocommerce_admin_meta_boxes.currency_format_symbol, decimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep, thousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep, precision: woocommerce_admin_meta_boxes.currency_format_num_decimals, format: woocommerce_admin_meta_boxes.currency_format })); }); $('.sv-wc-payment-gateway-partial-capture').on('click', '.capture-action', function(e) { var amount, comment; e.preventDefault(); amount = $('.sv-wc-payment-gateway-partial-capture #capture_amount').val(); comment = $('.sv-wc-payment-gateway-partial-capture #capture_comment').val(); return submitCapture(amount, comment); }); return submitCapture = function(amount, comment) { var data; if (amount == null) { amount = ''; } if (comment == null) { comment = ''; } if (confirm(sv_wc_payment_gateway_admin_order.capture_ays)) { $('#woocommerce-order-items').block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); data = { action: sv_wc_payment_gateway_admin_order.capture_action, nonce: sv_wc_payment_gateway_admin_order.capture_nonce, gateway_id: sv_wc_payment_gateway_admin_order.gateway_id, order_id: sv_wc_payment_gateway_admin_order.order_id, amount: amount, comment: comment }; return $.ajax({ url: sv_wc_payment_gateway_admin_order.ajax_url, data: data }).done(function(response) { if ((response.data != null) && (response.data.message != null)) { alert(response.data.message); } if (response.success) { return location.reload(); } }).fail(function() { return alert(sv_wc_payment_gateway_admin_order.capture_error); }).always(function() { return $('#woocommerce-order-items').unblock(); }); } }; });}).call(this);
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-token-editor.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* WooCommerce SkyVerge Payment Gateway Framework Token Editor CoffeeScript Version 4.3.0-beta Copyright (c) 2016, SkyVerge, Inc. Licensed under the GNU General Public License v3.0 http://www.gnu.org/licenses/gpl-3.0.html */(function() { jQuery(document).ready(function($) { "use strict"; var handleError, ref, wc_payment_gateway_token_editor; wc_payment_gateway_token_editor = (ref = window.wc_payment_gateway_token_editor) != null ? ref : {}; $('.sv_wc_payment_gateway_token_editor').each(function() { var tokens; tokens = $(this).find('tr.token'); if (tokens.length === 0) { return $(this).find('tr.no-tokens').show(); } else { return $(this).find('tr.no-tokens').hide(); } }); $('.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action="remove"]', function(e) { var data, editor, row; e.preventDefault(); if (!confirm(wc_payment_gateway_token_editor.actions.remove_token.ays)) { return; } editor = $(this).closest('table'); editor.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); editor.find('.error').remove(); row = $(this).closest('tr'); if (row.hasClass('new-token')) { return row.remove(); } data = { action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_remove_payment_token', user_id: $(this).data('user-id'), token_id: $(this).data('token-id'), security: wc_payment_gateway_token_editor.actions.remove_token.nonce }; return $.post(wc_payment_gateway_token_editor.ajax_url, data).done((function(_this) { return function(response) { if (!response.success) { return handleError(editor, response.data); } $(row).remove(); if (editor.find('tr.token').length === 0) { return editor.find('tr.no-tokens').show(); } }; })(this)).fail((function(_this) { return function(jqXHR, textStatus, error) { return handleError(editor, textStatus + ': ' + error); }; })(this)).always((function(_this) { return function() { return editor.unblock(); }; })(this)); }); $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action="add-new"]', function(e) { var body, count, data, editor; e.preventDefault(); editor = $(this).closest('table'); editor.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); body = editor.find('tbody.tokens'); count = body.find('tr.token').length; data = { action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_get_blank_payment_token', index: count + 1, security: wc_payment_gateway_token_editor.actions.add_token.nonce }; return $.post(wc_payment_gateway_token_editor.ajax_url, data, function(response) { if (response.success === true) { body.append(response.data); } editor.find('tr.no-tokens').hide(); return editor.unblock(); }); }); $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action="refresh"]', function(e) { var body, count, data, editor; e.preventDefault(); editor = $(this).closest('table'); editor.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); editor.find('.error').remove(); body = editor.find('tbody.tokens'); count = body.find('tr.token').length; data = { action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_refresh_payment_tokens', user_id: $(this).data('user-id'), security: wc_payment_gateway_token_editor.actions.refresh.nonce }; return $.post(wc_payment_gateway_token_editor.ajax_url, data).done((function(_this) { return function(response) { if (!response.success) { return handleError(editor, response.data); } if (response.data != null) { editor.find('tr.no-tokens').hide(); return body.html(response.data); } else { body.empty(); return editor.find('tr.no-tokens').show(); } }; })(this)).fail((function(_this) { return function(jqXHR, textStatus, error) { return handleError(editor, textStatus + ': ' + error); }; })(this)).always((function(_this) { return function() { return editor.unblock(); }; })(this)); }); $('table.sv_wc_payment_gateway_token_editor').on('click', '.sv-wc-payment-gateway-token-editor-action-button[data-action="save"]', function(e) { var actions_row, editor, focused, inputs; editor = $(this).closest('table'); actions_row = editor.find('tfoot th'); editor.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); actions_row.find('.error, .success').remove(); inputs = editor.find('tbody.tokens tr.token input[type="text"]'); focused = false; return inputs.each(function(index) { var pattern, required, value; $(this).removeClass('error'); value = $(this).val(); required = $(this).prop('required'); pattern = $(this).attr('pattern'); if (!(required || value)) { return; } if (!value.match(pattern) || (required && !value)) { e.preventDefault(); $(this).addClass('error'); if (!focused) { actions_row.prepend('<span class="error">' + wc_payment_gateway_token_editor.actions.save.error + '</span>'); $(this).focus(); focused = true; } return editor.unblock(); } }); }); return handleError = function(editor, error, message) { if (message == null) { message = ''; } console.error(error); if (!message) { message = wc_payment_gateway_token_editor.i18n.general_error; } return editor.find('th.actions').prepend('<span class="error">' + message + '</span>'); }; });}).call(this);
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* WooCommerce Apple Pay Handler Version 4.7.0 Copyright (c) 2016, SkyVerge, Inc. Licensed under the GNU General Public License v3.0 http://www.gnu.org/licenses/gpl-3.0.html */(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; jQuery(document).ready(function($) { "use strict"; window.SV_WC_Apple_Pay_Handler_v5_7_1 = (function() { function SV_WC_Apple_Pay_Handler_v5_7_1(args) { this.get_payment_request = bind(this.get_payment_request, this); this.reset_payment_request = bind(this.reset_payment_request, this); this.on_cancel_payment = bind(this.on_cancel_payment, this); this.process_authorization = bind(this.process_authorization, this); this.on_payment_authorized = bind(this.on_payment_authorized, this); this.on_shipping_method_selected = bind(this.on_shipping_method_selected, this); this.on_shipping_contact_selected = bind(this.on_shipping_contact_selected, this); this.on_payment_method_selected = bind(this.on_payment_method_selected, this); this.validate_merchant = bind(this.validate_merchant, this); this.on_validate_merchant = bind(this.on_validate_merchant, this); this.init_checkout_page = bind(this.init_checkout_page, this); this.init_cart_page = bind(this.init_cart_page, this); this.init_product_page = bind(this.init_product_page, this); this.gateway_id = args.gateway_id; this.gateway_slug = args.gateway_slug; this.merchant_id = args.merchant_id; this.ajax_url = args.ajax_url; this.validate_nonce = args.validate_nonce; this.recalculate_totals_nonce = args.recalculate_totals_nonce; this.process_nonce = args.process_nonce; this.payment_request = args.payment_request; this.generic_error = args.generic_error; this.buttons = '.sv-wc-apple-pay-button'; this.terms = '.sv-wc-apple-pay-terms'; } SV_WC_Apple_Pay_Handler_v5_7_1.prototype.is_available = function() { if (!window.ApplePaySession) { return false; } return ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then((function(_this) { return function(canMakePayments) { return canMakePayments; }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.init = function() { if (!this.is_available()) { return; } if ($('form.cart').length) { this.init_product_page(); } else if ($('form.woocommerce-cart-form').length) { this.init_cart_page(); } else if ($('form.woocommerce-checkout').length) { this.init_checkout_page(); } if (!this.ui_element) { return; } if (this.payment_request) { $(this.buttons).show(); $(this.terms).show(); } return $(document.body).on('click', '.sv-wc-apple-pay-button', (function(_this) { return function(e) { var error; e.preventDefault(); _this.block_ui(); try { _this.session = _this.get_new_session(_this.payment_request); _this.session.onvalidatemerchant = function(event) { return _this.on_validate_merchant(event); }; _this.session.onpaymentmethodselected = function(event) { return _this.on_payment_method_selected(event); }; _this.session.onshippingcontactselected = function(event) { return _this.on_shipping_contact_selected(event); }; _this.session.onshippingmethodselected = function(event) { return _this.on_shipping_method_selected(event); }; _this.session.onpaymentauthorized = function(event) { return _this.on_payment_authorized(event); }; _this.session.oncancel = function(event) { return _this.on_cancel_payment(event); }; return _this.session.begin(); } catch (_error) { error = _error; return _this.fail_payment(error); } }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.init_product_page = function() { return this.ui_element = $('form.cart'); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.init_cart_page = function() { this.ui_element = $('form.woocommerce-cart-form').parents('div.woocommerce'); return $(document.body).on('updated_cart_totals', (function(_this) { return function() { return _this.reset_payment_request(); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.init_checkout_page = function() { this.ui_element = $('form.woocommerce-checkout'); this.buttons = '.sv-wc-apply-pay-checkout'; return $(document.body).on('updated_checkout', (function(_this) { return function() { return _this.reset_payment_request(); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.get_new_session = function(payment_request) { return new ApplePaySession(this.get_sdk_version(), payment_request); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.get_sdk_version = function() { return 2; }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_validate_merchant = function(event) { return this.validate_merchant(event.validationURL).then((function(_this) { return function(merchant_session) { merchant_session = $.parseJSON(merchant_session); return _this.session.completeMerchantValidation(merchant_session); }; })(this), (function(_this) { return function(response) { _this.session.abort(); return _this.fail_payment('Merchant could no be validated. ' + response.message); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.validate_merchant = function(url) { return new Promise((function(_this) { return function(resolve, reject) { var data; data = { 'action': "wc_" + _this.gateway_id + "_apple_pay_validate_merchant", 'nonce': _this.validate_nonce, 'merchant_id': _this.merchant_id, 'url': url }; return $.post(_this.ajax_url, data, function(response) { if (response.success) { return resolve(response.data); } else { return reject(response.data); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_payment_method_selected = function(event) { return new Promise((function(_this) { return function(resolve, reject) { var data; data = { 'action': "wc_" + _this.gateway_id + "_apple_pay_recalculate_totals", 'nonce': _this.recalculate_totals_nonce }; return $.post(_this.ajax_url, data, function(response) { if (response.success) { data = response.data; return resolve(_this.session.completePaymentMethodSelection(data.total, data.line_items)); } else { console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message); return reject(_this.session.completePaymentMethodSelection(_this.payment_request.total, _this.payment_request.lineItems)); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_shipping_contact_selected = function(event) { return new Promise((function(_this) { return function(resolve, reject) { var data; data = { 'action': "wc_" + _this.gateway_id + "_apple_pay_recalculate_totals", 'nonce': _this.recalculate_totals_nonce, 'contact': event.shippingContact }; return $.post(_this.ajax_url, data, function(response) { if (response.success) { data = response.data; return resolve(_this.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items)); } else { console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message); return reject(_this.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE, [], _this.payment_request.total, _this.payment_request.lineItems)); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_shipping_method_selected = function(event) { return new Promise((function(_this) { return function(resolve, reject) { var data; data = { 'action': "wc_" + _this.gateway_id + "_apple_pay_recalculate_totals", 'nonce': _this.recalculate_totals_nonce, 'method': event.shippingMethod.identifier }; return $.post(_this.ajax_url, data, function(response) { if (response.success) { data = response.data; return resolve(_this.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS, data.total, data.line_items)); } else { console.error('[Apple Pay] Error selecting a shipping method. ' + response.data.message); return reject(_this.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE, _this.payment_request.total, _this.payment_request.lineItems)); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_payment_authorized = function(event) { return this.process_authorization(event.payment).then((function(_this) { return function(response) { _this.set_payment_status(true); return _this.complete_purchase(response); }; })(this), (function(_this) { return function(response) { _this.set_payment_status(false); return _this.fail_payment('Payment could no be processed. ' + response.message); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.process_authorization = function(payment) { return new Promise((function(_this) { return function(resolve, reject) { var data; data = { action: "wc_" + _this.gateway_id + "_apple_pay_process_payment", nonce: _this.process_nonce, payment: JSON.stringify(payment) }; return $.post(_this.ajax_url, data, function(response) { if (response.success) { return resolve(response.data); } else { return reject(response.data); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.on_cancel_payment = function(event) { return this.unblock_ui(); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.complete_purchase = function(response) { return window.location = response.redirect; }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.fail_payment = function(error) { console.error('[Apple Pay] ' + error); this.unblock_ui(); return this.render_errors([this.generic_error]); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.set_payment_status = function(success) { var status; if (success) { status = ApplePaySession.STATUS_SUCCESS; } else { status = ApplePaySession.STATUS_FAILURE; } return this.session.completePayment(status); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.reset_payment_request = function(data) { if (data == null) { data = {}; } this.block_ui(); return this.get_payment_request(data).then((function(_this) { return function(response) { $(_this.buttons).show(); $(_this.terms).show(); _this.payment_request = $.parseJSON(response); return _this.unblock_ui(); }; })(this), (function(_this) { return function(response) { console.error('[Apple Pay] Could not build payment request. ' + response.message); $(_this.buttons).hide(); $(_this.terms).hide(); return _this.unblock_ui(); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.get_payment_request = function(data) { return new Promise((function(_this) { return function(resolve, reject) { var base_data; base_data = { 'action': "wc_" + _this.gateway_id + "_apple_pay_get_payment_request" }; $.extend(data, base_data); return $.post(_this.ajax_url, data, function(response) { if (response.success) { return resolve(response.data); } else { return reject(response.data); } }); }; })(this)); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.render_errors = function(errors) { $('.woocommerce-error, .woocommerce-message').remove(); this.ui_element.prepend('<ul class="woocommerce-error"><li>' + errors.join('</li><li>') + '</li></ul>'); this.ui_element.removeClass('processing').unblock(); return $('html, body').animate({ scrollTop: this.ui_element.offset().top - 100 }, 1000); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.block_ui = function() { return this.ui_element.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }; SV_WC_Apple_Pay_Handler_v5_7_1.prototype.unblock_ui = function() { return this.ui_element.unblock(); }; return SV_WC_Apple_Pay_Handler_v5_7_1; })(); return $(document.body).trigger('sv_wc_apple_pay_handler_v5_7_1_loaded'); });}).call(this);
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js
ADDED
@@ -0,0 +1,610 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( function( $ ) {
|
2 |
+
|
3 |
+
"use strict"
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Google Pay handler.
|
7 |
+
*
|
8 |
+
* @since 5.10.0
|
9 |
+
*
|
10 |
+
* @type {SV_WC_Google_Pay_Handler_v5_10_5} object
|
11 |
+
*/
|
12 |
+
window.SV_WC_Google_Pay_Handler_v5_10_5 = class SV_WC_Google_Pay_Handler_v5_10_5 {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Handler constructor.
|
16 |
+
*
|
17 |
+
* @since 5.10.0
|
18 |
+
*
|
19 |
+
* @param {Object} params The plugin ID
|
20 |
+
* @param {string} params.plugin_id The plugin ID
|
21 |
+
* @param {string} params.merchant_id The merchant ID
|
22 |
+
* @param {string} params.merchant_name The site name
|
23 |
+
* @param {string} params.gateway_id The gateway ID
|
24 |
+
* @param {string} params.gateway_id_dasherized The gateway ID dasherized
|
25 |
+
* @param {string} params.ajax_url The AJAX URL
|
26 |
+
* @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action
|
27 |
+
* @param {string} params.process_nonce Nonce for the process AJAX action
|
28 |
+
* @param {string} params.button_style The button style
|
29 |
+
* @param {string[]} params.card_types The supported card types
|
30 |
+
* @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for
|
31 |
+
* @param {string[]} params.currency_code WC configured currency
|
32 |
+
* @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping
|
33 |
+
* @param {string} params.generic_error The generic error message
|
34 |
+
* @param {string} params.product_id The product ID if we are on a Product page
|
35 |
+
*/
|
36 |
+
constructor( params ) {
|
37 |
+
|
38 |
+
let {
|
39 |
+
plugin_id,
|
40 |
+
merchant_id,
|
41 |
+
merchant_name,
|
42 |
+
gateway_id,
|
43 |
+
gateway_id_dasherized,
|
44 |
+
ajax_url,
|
45 |
+
recalculate_totals_nonce,
|
46 |
+
process_nonce,
|
47 |
+
button_style,
|
48 |
+
card_types,
|
49 |
+
available_countries,
|
50 |
+
currency_code,
|
51 |
+
needs_shipping,
|
52 |
+
generic_error
|
53 |
+
} = params;
|
54 |
+
|
55 |
+
this.gatewayID = gateway_id;
|
56 |
+
this.merchantID = merchant_id;
|
57 |
+
this.merchantName = merchant_name;
|
58 |
+
this.ajaxURL = ajax_url;
|
59 |
+
this.recalculateTotalsNonce = recalculate_totals_nonce;
|
60 |
+
this.processNonce = process_nonce;
|
61 |
+
this.buttonStyle = button_style;
|
62 |
+
this.availableCountries = available_countries;
|
63 |
+
this.currencyCode = currency_code;
|
64 |
+
this.needsShipping = needs_shipping;
|
65 |
+
this.genericError = generic_error;
|
66 |
+
|
67 |
+
if ( params.product_id ) {
|
68 |
+
this.productID = params.product_id;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Card networks supported by your site and your gateway
|
73 |
+
*
|
74 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
|
75 |
+
*/
|
76 |
+
const allowedCardNetworks = card_types;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Define the version of the Google Pay API referenced when creating your configuration
|
80 |
+
*
|
81 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}
|
82 |
+
*/
|
83 |
+
this.baseRequest = {
|
84 |
+
apiVersion: 2,
|
85 |
+
apiVersionMinor: 0
|
86 |
+
};
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Card authentication methods supported by your site and your gateway
|
90 |
+
*
|
91 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
|
92 |
+
*
|
93 |
+
* @todo confirm your processor supports Android device tokens for your supported card networks
|
94 |
+
*/
|
95 |
+
const allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Identify your gateway and your site's gateway merchant identifier
|
99 |
+
*
|
100 |
+
* The Google Pay API response will return an encrypted payment method capable
|
101 |
+
* of being charged by a supported gateway after payer authorization
|
102 |
+
*
|
103 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}
|
104 |
+
*/
|
105 |
+
const tokenizationSpecification = {
|
106 |
+
type: 'PAYMENT_GATEWAY',
|
107 |
+
parameters: {
|
108 |
+
'gateway': plugin_id,
|
109 |
+
'gatewayMerchantId': this.merchantID
|
110 |
+
}
|
111 |
+
};
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Describe your site's support for the CARD payment method and its required fields
|
115 |
+
*
|
116 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
|
117 |
+
*/
|
118 |
+
this.baseCardPaymentMethod = {
|
119 |
+
type: 'CARD',
|
120 |
+
parameters: {
|
121 |
+
allowedAuthMethods: allowedCardAuthMethods,
|
122 |
+
allowedCardNetworks: allowedCardNetworks,
|
123 |
+
billingAddressRequired: true,
|
124 |
+
billingAddressParameters: {
|
125 |
+
format: 'FULL',
|
126 |
+
phoneNumberRequired: true
|
127 |
+
}
|
128 |
+
}
|
129 |
+
};
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Describe your site's support for the CARD payment method including optional fields
|
133 |
+
*
|
134 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
|
135 |
+
*/
|
136 |
+
this.cardPaymentMethod = Object.assign(
|
137 |
+
{},
|
138 |
+
this.baseCardPaymentMethod,
|
139 |
+
{
|
140 |
+
tokenizationSpecification: tokenizationSpecification
|
141 |
+
}
|
142 |
+
);
|
143 |
+
|
144 |
+
/**
|
145 |
+
* An initialized google.payments.api.PaymentsClient object or null if not yet set
|
146 |
+
*
|
147 |
+
* @see {@link getGooglePaymentsClient}
|
148 |
+
*/
|
149 |
+
this.paymentsClient = null;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Configure your site's support for payment methods supported by the Google Pay
|
154 |
+
* API.
|
155 |
+
*
|
156 |
+
* Each member of allowedPaymentMethods should contain only the required fields,
|
157 |
+
* allowing reuse of this base request when determining a viewer's ability
|
158 |
+
* to pay and later requesting a supported payment method
|
159 |
+
*
|
160 |
+
* @returns {object} Google Pay API version, payment methods supported by the site
|
161 |
+
*/
|
162 |
+
getGoogleIsReadyToPayRequest() {
|
163 |
+
|
164 |
+
return Object.assign(
|
165 |
+
{},
|
166 |
+
this.baseRequest,
|
167 |
+
{
|
168 |
+
allowedPaymentMethods: [ this.baseCardPaymentMethod ]
|
169 |
+
}
|
170 |
+
);
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Configure support for the Google Pay API
|
175 |
+
*
|
176 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}
|
177 |
+
*
|
178 |
+
* @param {function} resolve callback
|
179 |
+
* @returns {object} PaymentDataRequest fields
|
180 |
+
*/
|
181 |
+
getGooglePaymentDataRequest( resolve ) {
|
182 |
+
|
183 |
+
return this.getGoogleTransactionInfo( ( transactionInfo ) => {
|
184 |
+
|
185 |
+
const paymentDataRequest = Object.assign( {}, this.baseRequest );
|
186 |
+
paymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];
|
187 |
+
paymentDataRequest.transactionInfo = transactionInfo;
|
188 |
+
paymentDataRequest.merchantInfo = {
|
189 |
+
merchantId: this.merchantID,
|
190 |
+
merchantName: this.merchantName
|
191 |
+
};
|
192 |
+
|
193 |
+
paymentDataRequest.emailRequired = true;
|
194 |
+
paymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];
|
195 |
+
|
196 |
+
if ( this.needsShipping ) {
|
197 |
+
paymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];
|
198 |
+
paymentDataRequest.shippingAddressRequired = true;
|
199 |
+
paymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();
|
200 |
+
paymentDataRequest.shippingOptionRequired = true;
|
201 |
+
}
|
202 |
+
|
203 |
+
resolve( paymentDataRequest );
|
204 |
+
} );
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Return an active PaymentsClient or initialize
|
209 |
+
*
|
210 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}
|
211 |
+
* @returns {google.payments.api.PaymentsClient} Google Pay API client
|
212 |
+
*/
|
213 |
+
getGooglePaymentsClient() {
|
214 |
+
if ( this.paymentsClient === null ) {
|
215 |
+
let args = {
|
216 |
+
merchantInfo: {
|
217 |
+
merchantName: this.merchantName,
|
218 |
+
merchantId: this.merchantID
|
219 |
+
},
|
220 |
+
paymentDataCallbacks: {
|
221 |
+
onPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),
|
222 |
+
}
|
223 |
+
};
|
224 |
+
|
225 |
+
if ( this.needsShipping ) {
|
226 |
+
args.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );
|
227 |
+
}
|
228 |
+
|
229 |
+
this.paymentsClient = new google.payments.api.PaymentsClient( args );
|
230 |
+
}
|
231 |
+
return this.paymentsClient;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Handles payment authorization callback intent.
|
236 |
+
*
|
237 |
+
* @param {object} paymentData response from Google Pay API after a payer approves payment.
|
238 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}
|
239 |
+
*
|
240 |
+
* @returns Promise<{object}> Promise object to complete or fail the transaction.
|
241 |
+
*/
|
242 |
+
onPaymentAuthorized( paymentData ) {
|
243 |
+
|
244 |
+
this.blockUI();
|
245 |
+
|
246 |
+
return new Promise( (resolve, reject) => {
|
247 |
+
|
248 |
+
// handle the response
|
249 |
+
try {
|
250 |
+
this.processPayment( paymentData, resolve );
|
251 |
+
} catch( err ) {
|
252 |
+
reject( {
|
253 |
+
transactionState: 'ERROR',
|
254 |
+
error: {
|
255 |
+
intent: 'PAYMENT_AUTHORIZATION',
|
256 |
+
message: 'Payment could not be processed',
|
257 |
+
reason: 'PAYMENT_DATA_INVALID'
|
258 |
+
}
|
259 |
+
} );
|
260 |
+
}
|
261 |
+
|
262 |
+
this.unblockUI();
|
263 |
+
} );
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Handles dynamic buy flow shipping address and shipping options callback intents.
|
268 |
+
*
|
269 |
+
* @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.
|
270 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}
|
271 |
+
*
|
272 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}
|
273 |
+
* @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.
|
274 |
+
*/
|
275 |
+
onPaymentDataChanged( intermediatePaymentData ) {
|
276 |
+
|
277 |
+
this.blockUI();
|
278 |
+
|
279 |
+
return new Promise(( resolve, reject ) => {
|
280 |
+
|
281 |
+
try {
|
282 |
+
let shippingAddress = intermediatePaymentData.shippingAddress;
|
283 |
+
let shippingOptionData = intermediatePaymentData.shippingOptionData;
|
284 |
+
let chosenShippingMethod = '';
|
285 |
+
|
286 |
+
if ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {
|
287 |
+
chosenShippingMethod = shippingOptionData.id;
|
288 |
+
}
|
289 |
+
|
290 |
+
this.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {
|
291 |
+
|
292 |
+
if ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {
|
293 |
+
paymentDataRequestUpdate = {
|
294 |
+
error: this.getGoogleUnserviceableAddressError()
|
295 |
+
};
|
296 |
+
}
|
297 |
+
|
298 |
+
resolve( paymentDataRequestUpdate );
|
299 |
+
} );
|
300 |
+
|
301 |
+
} catch( err ) {
|
302 |
+
this.failPayment( 'Could not load updated totals or process payment data request update. ' + err );
|
303 |
+
}
|
304 |
+
|
305 |
+
this.unblockUI();
|
306 |
+
} );
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Provide Google Pay API with a payment amount, currency, and amount status
|
311 |
+
*
|
312 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}
|
313 |
+
*
|
314 |
+
* @param {function} resolve callback
|
315 |
+
* @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest
|
316 |
+
*/
|
317 |
+
getGoogleTransactionInfo( resolve ) {
|
318 |
+
|
319 |
+
// get transaction info from cart
|
320 |
+
const data = {
|
321 |
+
action: `wc_${this.gatewayID}_google_pay_get_transaction_info`,
|
322 |
+
}
|
323 |
+
|
324 |
+
if ( this.productID ) {
|
325 |
+
data.productID = this.productID;
|
326 |
+
}
|
327 |
+
|
328 |
+
$.post( this.ajaxURL, data, ( response ) => {
|
329 |
+
|
330 |
+
if ( response.success ) {
|
331 |
+
resolve( JSON.parse( response.data ) )
|
332 |
+
} else {
|
333 |
+
this.failPayment( 'Could not build transaction info. ' + response.data.message );
|
334 |
+
}
|
335 |
+
} );
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Get updated totals and shipping options via AJAX for use in the PaymentDataRequest
|
340 |
+
*
|
341 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}
|
342 |
+
*
|
343 |
+
* @param {object} shippingAddress shipping address
|
344 |
+
* @param {object} shippingMethod chosen shipping method
|
345 |
+
* @param {function} resolve callback
|
346 |
+
*/
|
347 |
+
getUpdatedTotals( shippingAddress, shippingMethod, resolve ) {
|
348 |
+
|
349 |
+
const data = {
|
350 |
+
action: `wc_${this.gatewayID}_google_pay_recalculate_totals`,
|
351 |
+
'nonce': this.recalculateTotalsNonce,
|
352 |
+
shippingAddress,
|
353 |
+
shippingMethod
|
354 |
+
}
|
355 |
+
|
356 |
+
if ( this.productID ) {
|
357 |
+
data.productID = this.productID;
|
358 |
+
}
|
359 |
+
|
360 |
+
$.post( this.ajaxURL, data, ( response ) => {
|
361 |
+
|
362 |
+
if ( response.success ) {
|
363 |
+
resolve( JSON.parse( response.data ) )
|
364 |
+
} else {
|
365 |
+
this.failPayment( 'Could not recalculate totals. ' + response.data.message );
|
366 |
+
}
|
367 |
+
} );
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Provide Google Pay API with shipping address parameters when using dynamic buy flow.
|
372 |
+
*
|
373 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}
|
374 |
+
* @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest
|
375 |
+
*/
|
376 |
+
getGoogleShippingAddressParameters() {
|
377 |
+
|
378 |
+
return {
|
379 |
+
allowedCountryCodes: this.availableCountries
|
380 |
+
};
|
381 |
+
}
|
382 |
+
|
383 |
+
/**
|
384 |
+
* Provide Google Pay API with a payment data error.
|
385 |
+
*
|
386 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}
|
387 |
+
* @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate
|
388 |
+
*/
|
389 |
+
getGoogleUnserviceableAddressError() {
|
390 |
+
return {
|
391 |
+
reason: 'SHIPPING_ADDRESS_UNSERVICEABLE',
|
392 |
+
message: 'Cannot ship to the selected address',
|
393 |
+
intent: 'SHIPPING_ADDRESS'
|
394 |
+
};
|
395 |
+
}
|
396 |
+
|
397 |
+
/**
|
398 |
+
* Add a Google Pay purchase button alongside an existing checkout button
|
399 |
+
*
|
400 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}
|
401 |
+
* @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}
|
402 |
+
*/
|
403 |
+
addGooglePayButton() {
|
404 |
+
|
405 |
+
const paymentsClient = this.getGooglePaymentsClient();
|
406 |
+
const button = paymentsClient.createButton( {
|
407 |
+
onClick: ( event ) => this.onGooglePaymentButtonClicked( event ),
|
408 |
+
buttonColor: this.buttonStyle,
|
409 |
+
buttonSizeMode: 'fill'
|
410 |
+
} );
|
411 |
+
document.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Prefetch payment data to improve performance
|
416 |
+
*
|
417 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}
|
418 |
+
*/
|
419 |
+
prefetchGooglePaymentData() {
|
420 |
+
|
421 |
+
this.getGooglePaymentDataRequest( ( paymentDataRequest ) => {
|
422 |
+
|
423 |
+
// transactionInfo must be set but does not affect cache
|
424 |
+
paymentDataRequest.transactionInfo = {
|
425 |
+
totalPriceStatus: 'NOT_CURRENTLY_KNOWN',
|
426 |
+
currencyCode: this.currencyCode
|
427 |
+
};
|
428 |
+
const paymentsClient = this.getGooglePaymentsClient();
|
429 |
+
paymentsClient.prefetchPaymentData( paymentDataRequest );
|
430 |
+
} );
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Process payment data returned by the Google Pay API
|
435 |
+
*
|
436 |
+
* @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}
|
437 |
+
*
|
438 |
+
* @param {object} paymentData response from Google Pay API after user approves payment
|
439 |
+
* @param {function} resolve callback
|
440 |
+
*/
|
441 |
+
processPayment( paymentData, resolve ) {
|
442 |
+
|
443 |
+
// pass payment token to your gateway to process payment
|
444 |
+
const data = {
|
445 |
+
action: `wc_${this.gatewayID}_google_pay_process_payment`,
|
446 |
+
nonce: this.processNonce,
|
447 |
+
paymentData: JSON.stringify( paymentData ),
|
448 |
+
}
|
449 |
+
|
450 |
+
if ( this.productID && ! this.needsShipping ) {
|
451 |
+
data.productID = this.productID;
|
452 |
+
}
|
453 |
+
|
454 |
+
return $.post( this.ajaxURL, data, ( response ) => {
|
455 |
+
if ( response.success ) {
|
456 |
+
resolve( {
|
457 |
+
transactionState: 'SUCCESS'
|
458 |
+
} );
|
459 |
+
window.location = response.data.redirect;
|
460 |
+
} else {
|
461 |
+
resolve( {
|
462 |
+
transactionState: 'ERROR',
|
463 |
+
error: {
|
464 |
+
intent: 'SHIPPING_ADDRESS',
|
465 |
+
message: 'Invalid data',
|
466 |
+
reason: 'PAYMENT_DATA_INVALID'
|
467 |
+
}
|
468 |
+
} );
|
469 |
+
this.failPayment( 'Payment could not be processed. ' + response.data.message );
|
470 |
+
}
|
471 |
+
} );
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Show Google Pay payment sheet when Google Pay payment button is clicked
|
476 |
+
*/
|
477 |
+
onGooglePaymentButtonClicked( event ) {
|
478 |
+
|
479 |
+
event.preventDefault();
|
480 |
+
|
481 |
+
this.blockUI();
|
482 |
+
|
483 |
+
this.getGooglePaymentDataRequest( ( paymentDataRequest ) => {
|
484 |
+
|
485 |
+
const paymentsClient = this.getGooglePaymentsClient();
|
486 |
+
try {
|
487 |
+
paymentsClient.loadPaymentData( paymentDataRequest );
|
488 |
+
} catch ( err ) {
|
489 |
+
this.failPayment( 'Could not load payment data. ' + err );
|
490 |
+
}
|
491 |
+
|
492 |
+
this.unblockUI();
|
493 |
+
} );
|
494 |
+
}
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
|
498 |
+
*
|
499 |
+
* Display a Google Pay payment button after confirmation of the viewer's
|
500 |
+
* ability to pay.
|
501 |
+
*/
|
502 |
+
init() {
|
503 |
+
|
504 |
+
// initialize for the various pages
|
505 |
+
if ( $( 'form.cart' ).length ) {
|
506 |
+
this.initProductPage();
|
507 |
+
} else if ( $( 'form.woocommerce-cart-form' ).length ) {
|
508 |
+
this.initCartPage();
|
509 |
+
} else if ( $( 'form.woocommerce-checkout' ).length) {
|
510 |
+
this.initCheckoutPage()
|
511 |
+
} else {
|
512 |
+
return;
|
513 |
+
}
|
514 |
+
|
515 |
+
this.initGooglePay();
|
516 |
+
}
|
517 |
+
|
518 |
+
/**
|
519 |
+
* Initializes Google Pay.
|
520 |
+
*/
|
521 |
+
initGooglePay() {
|
522 |
+
|
523 |
+
const paymentsClient = this.getGooglePaymentsClient();
|
524 |
+
paymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )
|
525 |
+
.then( ( response ) => {
|
526 |
+
if ( response.result ) {
|
527 |
+
this.addGooglePayButton();
|
528 |
+
// prefetch payment data to improve performance
|
529 |
+
this.prefetchGooglePaymentData();
|
530 |
+
}
|
531 |
+
} )
|
532 |
+
.catch( ( err ) => {
|
533 |
+
this.failPayment( 'Google Pay is not ready. ' + err );
|
534 |
+
} );
|
535 |
+
}
|
536 |
+
|
537 |
+
/**
|
538 |
+
* Initializes the product page.
|
539 |
+
*/
|
540 |
+
initProductPage() {
|
541 |
+
this.uiElement = $( 'form.cart' );
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Initializes the cart page.
|
546 |
+
*/
|
547 |
+
initCartPage() {
|
548 |
+
this.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );
|
549 |
+
|
550 |
+
// re-init if the cart totals are updated
|
551 |
+
$( document.body ).on( 'updated_cart_totals', () => {
|
552 |
+
this.initGooglePay();
|
553 |
+
} );
|
554 |
+
}
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Initializes the checkout page.
|
558 |
+
*/
|
559 |
+
initCheckoutPage() {
|
560 |
+
this.uiElement = $( 'form.woocommerce-checkout' );
|
561 |
+
}
|
562 |
+
|
563 |
+
/**
|
564 |
+
* Fails the purchase based on the gateway result.
|
565 |
+
*/
|
566 |
+
failPayment( error ) {
|
567 |
+
|
568 |
+
console.error( '[Google Pay] ' + error );
|
569 |
+
|
570 |
+
this.unblockUI();
|
571 |
+
|
572 |
+
this.renderErrors( [ this.genericError ] );
|
573 |
+
}
|
574 |
+
|
575 |
+
/**
|
576 |
+
* Renders any new errors and bring them into the viewport.
|
577 |
+
*/
|
578 |
+
renderErrors( errors ) {
|
579 |
+
|
580 |
+
// hide and remove any previous errors
|
581 |
+
$( '.woocommerce-error, .woocommerce-message' ).remove();
|
582 |
+
|
583 |
+
// add errors
|
584 |
+
this.uiElement.prepend( '<ul class="woocommerce-error"><li>' + errors.join( '</li><li>' ) + '</li></ul>' );
|
585 |
+
|
586 |
+
// unblock UI
|
587 |
+
this.uiElement.removeClass( 'processing' ).unblock();
|
588 |
+
|
589 |
+
// scroll to top
|
590 |
+
$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Blocks the payment form UI.
|
595 |
+
*/
|
596 |
+
blockUI() {
|
597 |
+
this.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );
|
598 |
+
}
|
599 |
+
|
600 |
+
/**
|
601 |
+
* Unblocks the payment form UI.
|
602 |
+
*/
|
603 |
+
unblockUI() {
|
604 |
+
this.uiElement.unblock();
|
605 |
+
}
|
606 |
+
}
|
607 |
+
|
608 |
+
$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_5_loaded' );
|
609 |
+
|
610 |
+
} );
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript Version 5.1.0 Copyright (c) 2014-2020, SkyVerge, Inc. Licensed under the GNU General Public License v3.0 http://www.gnu.org/licenses/gpl-3.0.html */(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; jQuery(document).ready(function($) { "use strict"; window.SV_WC_Payment_Methods_Handler_v5_7_1 = (function() { function SV_WC_Payment_Methods_Handler_v5_7_1(args) { this.cancel_edit = bind(this.cancel_edit, this); this.save_method = bind(this.save_method, this); this.edit_method = bind(this.edit_method, this); this.id = args.id; this.slug = args.slug; this.i18n = args.i18n; this.ajax_url = args.ajax_url; this.ajax_nonce = args.ajax_nonce; if (!args.has_core_tokens) { $(".wc-" + this.slug + "-my-payment-methods").prev(".woocommerce-Message.woocommerce-Message--info").hide(); } $(".wc-" + this.slug + "-payment-method-actions .button.tip").tipTip(); $(".wc-" + this.slug + "-my-payment-methods").on('click', ".wc-" + this.slug + "-payment-method-actions .edit-payment-method", (function(_this) { return function(event) { return _this.edit_method(event); }; })(this)); $(".wc-" + this.slug + "-my-payment-methods").on('click', ".wc-" + this.slug + "-payment-method-actions .save-payment-method", (function(_this) { return function(event) { return _this.save_method(event); }; })(this)); $(".wc-" + this.slug + "-my-payment-methods").on('click', ".wc-" + this.slug + "-payment-method-actions .cancel-edit-payment-method", (function(_this) { return function(event) { return _this.cancel_edit(event); }; })(this)); $(".wc-" + this.slug + "-my-payment-methods").on('click', ".wc-" + this.slug + "-payment-method-actions .delete-payment-method", (function(_this) { return function(event) { if ($(event.currentTarget).hasClass('disabled') || !confirm(_this.i18n.delete_ays)) { return event.preventDefault(); } }; })(this)); $('.button[href*="add-payment-method"]').click(function(event) { if ($(this).hasClass('disabled')) { return event.preventDefault(); } }); } SV_WC_Payment_Methods_Handler_v5_7_1.prototype.edit_method = function(event) { var button, row; event.preventDefault(); button = $(event.currentTarget); row = button.parents('tr'); row.find('.view').hide(); row.find('.edit').show(); row.addClass('editing'); button.text(this.i18n.cancel_button).removeClass('edit-payment-method').addClass('cancel-edit-payment-method').removeClass('button'); button.siblings('.save-payment-method').show(); button.siblings('.delete-payment-method').hide(); return this.enable_editing_ui(); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.save_method = function(event) { var button, data, row; event.preventDefault(); button = $(event.currentTarget); row = button.parents('tr'); this.block_ui(); row.next('.error').remove(); data = { action: "wc_" + this.id + "_save_payment_method", nonce: this.ajax_nonce, token_id: row.data('token-id'), data: row.find('input[name]').serialize() }; return $.post(this.ajax_url, data).done((function(_this) { return function(response) { if (!response.success) { return _this.display_error(row, response.data); } if (response.data.is_default) { row.siblings().find(".wc-" + _this.slug + "-payment-method-default .view").empty().siblings('.edit').find('input').prop('checked', false); } if (response.data.html != null) { row.replaceWith(response.data.html); } if (response.data.nonce != null) { _this.ajax_nonce = response.data.nonce; } return _this.disable_editing_ui(); }; })(this)).fail((function(_this) { return function(jqXHR, textStatus, error) { return _this.display_error(row, error); }; })(this)).always((function(_this) { return function() { return _this.unblock_ui(); }; })(this)); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.cancel_edit = function(event) { var button, row; event.preventDefault(); button = $(event.currentTarget); row = button.parents('tr'); row.find('.view').show(); row.find('.edit').hide(); row.removeClass('editing'); button.removeClass('cancel-edit-payment-method').addClass('edit-payment-method').text(this.i18n.edit_button).addClass('button'); button.siblings('.save-payment-method').hide(); button.siblings('.delete-payment-method').show(); return this.disable_editing_ui(); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.enable_editing_ui = function() { $(".wc-" + this.slug + "-my-payment-methods").addClass('editing'); return $('.button[href*="add-payment-method"]').addClass('disabled'); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.disable_editing_ui = function() { $(".wc-" + this.slug + "-my-payment-methods").removeClass('editing'); return $('.button[href*="add-payment-method"]').removeClass('disabled'); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.block_ui = function() { return $(".wc-" + this.slug + "-my-payment-methods").parent('div').block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.unblock_ui = function() { return $(".wc-" + this.slug + "-my-payment-methods").parent('div').unblock(); }; SV_WC_Payment_Methods_Handler_v5_7_1.prototype.display_error = function(row, error, message) { var columns; if (message == null) { message = ''; } console.error(error); if (!message) { message = this.i18n.save_error; } columns = $(".wc-" + this.slug + "-my-payment-methods thead tr th").size(); return $('<tr class="error"><td colspan="' + columns + '">' + message + '</td></tr>').insertAfter(row).find('td').delay(8000).slideUp(200); }; return SV_WC_Payment_Methods_Handler_v5_7_1; })(); return $(document.body).trigger('sv_wc_payment_methods_handler_v5_7_1_loaded'); });}).call(this);
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript Version 4.3.0-beta Copyright (c) 2014-2020, SkyVerge, Inc. Licensed under the GNU General Public License v3.0 http://www.gnu.org/licenses/gpl-3.0.html */(function() { var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; jQuery(document).ready(function($) { console.log( '{AC} - ready' ); "use strict"; window.SV_WC_Payment_Form_Handler_v5_7_1 = (function() { function SV_WC_Payment_Form_Handler_v5_7_1(args) { this.id = args.id; this.id_dasherized = args.id_dasherized; this.plugin_id = args.plugin_id; this.type = args.type; this.csc_required = args.csc_required; this.csc_required_for_tokens = args.csc_required_for_tokens; this.enabled_card_types = args.enabled_card_types; if ($('form.checkout').length) { this.form = $('form.checkout'); this.handle_checkout_page(); } else if ($('form#order_review').length) { this.form = $('form#order_review'); this.handle_pay_page(); } else if ($('form#add_payment_method').length) { this.form = $('form#add_payment_method'); this.handle_add_payment_method_page(); } else { console.log('No payment form found!'); return; } this.params = window["sv_wc_payment_gateway_payment_form_params"]; if (this.type === 'echeck') { this.form.on('click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', (function(_this) { return function() { return _this.handle_sample_check_hint(); }; })(this)); } $(document).trigger('sv_wc_payment_form_handler_init', { id: this.id, instance: this }); } SV_WC_Payment_Form_Handler_v5_7_1.prototype.handle_checkout_page = function() { console.log( '{AC} - checkout' ); if (this.type === 'credit-card') { $(document.body).on('updated_checkout', (function(_this) { return function() { return _this.format_credit_card_inputs(); }; })(this)); } $(document.body).on('updated_checkout', (function(_this) { return function() { return _this.set_payment_fields(); }; })(this)); $(document.body).on('updated_checkout', (function(_this) { return function() { return _this.handle_saved_payment_methods(); }; })(this)); return this.form.on("checkout_place_order_" + this.id, (function(_this) { return function() { return _this.validate_payment_data(); }; })(this)); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.handle_pay_page = function() { console.log( '{AC} - handle_pay_page' ); this.set_payment_fields(); if (this.type === 'credit-card') { this.format_credit_card_inputs(); } this.handle_saved_payment_methods(); return this.form.submit((function(_this) { return function() { if ($('#order_review input[name=payment_method]:checked').val() === _this.id) { return _this.validate_payment_data(); } }; })(this)); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.handle_add_payment_method_page = function() { console.log( '{AC} - handle_add_payment_method_page' ); this.set_payment_fields(); if (this.type === 'credit-card') { this.format_credit_card_inputs(); } return this.form.submit((function(_this) { return function() { if ($('#add_payment_method input[name=payment_method]:checked').val() === _this.id) { return _this.validate_payment_data(); } }; })(this)); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.set_payment_fields = function() { console.log( '{AC} - set_payment_fields' ); var $required_fields; this.payment_fields = $(".payment_method_" + this.id); $required_fields = this.payment_fields.find('.validate-required .input-text'); return $required_fields.each((function(_this) { return function(i, input) { if ($(input).val()) { return false; } return $(input).trigger('input'); }; })(this)); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.validate_payment_data = function() { console.log( '{AC} - validate_payment_data' ); var handler, valid; if (this.form.is('.processing')) { return false; } this.saved_payment_method_selected = this.payment_fields.find('.js-sv-wc-payment-gateway-payment-token:checked').val(); valid = this.type === 'credit-card' ? this.validate_card_data() : this.validate_account_data(); handler = $(document.body).triggerHandler('sv_wc_payment_form_valid_payment_data', { payment_form: this, passed_validation: valid }) !== false; return valid && handler; }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.format_credit_card_inputs = function() { console.log( '{AC} - format_credit_card_inputs' ); var $card_number, $csc, $expiry; $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber'); $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry'); $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC'); if ($card_number.val() && $card_number.val().length > 0) { $card_number.trigger('change'); } if ($expiry.val() && $expiry.val().length > 0) { $expiry.trigger('change'); } if ($csc.val() && $csc.val().length > 0) { $csc.trigger('change'); } return $('.js-sv-wc-payment-gateway-credit-card-form-input').on('change paste keyup', (function(_this) { return function() { return _this.do_inline_credit_card_validation(); }; })(this)); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.do_inline_credit_card_validation = function() { console.log( '{AC} - do_inline_credit_card_validation' ); var $card_number, $card_type, $csc, $expiry; $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number'); $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry'); $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc'); $card_type = $.payment.cardType($card_number.val()); if (indexOf.call(this.enabled_card_types, $card_type) < 0) { $card_number.addClass('invalid-card-type'); } else { $card_number.removeClass('invalid-card-type'); } if ($.payment.validateCardExpiry($expiry.payment('cardExpiryVal'))) { $expiry.addClass('identified'); } else { $expiry.removeClass('identified'); } if ($.payment.validateCardCVC($csc.val())) { return $csc.addClass('identified'); } else { return $csc.removeClass('identified'); } }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.validate_card_data = function() { console.log( '{AC} - validate_card_data' ); var account_number, csc, errors, expiry; errors = []; csc = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-csc').val(); if (csc != null) { if (csc) { if (/\D/.test(csc)) { errors.push(this.params.cvv_digits_invalid); } if (csc.length < 3 || csc.length > 4) { errors.push(this.params.cvv_length_invalid); } } else if (this.csc_required) { if (!this.saved_payment_method_selected || this.csc_required_for_tokens) { errors.push(this.params.cvv_missing); } } } if (!this.saved_payment_method_selected) { account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val(); expiry = $.payment.cardExpiryVal(this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').val()); account_number = account_number.replace(/-|\s/g, ''); if (!account_number) { errors.push(this.params.card_number_missing); } else { if (account_number.length < 12 || account_number.length > 19) { errors.push(this.params.card_number_length_invalid); } if (/\D/.test(account_number)) { errors.push(this.params.card_number_digits_invalid); } if (!$.payment.validateCardNumber(account_number)) { errors.push(this.params.card_number_invalid); } } if (!$.payment.validateCardExpiry(expiry)) { errors.push(this.params.card_exp_date_invalid); } } if (errors.length > 0) { this.render_errors(errors); return false; } else { this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val(account_number); return true; } }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.validate_account_data = function() { console.log( '{AC} - validate_account_data' ); var account_number, errors, routing_number; if (this.saved_payment_method_selected) { return true; } errors = []; routing_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val(); account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val(); if (!routing_number) { errors.push(this.params.routing_number_missing); } else { if (9 !== routing_number.length) { errors.push(this.params.routing_number_length_invalid); } if (/\D/.test(routing_number)) { errors.push(this.params.routing_number_digits_invalid); } } if (!account_number) { errors.push(this.params.account_number_missing); } else { if (account_number.length < 3 || account_number.length > 17) { errors.push(this.params.account_number_length_invalid); } if (/\D/.test(account_number)) { errors.push(this.params.account_number_invalid); } } if (errors.length > 0) { this.render_errors(errors); return false; } else { this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val(account_number); return true; } }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.render_errors = function(errors) { console.log( '{AC} - render_errors' ); $('.woocommerce-error, .woocommerce-message').remove(); this.form.prepend('<ul class="woocommerce-error"><li>' + errors.join('</li><li>') + '</li></ul>'); this.form.removeClass('processing').unblock(); this.form.find('.input-text, select').blur(); return $('html, body').animate({ scrollTop: this.form.offset().top - 100 }, 1000); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.handle_saved_payment_methods = function() { console.log( '{AC} - handle_saved_payment_methods' ); var $csc_field, $new_payment_method_selection, csc_required, csc_required_for_tokens, id_dasherized; id_dasherized = this.id_dasherized; csc_required = this.csc_required; csc_required_for_tokens = this.csc_required_for_tokens; $new_payment_method_selection = $("div.js-wc-" + id_dasherized + "-new-payment-method-form"); $csc_field = $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-csc').closest('.form-row'); $("input.js-wc-" + this.id_dasherized + "-payment-token").change(function() { var tokenized_payment_method_selected; tokenized_payment_method_selected = $("input.js-wc-" + id_dasherized + "-payment-token:checked").val(); if (tokenized_payment_method_selected) { $new_payment_method_selection.slideUp(200); if (csc_required_for_tokens) { $csc_field.removeClass('form-row-last').addClass('form-row-first'); return $new_payment_method_selection.after($csc_field); } } else { $new_payment_method_selection.slideDown(200); if (csc_required_for_tokens) { $csc_field.removeClass('form-row-first').addClass('form-row-last'); return $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').closest('.form-row').after($csc_field); } } }).change(); $('input#createaccount').change(function() { var $parent_row; $parent_row = $("input.js-wc-" + id_dasherized + "-tokenize-payment-method").closest('p.form-row'); if ($(this).is(':checked')) { $parent_row.slideDown(); return $parent_row.next().show(); } else { $parent_row.hide(); return $parent_row.next().hide(); } }); if (!$('input#createaccount').is(':checked')) { return $('input#createaccount').change(); } }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.handle_sample_check_hint = function() { console.log( '{AC} - handle_sample_check_hint' ); var $sample_check; $sample_check = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-sample-check'); if ($sample_check.is(":visible")) { return $sample_check.slideUp(); } else { return $sample_check.slideDown(); } }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.block_ui = function() { console.log( '{AC} - block_ui' ); return this.form.block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }; SV_WC_Payment_Form_Handler_v5_7_1.prototype.unblock_ui = function() { console.log( '{AC} - unblock_ui' ); return this.form.unblock(); }; return SV_WC_Payment_Form_Handler_v5_7_1; })(); return $(document.body).trigger("sv_wc_payment_form_handler_v5_7_1_loaded"); });}).call(this);
|
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -653,12 +653,15 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
653 |
* @since 1.0.0
|
654 |
*
|
655 |
* @param \WC_Order $order the order object
|
|
|
656 |
* @return SV_WC_Payment_Gateway_API_Response the response
|
657 |
* @throws SV_WC_Plugin_Exception network timeouts, etc
|
658 |
*/
|
659 |
-
protected function do_check_transaction( $order ) {
|
660 |
|
661 |
-
|
|
|
|
|
662 |
|
663 |
// success! update order record
|
664 |
if ( $response->transaction_approved() ) {
|
@@ -914,16 +917,20 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
914 |
|
915 |
|
916 |
/**
|
917 |
-
*
|
918 |
-
* account
|
919 |
*
|
920 |
* @since 4.0.0
|
|
|
|
|
|
|
921 |
* @return array result with success/error message and request status (success/failure)
|
922 |
* @throws SV_WC_Plugin_Exception
|
923 |
*/
|
924 |
-
protected function do_add_payment_method_transaction( \WC_Order $order ) {
|
925 |
|
926 |
-
|
|
|
|
|
927 |
|
928 |
if ( $response->transaction_approved() ) {
|
929 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Direct' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
653 |
* @since 1.0.0
|
654 |
*
|
655 |
* @param \WC_Order $order the order object
|
656 |
+
* @param SV_WC_Payment_Gateway_API_Response $response optional check transaction response
|
657 |
* @return SV_WC_Payment_Gateway_API_Response the response
|
658 |
* @throws SV_WC_Plugin_Exception network timeouts, etc
|
659 |
*/
|
660 |
+
protected function do_check_transaction( $order, $response = null ) {
|
661 |
|
662 |
+
if ( is_null( $response ) ) {
|
663 |
+
$response = $this->get_api()->check_debit( $order );
|
664 |
+
}
|
665 |
|
666 |
// success! update order record
|
667 |
if ( $response->transaction_approved() ) {
|
917 |
|
918 |
|
919 |
/**
|
920 |
+
* Performs the transaction to add the customer's payment method to their account.
|
|
|
921 |
*
|
922 |
* @since 4.0.0
|
923 |
+
*
|
924 |
+
* @param \WC_Order $order order object
|
925 |
+
* @param SV_WC_Payment_Gateway_API_Create_Payment_Token_Response $response optional payment token transaction response
|
926 |
* @return array result with success/error message and request status (success/failure)
|
927 |
* @throws SV_WC_Plugin_Exception
|
928 |
*/
|
929 |
+
protected function do_add_payment_method_transaction( \WC_Order $order, SV_WC_Payment_Gateway_API_Create_Payment_Token_Response $response = null ) {
|
930 |
|
931 |
+
if ( is_null( $response ) ) {
|
932 |
+
$response = $this->get_api()->tokenize_payment_method( $order );
|
933 |
+
}
|
934 |
|
935 |
if ( $response->transaction_approved() ) {
|
936 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -265,6 +265,20 @@ class SV_WC_Payment_Gateway_Helper {
|
|
265 |
}
|
266 |
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
}
|
269 |
|
270 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Helper' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
265 |
}
|
266 |
|
267 |
|
268 |
+
/**
|
269 |
+
* Formats the given expiration year to include the last two digits only.
|
270 |
+
*
|
271 |
+
* @since 5.9.0
|
272 |
+
*
|
273 |
+
* @param string $exp_year a credit card expiration year
|
274 |
+
* @return string
|
275 |
+
*/
|
276 |
+
public static function format_exp_year( $exp_year ) {
|
277 |
+
|
278 |
+
return substr( $exp_year, -2 );
|
279 |
+
}
|
280 |
+
|
281 |
+
|
282 |
}
|
283 |
|
284 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -247,24 +247,28 @@ abstract class SV_WC_Payment_Gateway_Hosted extends SV_WC_Payment_Gateway {
|
|
247 |
|
248 |
// attempt to automatically submit the form and redirect
|
249 |
wc_enqueue_js('
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
|
|
|
|
|
|
|
|
268 |
');
|
269 |
|
270 |
echo '<p>' . esc_html( $args['message'] ) . '</p>';
|
@@ -770,10 +774,10 @@ abstract class SV_WC_Payment_Gateway_Hosted extends SV_WC_Payment_Gateway {
|
|
770 |
*
|
771 |
* @since 4.3.0
|
772 |
*
|
773 |
-
* @param \WC_Order $order
|
774 |
* @param SV_WC_Payment_Gateway_API_Payment_Notification_Response $response the response object
|
775 |
*/
|
776 |
-
protected function do_invalid_transaction_response( $order
|
777 |
|
778 |
if ( $response->is_ipn() ) {
|
779 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Hosted' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
247 |
|
248 |
// attempt to automatically submit the form and redirect
|
249 |
wc_enqueue_js('
|
250 |
+
( function( $ ) {
|
251 |
+
|
252 |
+
$( "body" ).block( {
|
253 |
+
message: "<img src=\"' . esc_url( $this->get_plugin()->get_framework_assets_url() . '/images/ajax-loader.gif' ) . '\" alt=\"Redirecting…\" style=\"float:left; margin-right: 10px;\" />' . esc_html( $args['thanks_message'] ) . '",
|
254 |
+
overlayCSS: {
|
255 |
+
background: "#fff",
|
256 |
+
opacity: 0.6
|
257 |
+
},
|
258 |
+
css: {
|
259 |
+
padding: 20,
|
260 |
+
textAlign: "center",
|
261 |
+
color: "#555",
|
262 |
+
border: "3px solid #aaa",
|
263 |
+
backgroundColor: "#fff",
|
264 |
+
cursor: "wait",
|
265 |
+
lineHeight: "32px"
|
266 |
+
}
|
267 |
+
} );
|
268 |
+
|
269 |
+
$( "#submit_' . $this->get_id() . '_payment_form" ).click();
|
270 |
+
|
271 |
+
} ) ( jQuery );
|
272 |
');
|
273 |
|
274 |
echo '<p>' . esc_html( $args['message'] ) . '</p>';
|
774 |
*
|
775 |
* @since 4.3.0
|
776 |
*
|
777 |
+
* @param \WC_Order $order WooCommerce order object
|
778 |
* @param SV_WC_Payment_Gateway_API_Payment_Notification_Response $response the response object
|
779 |
*/
|
780 |
+
protected function do_invalid_transaction_response( $order, $response ) {
|
781 |
|
782 |
if ( $response->is_ipn() ) {
|
783 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -60,9 +60,10 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
60 |
|
61 |
|
62 |
/**
|
63 |
-
*
|
64 |
*
|
65 |
* @param SV_WC_Payment_Gateway_Plugin $plugin gateway plugin
|
|
|
66 |
* @since 4.0.0
|
67 |
*/
|
68 |
public function __construct( $plugin ) {
|
@@ -86,6 +87,10 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
86 |
|
87 |
// save a payment method via AJAX
|
88 |
add_action( 'wp_ajax_wc_' . $this->get_plugin()->get_id() . '_save_payment_method', array( $this, 'ajax_save_payment_method' ) );
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
|
91 |
|
@@ -126,19 +131,30 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
126 |
return;
|
127 |
}
|
128 |
|
129 |
-
//
|
130 |
$this->load_tokens();
|
131 |
|
132 |
// styles/scripts
|
133 |
add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_styles_scripts' ) );
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
$this->handle_payment_method_actions();
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
|
@@ -151,23 +167,18 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
151 |
|
152 |
$handle = 'sv-wc-payment-gateway-my-payment-methods';
|
153 |
|
154 |
-
|
155 |
-
if ( $this->has_tokens ) {
|
156 |
|
157 |
-
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
wp_enqueue_script( "$handle-v5_7_1", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/js/frontend/' . $handle . '.min.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::VERSION );
|
162 |
-
}
|
163 |
}
|
164 |
|
165 |
|
166 |
/**
|
167 |
-
*
|
168 |
*
|
169 |
-
* Tokens are also separated into Credit Card and eCheck-specific class members
|
170 |
-
* for convenience.
|
171 |
*
|
172 |
* @since 4.0.0
|
173 |
*/
|
@@ -214,33 +225,298 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
214 |
|
215 |
|
216 |
/**
|
217 |
-
*
|
|
|
218 |
*
|
219 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
220 |
*/
|
221 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
|
225 |
/**
|
226 |
-
*
|
227 |
*
|
228 |
-
*
|
229 |
*
|
230 |
* @since 4.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
*
|
232 |
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
|
|
|
|
|
|
|
|
233 |
*/
|
234 |
do_action( 'wc_' . $this->get_plugin()->get_id() . '_before_my_payment_method_table', $this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
-
|
237 |
|
238 |
/**
|
239 |
* After My Payment Methods Table Action.
|
240 |
*
|
241 |
-
* Fired after
|
242 |
*
|
243 |
* @since 4.0.0
|
|
|
244 |
*
|
245 |
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
246 |
*/
|
@@ -250,18 +526,62 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
250 |
|
251 |
|
252 |
/**
|
253 |
-
*
|
254 |
*
|
255 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
256 |
*/
|
257 |
-
public function
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
}
|
266 |
|
267 |
|
@@ -397,304 +717,128 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
397 |
/**
|
398 |
* Return the table title HTML, text defaults to "My Payment Methods"
|
399 |
*
|
|
|
|
|
400 |
* @since 4.0.0
|
|
|
|
|
401 |
* @return string table title HTML
|
402 |
*/
|
403 |
protected function get_table_title_html() {
|
404 |
|
405 |
-
|
406 |
-
* My Payment Methods Table Table Heading Text Filter.
|
407 |
-
*
|
408 |
-
* Allow actors to modify the my payment methods table heading text.
|
409 |
-
*
|
410 |
-
* @since 4.0.0
|
411 |
-
*
|
412 |
-
* @param string $message table heading text
|
413 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
414 |
-
*/
|
415 |
-
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
416 |
-
$title = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title', esc_html__( 'My Payment Methods', 'woocommerce-plugin-framework' ), $this );
|
417 |
-
|
418 |
-
$html = '<div class="sv-wc-payment-gateway-my-payment-methods-table-title">';
|
419 |
|
420 |
-
|
421 |
-
|
422 |
-
if ( $this->supports_add_payment_method() ) {
|
423 |
-
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
424 |
-
$html .= sprintf( '<a class="button sv-wc-payment-gateway-my-payment-methods-add-payment-method-button dashicons-before dashicons-plus-alt" href="%s">%s</a>', esc_url( wc_get_endpoint_url( 'add-payment-method' ) ), esc_html__( 'Add New Payment Method', 'woocommerce-plugin-framework' ) );
|
425 |
-
}
|
426 |
-
|
427 |
-
$html .= '</div>';
|
428 |
-
|
429 |
-
/**
|
430 |
-
* My Payment Methods Table Title HTML Filter.
|
431 |
-
*
|
432 |
-
* Allow actors to modify the table title HTML.
|
433 |
-
*
|
434 |
-
* @since 4.0.0
|
435 |
-
*
|
436 |
-
* @param string $html table title HTML
|
437 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
438 |
-
*/
|
439 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title_html', $html, $this );
|
440 |
}
|
441 |
|
442 |
|
443 |
/**
|
444 |
-
*
|
|
|
|
|
445 |
*
|
446 |
* @since 4.0.0
|
|
|
|
|
447 |
* @return string table HTML
|
448 |
*/
|
449 |
public function get_table_html() {
|
450 |
|
451 |
-
|
452 |
-
|
453 |
-
$html .= $this->get_table_head_html();
|
454 |
-
|
455 |
-
$html .= $this->get_table_body_html();
|
456 |
|
457 |
-
|
458 |
-
|
459 |
-
/**
|
460 |
-
* My Payment Methods Table HTML Filter.
|
461 |
-
*
|
462 |
-
* Allow actors to modify the table HTML.
|
463 |
-
*
|
464 |
-
* @since 4.0.0
|
465 |
-
*
|
466 |
-
* @param string $html table HTML
|
467 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
468 |
-
*/
|
469 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_html', $html, $this );
|
470 |
}
|
471 |
|
472 |
|
473 |
/**
|
474 |
-
*
|
|
|
|
|
475 |
*
|
476 |
* @since 4.0.0
|
|
|
|
|
477 |
* @return string table thead HTML
|
478 |
*/
|
479 |
protected function get_table_head_html() {
|
480 |
|
481 |
-
|
482 |
|
483 |
-
|
484 |
-
$html .= sprintf( '<th class="sv-wc-payment-gateway-my-payment-method-table-header sv-wc-payment-gateway-payment-method-header-%1$s wc-%2$s-payment-method-%1$s"><span class="nobr">%3$s</span></th>', sanitize_html_class( $key ), sanitize_html_class( $this->get_plugin()->get_id_dasherized() ), esc_html( $title ) );
|
485 |
-
}
|
486 |
-
|
487 |
-
$html .= '</tr></thead>';
|
488 |
-
|
489 |
-
/**
|
490 |
-
* My Payment Methods Table Head HTML Filter.
|
491 |
-
*
|
492 |
-
* Allow actors to modify the table head HTML.
|
493 |
-
*
|
494 |
-
* @since 4.0.0
|
495 |
-
*
|
496 |
-
* @param string $html table head HTML
|
497 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
498 |
-
*/
|
499 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_head_html', $html, $this );
|
500 |
}
|
501 |
|
502 |
|
503 |
/**
|
504 |
-
*
|
|
|
|
|
505 |
*
|
506 |
* @since 4.0.0
|
|
|
|
|
507 |
* @return array of table headers in key => Title format
|
508 |
*/
|
509 |
protected function get_table_headers() {
|
510 |
|
511 |
-
|
512 |
-
'title' => __( 'Method', 'woocommerce-plugin-framework' ),
|
513 |
-
'details' => __( 'Details', 'woocommerce-plugin-framework' ),
|
514 |
-
'expiry' => __( 'Expires', 'woocommerce-plugin-framework' ),
|
515 |
-
'default' => __( 'Default?', 'woocommerce-plugin-framework' ),
|
516 |
-
'actions' => __( 'Actions', 'woocommerce-plugin-framework' ),
|
517 |
-
);
|
518 |
|
519 |
-
|
520 |
-
* My Payment Methods Table Headers Filter.
|
521 |
-
*
|
522 |
-
* Allow actors to modify the table headers.
|
523 |
-
*
|
524 |
-
* @since 4.0.0
|
525 |
-
* @param array $headers table headers {
|
526 |
-
* @type string $title
|
527 |
-
* @type string $expiry
|
528 |
-
* @type string $actions
|
529 |
-
* }
|
530 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
531 |
-
*/
|
532 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_headers', $headers, $this );
|
533 |
}
|
534 |
|
535 |
|
536 |
/**
|
537 |
-
*
|
|
|
|
|
538 |
*
|
539 |
* @since 4.0.0
|
|
|
|
|
540 |
* @return string table tbody HTML
|
541 |
*/
|
542 |
protected function get_table_body_html() {
|
543 |
|
544 |
-
|
545 |
-
|
546 |
-
if ( $this->credit_card_tokens && $this->echeck_tokens ) {
|
547 |
-
|
548 |
-
$html .= sprintf(
|
549 |
-
'<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td></tr>',
|
550 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ),
|
551 |
-
count( $this->get_table_headers() ),
|
552 |
-
esc_html__( 'Credit/Debit Cards', 'woocommerce-plugin-framework' )
|
553 |
-
);
|
554 |
-
|
555 |
-
$html .= $this->get_table_body_row_html( $this->credit_card_tokens );
|
556 |
-
|
557 |
-
$html .= sprintf(
|
558 |
-
'<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td></tr>',
|
559 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ),
|
560 |
-
count( $this->get_table_headers() ),
|
561 |
-
esc_html__( 'Bank Accounts', 'woocommerce-plugin-framework' )
|
562 |
-
);
|
563 |
-
|
564 |
-
$html .= $this->get_table_body_row_html( $this->echeck_tokens );
|
565 |
-
|
566 |
-
} else {
|
567 |
|
568 |
-
|
569 |
-
}
|
570 |
-
|
571 |
-
$html .= '</tbody>';
|
572 |
-
|
573 |
-
/**
|
574 |
-
* My Payment Methods Table Body HTML Filter.
|
575 |
-
*
|
576 |
-
* Allow actors to modify the table body HTML.
|
577 |
-
*
|
578 |
-
* @since 4.0.0
|
579 |
-
*
|
580 |
-
* @param string $html table body HTML
|
581 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
582 |
-
*/
|
583 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_body_html', $html, $this );
|
584 |
}
|
585 |
|
586 |
|
587 |
/**
|
588 |
* Returns the table body row HTML, each row represents a single payment method.
|
589 |
*
|
|
|
|
|
590 |
* @since 4.0.0
|
|
|
591 |
*
|
592 |
* @param SV_WC_Payment_Gateway_Payment_Token[] $tokens token objects
|
593 |
* @return string table tbody > tr HTML
|
594 |
*/
|
595 |
protected function get_table_body_row_html( $tokens ) {
|
596 |
|
597 |
-
|
598 |
-
|
599 |
-
// for responsive table data-title attributes
|
600 |
-
$headers = $this->get_table_headers();
|
601 |
|
602 |
-
|
603 |
-
|
604 |
-
$method = $this->get_table_body_row_data( $token );
|
605 |
-
|
606 |
-
$html .= sprintf(
|
607 |
-
'<tr class="sv-wc-payment-gateway-my-payment-methods-method wc-%1$s-my-payment-methods-method %2$s" data-token-id="%3$s">',
|
608 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ),
|
609 |
-
$token->is_default() ? 'default' : '',
|
610 |
-
esc_attr( $token->get_id() )
|
611 |
-
);
|
612 |
-
|
613 |
-
// Display the row data in the order of the headers
|
614 |
-
foreach ( $headers as $attribute => $attribute_title ) {
|
615 |
-
|
616 |
-
$value = isset( $method[ $attribute ] ) ? $method[ $attribute ] : __( 'N/A', 'woocommerce-plugin-framework' );
|
617 |
-
|
618 |
-
$html .= sprintf(
|
619 |
-
'<td class="sv-wc-payment-gateway-payment-method-%1$s wc-%2$s-payment-method-%1$s" data-title="%4$s">%3$s</td>',
|
620 |
-
sanitize_html_class( $attribute ),
|
621 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ),
|
622 |
-
$value,
|
623 |
-
esc_attr( $attribute_title )
|
624 |
-
);
|
625 |
-
}
|
626 |
-
|
627 |
-
$html .= '</tr>';
|
628 |
-
}
|
629 |
-
|
630 |
-
/**
|
631 |
-
* My Payment Methods Table Row HTML Filter.
|
632 |
-
*
|
633 |
-
* Allow actors to modify the table row HTML.
|
634 |
-
*
|
635 |
-
* @since 4.0.0
|
636 |
-
*
|
637 |
-
* @param string $html table row HTML
|
638 |
-
* @param SV_WC_Payment_Gateway_Payment_Token[] $tokens simple array of token objects
|
639 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
640 |
-
*/
|
641 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_row_html', $html, $tokens, $this );
|
642 |
}
|
643 |
|
644 |
|
645 |
/**
|
646 |
-
*
|
|
|
|
|
647 |
*
|
648 |
* @since 4.0.0
|
|
|
649 |
*
|
650 |
* @param SV_WC_Payment_Gateway_Payment_Token $token the token object
|
651 |
* @return array payment method data suitable for HTML output
|
652 |
*/
|
653 |
protected function get_table_body_row_data( $token ) {
|
654 |
|
655 |
-
|
656 |
-
'title' => $this->get_payment_method_title_html( $token ),
|
657 |
-
'default' => $this->get_payment_method_default_html( $token ),
|
658 |
-
'details' => $this->get_payment_method_details_html( $token ),
|
659 |
-
'actions' => $this->get_payment_method_actions_html( $token ),
|
660 |
-
);
|
661 |
-
|
662 |
-
// add the expiration date if applicable
|
663 |
-
if ( $token->get_exp_month() && $token->get_exp_year() ) {
|
664 |
-
$method['expiry'] = $this->get_payment_method_expiry_html( $token );
|
665 |
-
}
|
666 |
-
|
667 |
-
/**
|
668 |
-
* My Payment Methods Table Body Row Data Filter.
|
669 |
-
*
|
670 |
-
* Allow actors to modify the table body row data.
|
671 |
-
*
|
672 |
-
* @since 4.0.0
|
673 |
-
*
|
674 |
-
* @param array $methods {
|
675 |
-
* @type string $title payment method title
|
676 |
-
* @type string $expiry payment method expiry
|
677 |
-
* @type string $actions actions for payment method
|
678 |
-
* }
|
679 |
-
* @param array $token simple array of SV_WC_Payment_Gateway_Payment_Token objects
|
680 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
681 |
-
*/
|
682 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_body_row_data', $method, $token, $this );
|
683 |
-
}
|
684 |
-
|
685 |
|
686 |
-
|
687 |
-
* Get the payment method title for a given token.
|
688 |
-
*
|
689 |
-
* @since 4.0.0
|
690 |
-
* @deprecated 5.1.0
|
691 |
-
*
|
692 |
-
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
693 |
-
* @return string
|
694 |
-
*/
|
695 |
-
protected function get_payment_method_title( $token ) {
|
696 |
-
|
697 |
-
return $this->get_payment_method_title_html( $token );
|
698 |
}
|
699 |
|
700 |
|
@@ -709,7 +853,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
709 |
protected function get_payment_method_title_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
710 |
|
711 |
$nickname = $token->get_nickname();
|
712 |
-
$title = $
|
713 |
|
714 |
/**
|
715 |
* Filter a token's payment method title.
|
@@ -726,6 +870,8 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
726 |
// add the edit context input
|
727 |
$html .= '<div class="edit" style="display:none;">';
|
728 |
$html .= '<input type="text" class="nickname" name="nickname" value="' . esc_html( $token->get_nickname() ) . '" placeholder="' . esc_attr( __( 'Nickname', 'woocommerce-plugin-framework' ) ) . '" />';
|
|
|
|
|
729 |
$html .= '</div>';
|
730 |
|
731 |
/**
|
@@ -745,29 +891,28 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
745 |
*
|
746 |
* @since 5.1.0
|
747 |
*
|
748 |
-
* @param
|
|
|
749 |
* @return string
|
750 |
*/
|
751 |
-
protected function get_payment_method_default_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
752 |
|
753 |
-
$html = '<
|
754 |
-
$html .= $token->is_default() ? '<mark class="default">' . esc_html__( 'Default', 'woocommerce-plugin-framework' ) . '</mark>' : '';
|
755 |
-
$html .= '</div>';
|
756 |
|
757 |
-
|
758 |
-
$html .= '<div class="edit" style="display:none;">';
|
759 |
-
$html .= '<input type="checkbox" class="default" name="default" value="yes" ' . checked( true, $token->is_default(), false ) . ' />';
|
760 |
-
$html .= '</div>';
|
761 |
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
|
|
|
|
|
|
771 |
}
|
772 |
|
773 |
|
@@ -811,136 +956,57 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
811 |
/**
|
812 |
* Get a token's payment method expiration date HTML.
|
813 |
*
|
|
|
|
|
814 |
* @since 5.1.0
|
|
|
815 |
*
|
816 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
817 |
* @return string
|
818 |
*/
|
819 |
protected function get_payment_method_expiry_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
820 |
|
821 |
-
|
822 |
|
823 |
-
|
824 |
-
|
825 |
-
/**
|
826 |
-
* Filter a token's payment method expiration date HTML.
|
827 |
-
*
|
828 |
-
* @since 5.1.0
|
829 |
-
*
|
830 |
-
* @param string $html expiration date HTML
|
831 |
-
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
832 |
-
*/
|
833 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_method_expiry_html', $html, $token );
|
834 |
}
|
835 |
|
836 |
|
837 |
/**
|
838 |
* Get a token's payment method actions HTML.
|
839 |
*
|
|
|
|
|
840 |
* @since 5.1.0
|
|
|
841 |
*
|
842 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
843 |
* @return string
|
844 |
*/
|
845 |
protected function get_payment_method_actions_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
846 |
|
847 |
-
|
848 |
-
'<a href="#" class="edit-payment-method button">' . esc_html__( 'Edit', 'woocommerce-plugin-framework' ) . '</a>',
|
849 |
-
'<a href="#" class="save-payment-method button" style="display:none">' . esc_html__( 'Save', 'woocommerce-plugin-framework' ) . '</a>',
|
850 |
-
);
|
851 |
-
|
852 |
-
foreach ( $this->get_payment_method_actions( $token ) as $action => $details ) {
|
853 |
|
854 |
-
|
855 |
-
$attributes = isset( $details['attributes'] ) ? (array) $details['attributes'] : array();
|
856 |
-
|
857 |
-
$attributes['data-token-id'] = $token->get_id();
|
858 |
-
$attributes['data-action'] = $action;
|
859 |
-
|
860 |
-
// if the action has a tooltip set
|
861 |
-
if ( ! empty( $details['tip'] ) ) {
|
862 |
-
|
863 |
-
$classes[] = 'tip';
|
864 |
-
|
865 |
-
$attributes['title'] = $details['tip'];
|
866 |
-
}
|
867 |
-
|
868 |
-
// build the attributes
|
869 |
-
foreach ( $attributes as $attribute => $value ) {
|
870 |
-
$attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
|
871 |
-
unset( $attributes[ $attribute ] );
|
872 |
-
}
|
873 |
-
|
874 |
-
// build the button
|
875 |
-
$actions[] = sprintf(
|
876 |
-
( in_array( 'disabled', $classes ) ) ? '<a class="button %2$s" %3$s>%4$s</a>' : '<a href="%1$s" class="button %2$s" %3$s>%4$s</a>',
|
877 |
-
! empty( $details['url'] ) ? esc_url( $details['url'] ) : '#',
|
878 |
-
implode( ' ', array_map( 'sanitize_html_class', $classes ) ),
|
879 |
-
implode( ' ', $attributes ),
|
880 |
-
esc_html( $details['name'] )
|
881 |
-
);
|
882 |
-
}
|
883 |
-
|
884 |
-
$html = implode( '', $actions );
|
885 |
-
|
886 |
-
/**
|
887 |
-
* Filters a token's payment method actions HTML.
|
888 |
-
*
|
889 |
-
* @since 5.1.0
|
890 |
-
*
|
891 |
-
* @param string $html actions HTML
|
892 |
-
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
893 |
-
*/
|
894 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_actions_html', $html, $token );
|
895 |
}
|
896 |
|
897 |
|
898 |
/**
|
899 |
* Gets the actions for the given payment method token.
|
900 |
*
|
|
|
|
|
901 |
* @since 4.0.0
|
|
|
902 |
*
|
903 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
904 |
* @return array
|
905 |
*/
|
906 |
protected function get_payment_method_actions( $token ) {
|
907 |
|
908 |
-
|
909 |
-
'delete' => __( 'Delete', 'woocommerce-plugin-framework' ),
|
910 |
-
);
|
911 |
-
|
912 |
-
$plugin_slug = $this->get_plugin()->get_id_dasherized();
|
913 |
-
|
914 |
-
foreach ( $actions as $action => $label ) {
|
915 |
|
916 |
-
|
917 |
-
"wc-{$plugin_slug}-token" => $token->get_id(),
|
918 |
-
"wc-{$plugin_slug}-action" => $action,
|
919 |
-
) );
|
920 |
-
|
921 |
-
$actions[ $action ] = array(
|
922 |
-
'name' => $label,
|
923 |
-
'url' => wp_nonce_url( $url, "wc-{$plugin_slug}-token-action" ),
|
924 |
-
'class' => "{$action}-payment-method",
|
925 |
-
);
|
926 |
-
}
|
927 |
-
|
928 |
-
/**
|
929 |
-
* My Payment Methods Table Method Actions Filter.
|
930 |
-
*
|
931 |
-
* Allow actors to modify the table method actions.
|
932 |
-
*
|
933 |
-
* @since 4.0.0
|
934 |
-
*
|
935 |
-
* @param $actions array {
|
936 |
-
* @type string $url action URL
|
937 |
-
* @type string $class action button class
|
938 |
-
* @type string $name action button name
|
939 |
-
* }
|
940 |
-
* @param SV_WC_Payment_Gateway_Payment_Token $token
|
941 |
-
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
942 |
-
*/
|
943 |
-
return apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_method_actions', $actions, $token, $this );
|
944 |
}
|
945 |
|
946 |
|
@@ -984,19 +1050,13 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
984 |
// set the data
|
985 |
$token = $this->save_token_data( $token, $data );
|
986 |
|
987 |
-
// use the handler so other methods don't remain default
|
988 |
-
if ( $token->is_default() ) {
|
989 |
-
$gateway->get_payment_tokens_handler()->set_default_token( $user_id, $token );
|
990 |
-
}
|
991 |
-
|
992 |
// persist the data
|
993 |
$gateway->get_payment_tokens_handler()->update_token( $user_id, $token );
|
994 |
|
995 |
-
wp_send_json_success(
|
996 |
-
'
|
997 |
-
'
|
998 |
-
|
999 |
-
) );
|
1000 |
|
1001 |
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
1002 |
|
@@ -1033,26 +1093,21 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
1033 |
$token->set_nickname( $clean_nickname );
|
1034 |
}
|
1035 |
|
1036 |
-
$token->set_default( isset( $data['default'] ) && 'yes' === $data['default'] );
|
1037 |
-
|
1038 |
return $token;
|
1039 |
}
|
1040 |
|
1041 |
|
1042 |
/**
|
1043 |
-
*
|
1044 |
-
*
|
|
|
1045 |
*
|
1046 |
* @since 4.0.0
|
1047 |
*/
|
1048 |
public function handle_payment_method_actions() {
|
1049 |
|
1050 |
-
|
1051 |
-
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
$token = isset( $_GET[ 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token' ] ) ? trim( $_GET[ 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token' ] ) : '';
|
1055 |
-
$action = isset( $_GET[ 'wc-' . $this->get_plugin()->get_id_dasherized() . '-action' ] ) ? $_GET[ 'wc-' . $this->get_plugin()->get_id_dasherized() . '-action' ] : '';
|
1056 |
|
1057 |
// process payment method actions
|
1058 |
if ( $token && $action && ! empty( $_GET['_wpnonce'] ) && is_user_logged_in() ) {
|
@@ -1065,9 +1120,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
1065 |
$this->redirect_to_my_account();
|
1066 |
}
|
1067 |
|
1068 |
-
// current logged in user
|
1069 |
$user_id = get_current_user_id();
|
1070 |
-
|
1071 |
$gateway = $this->get_plugin()->get_gateway_from_token( $user_id, $token );
|
1072 |
|
1073 |
// couldn't find an associated gateway for that token
|
@@ -1078,51 +1131,29 @@ class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
|
|
1078 |
$this->redirect_to_my_account();
|
1079 |
}
|
1080 |
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
} else {
|
1092 |
-
|
1093 |
-
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
1094 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Payment method deleted.', 'woocommerce-plugin-framework' ) );
|
1095 |
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
* @since 5.0.0
|
1100 |
-
*
|
1101 |
-
* @param string $token_id ID of the deleted token
|
1102 |
-
* @param int $user_id user ID
|
1103 |
-
*/
|
1104 |
-
do_action( 'wc_payment_gateway_' . $gateway->get_id() . '_payment_method_deleted', $token, $user_id );
|
1105 |
-
}
|
1106 |
|
1107 |
-
break;
|
1108 |
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
* Fired when a custom action is requested for a payment method (e.g. other than delete/make default)
|
1116 |
-
*
|
1117 |
-
* @since 4.0.0
|
1118 |
-
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
1119 |
-
*/
|
1120 |
-
do_action( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_action_' . sanitize_title( $action ), $this );
|
1121 |
-
break;
|
1122 |
-
}
|
1123 |
|
1124 |
-
|
1125 |
-
}
|
1126 |
}
|
1127 |
|
1128 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
60 |
|
61 |
|
62 |
/**
|
63 |
+
* Sets up the class.
|
64 |
*
|
65 |
* @param SV_WC_Payment_Gateway_Plugin $plugin gateway plugin
|
66 |
+
*
|
67 |
* @since 4.0.0
|
68 |
*/
|
69 |
public function __construct( $plugin ) {
|
87 |
|
88 |
// save a payment method via AJAX
|
89 |
add_action( 'wp_ajax_wc_' . $this->get_plugin()->get_id() . '_save_payment_method', array( $this, 'ajax_save_payment_method' ) );
|
90 |
+
|
91 |
+
add_action( 'woocommerce_payment_token_set_default', [ $this, 'clear_payment_methods_transients' ], 10, 2 );
|
92 |
+
|
93 |
+
add_action( 'woocommerce_payment_token_deleted', [ $this, 'payment_token_deleted' ], 10, 2 );
|
94 |
}
|
95 |
|
96 |
|
131 |
return;
|
132 |
}
|
133 |
|
134 |
+
// initializes tokens as WooCommerce core tokens
|
135 |
$this->load_tokens();
|
136 |
|
137 |
// styles/scripts
|
138 |
add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_styles_scripts' ) );
|
139 |
|
140 |
+
add_filter( 'woocommerce_payment_methods_list_item', [ $this, 'add_payment_methods_list_item_id' ], 10, 2 );
|
141 |
+
add_filter( 'woocommerce_payment_methods_list_item', [ $this, 'add_payment_methods_list_item_edit_action' ], 10, 2 );
|
142 |
+
|
143 |
+
add_filter( 'woocommerce_account_payment_methods_columns', [ $this, 'add_payment_methods_columns' ] );
|
144 |
|
145 |
+
add_action( 'woocommerce_account_payment_methods_column_title', [ $this, 'add_payment_method_title' ] );
|
146 |
+
add_action( 'woocommerce_account_payment_methods_column_details', [ $this, 'add_payment_method_details' ] );
|
147 |
+
add_action( 'woocommerce_account_payment_methods_column_default', [ $this, 'add_payment_method_default' ] );
|
148 |
+
|
149 |
+
// map Framework payment methods actions to WooCommerce actions for backwards compatibility
|
150 |
+
add_action( 'woocommerce_before_account_payment_methods', [ $this, 'before_payment_methods_table' ] );
|
151 |
+
add_action( 'woocommerce_after_account_payment_methods', [ $this, 'after_payment_methods_table'] );
|
152 |
+
|
153 |
+
// handle custom payment method actions
|
154 |
$this->handle_payment_method_actions();
|
155 |
+
|
156 |
+
// render JavaScript used in the My Payment Methods section
|
157 |
+
add_action( 'woocommerce_after_account_payment_methods', [ $this, 'render_js' ] );
|
158 |
}
|
159 |
|
160 |
|
167 |
|
168 |
$handle = 'sv-wc-payment-gateway-my-payment-methods';
|
169 |
|
170 |
+
wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), WC_VERSION, true );
|
|
|
171 |
|
172 |
+
wp_enqueue_style( "$handle-v5_10_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array( 'dashicons' ), SV_WC_Plugin::VERSION );
|
173 |
|
174 |
+
wp_enqueue_script( "$handle-v5_10_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::VERSION );
|
|
|
|
|
|
|
175 |
}
|
176 |
|
177 |
|
178 |
/**
|
179 |
+
* Gets the the available tokens for each plugin gateway and combine them.
|
180 |
*
|
181 |
+
* Tokens are also separated into Credit Card and eCheck-specific class members for convenience.
|
|
|
182 |
*
|
183 |
* @since 4.0.0
|
184 |
*/
|
225 |
|
226 |
|
227 |
/**
|
228 |
+
* Clear the tokens transients after making a method the default,
|
229 |
+
* so that the correct payment method shows as default.
|
230 |
*
|
231 |
+
* @internal
|
232 |
+
*
|
233 |
+
* @since 5.8.0
|
234 |
+
*
|
235 |
+
* @param int $token_id token ID
|
236 |
+
* @param \WC_Payment_Token $token core token object
|
237 |
*/
|
238 |
+
public function clear_payment_methods_transients( $token_id, $token ) {
|
239 |
+
|
240 |
+
foreach ( $this->get_plugin()->get_gateways() as $gateway ) {
|
241 |
+
|
242 |
+
if ( ! $gateway->is_available() || ! ( $gateway->supports_tokenization() && $gateway->tokenization_enabled() ) ) {
|
243 |
+
continue;
|
244 |
+
}
|
245 |
+
|
246 |
+
$gateway->get_payment_tokens_handler()->clear_transient( get_current_user_id() );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Adds the token ID to the token data array.
|
253 |
+
*
|
254 |
+
* @see wc_get_account_saved_payment_methods_list
|
255 |
+
*
|
256 |
+
* @internal
|
257 |
+
*
|
258 |
+
* @since 5.8.0
|
259 |
+
*
|
260 |
+
* @param array $item individual list item from woocommerce_saved_payment_methods_list
|
261 |
+
* @param \WC_Payment_Token $token payment token associated with this method entry
|
262 |
+
* @return array
|
263 |
+
*/
|
264 |
+
public function add_payment_methods_list_item_id( $item, $token ) {
|
265 |
|
266 |
+
$item['token'] = $token->get_token();
|
267 |
+
|
268 |
+
return $item;
|
269 |
+
}
|
270 |
+
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Adds the Edit and Save buttons to the Actions column.
|
274 |
+
*
|
275 |
+
* @see wc_get_account_saved_payment_methods_list
|
276 |
+
*
|
277 |
+
* @internal
|
278 |
+
*
|
279 |
+
* @since 5.8.0
|
280 |
+
*
|
281 |
+
* @param array $item individual list item from woocommerce_saved_payment_methods_list
|
282 |
+
* @param \WC_Payment_Token $core_token payment token associated with this method entry
|
283 |
+
* @return array
|
284 |
+
*/
|
285 |
+
public function add_payment_methods_list_item_edit_action( $item, $core_token ) {
|
286 |
+
|
287 |
+
// add new actions for FW tokens belonging to this gateway
|
288 |
+
if ( $token = $this->get_token_by_id( $core_token->get_token() ) ) {
|
289 |
+
|
290 |
+
$new_actions = [
|
291 |
+
'edit' => [
|
292 |
+
'url' => '#',
|
293 |
+
'name' => esc_html__( 'Edit', 'woocommerce-plugin-framework' ),
|
294 |
+
],
|
295 |
+
'save' => [
|
296 |
+
'url' => '#',
|
297 |
+
'name' => esc_html__( 'Save', 'woocommerce-plugin-framework' ),
|
298 |
+
]
|
299 |
+
];
|
300 |
|
301 |
/**
|
302 |
+
* My Payment Methods Table Method Actions Filter.
|
303 |
*
|
304 |
+
* Allows actors to modify the table method actions.
|
305 |
*
|
306 |
* @since 4.0.0
|
307 |
+
* @since 5.8.0 defining a class for the action button is no longer supported
|
308 |
+
*
|
309 |
+
* @param $actions array {
|
310 |
+
* @type string $url action URL
|
311 |
+
* @type string $name action button name
|
312 |
+
* }
|
313 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token
|
314 |
+
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
315 |
+
*/
|
316 |
+
$custom_actions = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_method_actions', [], $token, $this );
|
317 |
+
|
318 |
+
$item['actions'] = array_merge( $new_actions, $item['actions'], $custom_actions );
|
319 |
+
}
|
320 |
+
|
321 |
+
return $item;
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Adds columns to the payment methods table.
|
327 |
+
*
|
328 |
+
* @internal
|
329 |
+
*
|
330 |
+
* @since 5.8.0
|
331 |
+
*
|
332 |
+
* @param array of table columns in key => Title format
|
333 |
+
* @return array of table columns in key => Title format
|
334 |
+
*/
|
335 |
+
public function add_payment_methods_columns( $columns = [] ) {
|
336 |
+
|
337 |
+
$title_column = [ 'title' => __( 'Title', 'woocommerce-plugin-framework' ) ];
|
338 |
+
$columns = SV_WC_Helper::array_insert_after( $columns, 'method', $title_column );
|
339 |
+
|
340 |
+
$details_column = [ 'details' => __( 'Details', 'woocommerce-plugin-framework' ) ];
|
341 |
+
$columns = SV_WC_Helper::array_insert_after( $columns, 'title', $details_column );
|
342 |
+
|
343 |
+
$default_column = [ 'default' => __( 'Default?', 'woocommerce-plugin-framework' ) ];
|
344 |
+
$columns = SV_WC_Helper::array_insert_after( $columns, 'expires', $default_column );
|
345 |
+
|
346 |
+
/**
|
347 |
+
* My Payment Methods Table Headers Filter.
|
348 |
+
*
|
349 |
+
* Allow actors to modify the table headers.
|
350 |
+
*
|
351 |
+
* In 5.6.0, moved from SV_WC_Payment_Gateway_My_Payment_Methods::get_table_headers() and
|
352 |
+
* renamed the `expires` column (previously `expiry`) for consistency with core column keys.
|
353 |
+
*
|
354 |
+
* @since 4.0.0
|
355 |
+
* @param array $headers table headers {
|
356 |
+
* @type string $method
|
357 |
+
* @type string $title
|
358 |
+
* @type string $details
|
359 |
+
* @type string $expires
|
360 |
+
* @type string $default
|
361 |
+
* @type string $actions
|
362 |
+
* }
|
363 |
+
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
364 |
+
*/
|
365 |
+
$columns = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_headers', $columns, $this );
|
366 |
+
|
367 |
+
// backwards compatibility for 3rd parties using the filter with the old column keys
|
368 |
+
if ( array_key_exists( 'expiry', $columns ) ) {
|
369 |
+
|
370 |
+
$columns['expires'] = $columns['expiry'];
|
371 |
+
unset( $columns['expiry'] );
|
372 |
+
}
|
373 |
+
|
374 |
+
return $columns;
|
375 |
+
}
|
376 |
+
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Gets FW token object from payment method token ID.
|
380 |
+
*
|
381 |
+
* @since 5.8.0
|
382 |
+
*
|
383 |
+
* @param string $token_id token string
|
384 |
+
* @return SV_WC_Payment_Gateway_Payment_Token|null
|
385 |
+
*/
|
386 |
+
private function get_token_by_id( $token_id ) {
|
387 |
+
|
388 |
+
$token = null;
|
389 |
+
|
390 |
+
foreach ( $this->get_plugin()->get_gateways() as $gateway ) {
|
391 |
+
|
392 |
+
$token = $gateway->get_payment_tokens_handler()->get_token( get_current_user_id(), $token_id );
|
393 |
+
|
394 |
+
if ( ! empty( $token ) ) {
|
395 |
+
break;
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
return $token;
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Gets FW token object from payment method data array.
|
405 |
+
*
|
406 |
+
* @since 5.8.0
|
407 |
+
*
|
408 |
+
* @param array $method payment method data array
|
409 |
+
* @return SV_WC_Payment_Gateway_Payment_Token|null
|
410 |
+
*/
|
411 |
+
private function get_token_from_method_data_array( $method ) {
|
412 |
+
|
413 |
+
if ( ! empty( $method['token'] ) ) {
|
414 |
+
return $this->get_token_by_id( $method['token'] );
|
415 |
+
}
|
416 |
+
|
417 |
+
return null;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Adds the Title column content.
|
422 |
+
*
|
423 |
+
* @internal
|
424 |
+
*
|
425 |
+
* @since 5.8.0
|
426 |
+
*
|
427 |
+
* @param array $method payment method
|
428 |
+
*/
|
429 |
+
public function add_payment_method_title( $method ) {
|
430 |
+
|
431 |
+
if ( $token = $this->get_token_from_method_data_array( $method ) ) {
|
432 |
+
|
433 |
+
echo $this->get_payment_method_title_html( $token );
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Adds the Details column content.
|
440 |
+
*
|
441 |
+
* @internal
|
442 |
+
*
|
443 |
+
* @since 5.8.0
|
444 |
+
*
|
445 |
+
* @param array $method payment method
|
446 |
+
*/
|
447 |
+
public function add_payment_method_details( $method ) {
|
448 |
+
|
449 |
+
if ( $token = $this->get_token_from_method_data_array( $method ) ) {
|
450 |
+
|
451 |
+
echo $this->get_payment_method_details_html( $token );
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Adds the Default column content.
|
458 |
+
*
|
459 |
+
* @internal
|
460 |
+
*
|
461 |
+
* @since 5.8.0
|
462 |
+
*
|
463 |
+
* @param array $method payment method
|
464 |
+
*/
|
465 |
+
public function add_payment_method_default( $method ) {
|
466 |
+
|
467 |
+
echo $this->get_payment_method_default_html( ! empty( $method['is_default'] ), $this->get_token_from_method_data_array( $method ) );
|
468 |
+
}
|
469 |
+
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Triggers the wc_{id}_before_my_payment_method_table action.
|
473 |
+
*
|
474 |
+
* @internal
|
475 |
+
*
|
476 |
+
* @since 5.8.0
|
477 |
+
*
|
478 |
+
* @param bool $has_methods whether there any saved payment methods in the table
|
479 |
+
*/
|
480 |
+
public function before_payment_methods_table( $has_methods ) {
|
481 |
+
|
482 |
+
if ( $has_methods ) {
|
483 |
+
|
484 |
+
/**
|
485 |
+
* Before My Payment Methods Table Action.
|
486 |
+
*
|
487 |
+
* Fired before WooCommerce's My Payment Methods table HTML is rendered.
|
488 |
*
|
489 |
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
490 |
+
*
|
491 |
+
* @since 5.8.0 triggered on woocommerce_before_account_payment_methods
|
492 |
+
*
|
493 |
+
* @since 4.0.0
|
494 |
*/
|
495 |
do_action( 'wc_' . $this->get_plugin()->get_id() . '_before_my_payment_method_table', $this );
|
496 |
+
}
|
497 |
+
}
|
498 |
+
|
499 |
+
|
500 |
+
/**
|
501 |
+
* Triggers the wc_{id}_after_my_payment_method_table action.
|
502 |
+
*
|
503 |
+
* @internal
|
504 |
+
*
|
505 |
+
* @since 5.8.0
|
506 |
+
*
|
507 |
+
* @param bool $has_methods whether there any saved payment methods in the table
|
508 |
+
*/
|
509 |
+
public function after_payment_methods_table( $has_methods ) {
|
510 |
|
511 |
+
if ( $has_methods ) {
|
512 |
|
513 |
/**
|
514 |
* After My Payment Methods Table Action.
|
515 |
*
|
516 |
+
* Fired after WooCommerce's My Payment Methods table HTML is rendered.
|
517 |
*
|
518 |
* @since 4.0.0
|
519 |
+
* @since 5.8.0 triggered on woocommerce_after_account_payment_methods
|
520 |
*
|
521 |
* @param SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
522 |
*/
|
526 |
|
527 |
|
528 |
/**
|
529 |
+
* Triggers action wc_payment_gateway_{id}_payment_method_deleted when a framework token is deleted.
|
530 |
*
|
531 |
+
* @internal
|
532 |
+
*
|
533 |
+
* @since 5.8.0
|
534 |
+
*
|
535 |
+
* @param int $core_token_id the ID of a core token
|
536 |
+
* @param \WC_Payment_Token $core_token the core token object
|
537 |
*/
|
538 |
+
public function payment_token_deleted( $core_token_id, $core_token ) {
|
539 |
|
540 |
+
$token_id = null;
|
541 |
+
|
542 |
+
// find out if the core token belongs to one of the gateways from this plugin
|
543 |
+
// we can't use get_token_by_id() here because the FW token and associated core token were already deleted
|
544 |
+
foreach ( $this->get_plugin()->get_gateways() as $gateway ) {
|
545 |
+
|
546 |
+
if ( $gateway->get_id() === $core_token->get_gateway_id() ) {
|
547 |
+
|
548 |
+
$token_id = $core_token->get_token();
|
549 |
+
break;
|
550 |
+
}
|
551 |
}
|
552 |
|
553 |
+
// confirm this is one of the plugin's tokens and that the token was deleted from the Payment Methods screen
|
554 |
+
if ( $token_id && (int) $core_token_id === (int) get_query_var( 'delete-payment-method' ) ) {
|
555 |
+
|
556 |
+
$user_id = get_current_user_id();
|
557 |
+
|
558 |
+
/**
|
559 |
+
* Fires after a new payment method is deleted by a customer.
|
560 |
+
*
|
561 |
+
* @param string $token_id ID of the deleted token
|
562 |
+
* @param int $user_id user ID
|
563 |
+
*
|
564 |
+
* @since 5.0.0
|
565 |
+
*
|
566 |
+
*/
|
567 |
+
do_action( 'wc_payment_gateway_' . $core_token->get_gateway_id() . '_payment_method_deleted', $token_id, $user_id );
|
568 |
+
}
|
569 |
+
}
|
570 |
+
|
571 |
+
|
572 |
+
/**
|
573 |
+
* Renders the payment methods table.
|
574 |
+
*
|
575 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-20 {WV 2020-02-20}
|
576 |
+
*
|
577 |
+
* @internal
|
578 |
+
*
|
579 |
+
* @since 4.0.0
|
580 |
+
* @deprecated 5.8.0
|
581 |
+
*/
|
582 |
+
public function render() {
|
583 |
+
|
584 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
585 |
}
|
586 |
|
587 |
|
717 |
/**
|
718 |
* Return the table title HTML, text defaults to "My Payment Methods"
|
719 |
*
|
720 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
721 |
+
*
|
722 |
* @since 4.0.0
|
723 |
+
* @deprecated 5.8.0
|
724 |
+
*
|
725 |
* @return string table title HTML
|
726 |
*/
|
727 |
protected function get_table_title_html() {
|
728 |
|
729 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
|
731 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
}
|
733 |
|
734 |
|
735 |
/**
|
736 |
+
* Returns the table HTML
|
737 |
+
*
|
738 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
739 |
*
|
740 |
* @since 4.0.0
|
741 |
+
* @deprecated 5.8.0
|
742 |
+
*
|
743 |
* @return string table HTML
|
744 |
*/
|
745 |
public function get_table_html() {
|
746 |
|
747 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
748 |
|
749 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
750 |
}
|
751 |
|
752 |
|
753 |
/**
|
754 |
+
* Returns the table head HTML
|
755 |
+
*
|
756 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
757 |
*
|
758 |
* @since 4.0.0
|
759 |
+
* @deprecated 5.8.0
|
760 |
+
*
|
761 |
* @return string table thead HTML
|
762 |
*/
|
763 |
protected function get_table_head_html() {
|
764 |
|
765 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
766 |
|
767 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
768 |
}
|
769 |
|
770 |
|
771 |
/**
|
772 |
+
* Returns the table headers.
|
773 |
+
*
|
774 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-17 {DM 2020-02-17}
|
775 |
*
|
776 |
* @since 4.0.0
|
777 |
+
* @deprecated 5.8.0
|
778 |
+
*
|
779 |
* @return array of table headers in key => Title format
|
780 |
*/
|
781 |
protected function get_table_headers() {
|
782 |
|
783 |
+
wc_deprecated_function( __METHOD__, '5.8.0', 'SV_WC_Payment_Gateway_My_Payment_Methods::add_payment_methods_columns' );
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
|
785 |
+
return $this->add_payment_methods_columns();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
786 |
}
|
787 |
|
788 |
|
789 |
/**
|
790 |
+
* Returns the table body HTML
|
791 |
+
*
|
792 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
793 |
*
|
794 |
* @since 4.0.0
|
795 |
+
* @deprecated 5.8.0
|
796 |
+
*
|
797 |
* @return string table tbody HTML
|
798 |
*/
|
799 |
protected function get_table_body_html() {
|
800 |
|
801 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
|
803 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
804 |
}
|
805 |
|
806 |
|
807 |
/**
|
808 |
* Returns the table body row HTML, each row represents a single payment method.
|
809 |
*
|
810 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
811 |
+
*
|
812 |
* @since 4.0.0
|
813 |
+
* @deprecated 5.8.0
|
814 |
*
|
815 |
* @param SV_WC_Payment_Gateway_Payment_Token[] $tokens token objects
|
816 |
* @return string table tbody > tr HTML
|
817 |
*/
|
818 |
protected function get_table_body_row_html( $tokens ) {
|
819 |
|
820 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
821 |
|
822 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
}
|
824 |
|
825 |
|
826 |
/**
|
827 |
+
* Gets the payment method data for a given token.
|
828 |
+
*
|
829 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-24 {FN 2020-02-21}
|
830 |
*
|
831 |
* @since 4.0.0
|
832 |
+
* @deprecated 5.8.0
|
833 |
*
|
834 |
* @param SV_WC_Payment_Gateway_Payment_Token $token the token object
|
835 |
* @return array payment method data suitable for HTML output
|
836 |
*/
|
837 |
protected function get_table_body_row_data( $token ) {
|
838 |
|
839 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
840 |
|
841 |
+
return [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
}
|
843 |
|
844 |
|
853 |
protected function get_payment_method_title_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
854 |
|
855 |
$nickname = $token->get_nickname();
|
856 |
+
$title = $nickname ?: $token->get_type_full();
|
857 |
|
858 |
/**
|
859 |
* Filter a token's payment method title.
|
870 |
// add the edit context input
|
871 |
$html .= '<div class="edit" style="display:none;">';
|
872 |
$html .= '<input type="text" class="nickname" name="nickname" value="' . esc_html( $token->get_nickname() ) . '" placeholder="' . esc_attr( __( 'Nickname', 'woocommerce-plugin-framework' ) ) . '" />';
|
873 |
+
$html .= '<input type="hidden" name="token-id" value="' . esc_attr( $token->get_id() ) . '" />';
|
874 |
+
$html .= '<input type="hidden" name="plugin-id" value="' . esc_attr( $this->get_plugin()->get_id_dasherized() ) . '" />';
|
875 |
$html .= '</div>';
|
876 |
|
877 |
/**
|
891 |
*
|
892 |
* @since 5.1.0
|
893 |
*
|
894 |
+
* @param boolean $is_default true if the token is the default token
|
895 |
+
* @param SV_WC_Payment_Gateway_Payment_Token|null $token FW token object, only set if the token is a FW token
|
896 |
* @return string
|
897 |
*/
|
898 |
+
protected function get_payment_method_default_html( $is_default = false, SV_WC_Payment_Gateway_Payment_Token $token = null ) {
|
899 |
|
900 |
+
$html = $is_default ? '<mark class="default">' . esc_html__( 'Default', 'woocommerce-plugin-framework' ) . '</mark>' : '';
|
|
|
|
|
901 |
|
902 |
+
if ( $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
|
|
|
|
|
|
903 |
|
904 |
+
/**
|
905 |
+
* Filter a FW token's payment method "default" flag HTML.
|
906 |
+
*
|
907 |
+
* @since 5.1.0
|
908 |
+
*
|
909 |
+
* @param string $html "default" flag HTML
|
910 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
911 |
+
*/
|
912 |
+
$html = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_method_default_html', $html, $token );
|
913 |
+
}
|
914 |
+
|
915 |
+
return $html;
|
916 |
}
|
917 |
|
918 |
|
956 |
/**
|
957 |
* Get a token's payment method expiration date HTML.
|
958 |
*
|
959 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
960 |
+
*
|
961 |
* @since 5.1.0
|
962 |
+
* @deprecated 5.8.0
|
963 |
*
|
964 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
965 |
* @return string
|
966 |
*/
|
967 |
protected function get_payment_method_expiry_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
968 |
|
969 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
970 |
|
971 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
972 |
}
|
973 |
|
974 |
|
975 |
/**
|
976 |
* Get a token's payment method actions HTML.
|
977 |
*
|
978 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
979 |
+
*
|
980 |
* @since 5.1.0
|
981 |
+
* @deprecated 5.8.0
|
982 |
*
|
983 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
984 |
* @return string
|
985 |
*/
|
986 |
protected function get_payment_method_actions_html( SV_WC_Payment_Gateway_Payment_Token $token ) {
|
987 |
|
988 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
989 |
|
990 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
991 |
}
|
992 |
|
993 |
|
994 |
/**
|
995 |
* Gets the actions for the given payment method token.
|
996 |
*
|
997 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-21 {WV 2020-02-21}
|
998 |
+
*
|
999 |
* @since 4.0.0
|
1000 |
+
* @deprecated 5.8.0
|
1001 |
*
|
1002 |
* @param SV_WC_Payment_Gateway_Payment_Token $token token object
|
1003 |
* @return array
|
1004 |
*/
|
1005 |
protected function get_payment_method_actions( $token ) {
|
1006 |
|
1007 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
1008 |
|
1009 |
+
return [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1010 |
}
|
1011 |
|
1012 |
|
1050 |
// set the data
|
1051 |
$token = $this->save_token_data( $token, $data );
|
1052 |
|
|
|
|
|
|
|
|
|
|
|
1053 |
// persist the data
|
1054 |
$gateway->get_payment_tokens_handler()->update_token( $user_id, $token );
|
1055 |
|
1056 |
+
wp_send_json_success( [
|
1057 |
+
'title' => $this->get_payment_method_title_html( $token ),
|
1058 |
+
'nonce' => wp_create_nonce( 'wc_' . $this->get_plugin()->get_id() . '_save_payment_method' ),
|
1059 |
+
] );
|
|
|
1060 |
|
1061 |
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
1062 |
|
1093 |
$token->set_nickname( $clean_nickname );
|
1094 |
}
|
1095 |
|
|
|
|
|
1096 |
return $token;
|
1097 |
}
|
1098 |
|
1099 |
|
1100 |
/**
|
1101 |
+
* Handles custom payment methods actions.
|
1102 |
+
*
|
1103 |
+
* @internal
|
1104 |
*
|
1105 |
* @since 4.0.0
|
1106 |
*/
|
1107 |
public function handle_payment_method_actions() {
|
1108 |
|
1109 |
+
$token = trim( SV_WC_Helper::get_requested_value( 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token' ) );
|
1110 |
+
$action = SV_WC_Helper::get_requested_value( 'wc-' . $this->get_plugin()->get_id_dasherized() . '-action' );
|
|
|
|
|
|
|
|
|
1111 |
|
1112 |
// process payment method actions
|
1113 |
if ( $token && $action && ! empty( $_GET['_wpnonce'] ) && is_user_logged_in() ) {
|
1120 |
$this->redirect_to_my_account();
|
1121 |
}
|
1122 |
|
|
|
1123 |
$user_id = get_current_user_id();
|
|
|
1124 |
$gateway = $this->get_plugin()->get_gateway_from_token( $user_id, $token );
|
1125 |
|
1126 |
// couldn't find an associated gateway for that token
|
1131 |
$this->redirect_to_my_account();
|
1132 |
}
|
1133 |
|
1134 |
+
/**
|
1135 |
+
* My Payment Methods Custom Action.
|
1136 |
+
*
|
1137 |
+
* Fired when a custom action is requested for a payment method (e.g. other than delete/make default)
|
1138 |
+
*
|
1139 |
+
* @since 4.0.0
|
1140 |
+
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
1141 |
+
*/
|
1142 |
+
do_action( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_action_' . sanitize_title( $action ), $this );
|
|
|
|
|
|
|
|
|
|
|
1143 |
|
1144 |
+
$this->redirect_to_my_account();
|
1145 |
+
}
|
1146 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
|
|
|
1148 |
|
1149 |
+
/**
|
1150 |
+
* Renders the JavaScript.
|
1151 |
+
*
|
1152 |
+
* @since 5.1.0
|
1153 |
+
*/
|
1154 |
+
public function render_js() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1155 |
|
1156 |
+
wc_enqueue_js( $this->get_safe_handler_js() );
|
|
|
1157 |
}
|
1158 |
|
1159 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -977,7 +977,11 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
|
|
977 |
*/
|
978 |
protected function render_payment_field( $field ) {
|
979 |
|
980 |
-
woocommerce_form_field(
|
|
|
|
|
|
|
|
|
981 |
}
|
982 |
|
983 |
|
@@ -1055,7 +1059,13 @@ class SV_WC_Payment_Gateway_Payment_Form extends Handlers\Script_Handler {
|
|
1055 |
];
|
1056 |
|
1057 |
if ( $this->get_gateway()->supports_card_types() ) {
|
1058 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
}
|
1060 |
|
1061 |
return $args;
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Form' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
977 |
*/
|
978 |
protected function render_payment_field( $field ) {
|
979 |
|
980 |
+
woocommerce_form_field(
|
981 |
+
isset( $field['name'] ) ? $field['name'] : null,
|
982 |
+
$field,
|
983 |
+
isset( $field['value'] ) ? $field['value'] : null
|
984 |
+
);
|
985 |
}
|
986 |
|
987 |
|
1059 |
];
|
1060 |
|
1061 |
if ( $this->get_gateway()->supports_card_types() ) {
|
1062 |
+
|
1063 |
+
$card_types = $this->get_gateway()->get_card_types();
|
1064 |
+
|
1065 |
+
if ( is_array( $card_types ) && ! empty( $card_types ) ) {
|
1066 |
+
|
1067 |
+
$args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types );
|
1068 |
+
}
|
1069 |
}
|
1070 |
|
1071 |
return $args;
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php
CHANGED
@@ -22,14 +22,16 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
28 |
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
|
|
|
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
32 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
33 |
|
34 |
|
35 |
/**
|
@@ -103,6 +105,9 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
103 |
/** @var SV_WC_Payment_Gateway_Apple_Pay the Apple Pay handler instance */
|
104 |
private $apple_pay;
|
105 |
|
|
|
|
|
|
|
106 |
|
107 |
/**
|
108 |
* Initializes the plugin.
|
@@ -185,6 +190,9 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
185 |
// apple pay feature
|
186 |
add_action( 'init', array( $this, 'maybe_init_apple_pay' ) );
|
187 |
|
|
|
|
|
|
|
188 |
// TODO: move these to Subscriptions integration
|
189 |
if ( $this->is_subscriptions_active() ) {
|
190 |
|
@@ -294,13 +302,24 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
294 |
require_once( $payment_gateway_framework_path . '/Handlers/Abstract_Hosted_Payment_Handler.php' );
|
295 |
require_once( $payment_gateway_framework_path . '/Handlers/Capture.php' );
|
296 |
|
297 |
-
//
|
298 |
-
require_once( "{$payment_gateway_framework_path}/
|
299 |
-
require_once( "{$payment_gateway_framework_path}/
|
300 |
-
require_once( "{$payment_gateway_framework_path}/
|
301 |
-
require_once( "{$payment_gateway_framework_path}/
|
302 |
-
|
303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
|
305 |
// payment tokens
|
306 |
require_once( $payment_gateway_framework_path . '/payment-tokens/class-sv-wc-payment-gateway-payment-token.php' );
|
@@ -494,6 +513,72 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
494 |
}
|
495 |
|
496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
/** Admin methods ******************************************************/
|
498 |
|
499 |
|
@@ -584,6 +669,8 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
584 |
$this->add_gateway_not_configured_notices();
|
585 |
|
586 |
$this->add_apple_pay_not_supported_notices();
|
|
|
|
|
587 |
}
|
588 |
|
589 |
|
@@ -836,6 +923,30 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
836 |
}
|
837 |
|
838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
/** Integration methods ***************************************************/
|
840 |
|
841 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
28 |
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
29 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout;
|
30 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay;
|
31 |
|
32 |
defined( 'ABSPATH' ) or exit;
|
33 |
|
34 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Plugin' ) ) :
|
35 |
|
36 |
|
37 |
/**
|
105 |
/** @var SV_WC_Payment_Gateway_Apple_Pay the Apple Pay handler instance */
|
106 |
private $apple_pay;
|
107 |
|
108 |
+
/** @var Google_Pay the Google Pay handler instance */
|
109 |
+
private $google_pay;
|
110 |
+
|
111 |
|
112 |
/**
|
113 |
* Initializes the plugin.
|
190 |
// apple pay feature
|
191 |
add_action( 'init', array( $this, 'maybe_init_apple_pay' ) );
|
192 |
|
193 |
+
// Google Pay feature
|
194 |
+
add_action( 'init', [ $this, 'maybe_init_google_pay' ] );
|
195 |
+
|
196 |
// TODO: move these to Subscriptions integration
|
197 |
if ( $this->is_subscriptions_active() ) {
|
198 |
|
302 |
require_once( $payment_gateway_framework_path . '/Handlers/Abstract_Hosted_Payment_Handler.php' );
|
303 |
require_once( $payment_gateway_framework_path . '/Handlers/Capture.php' );
|
304 |
|
305 |
+
// External Checkout
|
306 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/External_Checkout.php" );
|
307 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Admin.php" );
|
308 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Frontend.php" );
|
309 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Orders.php" );
|
310 |
+
|
311 |
+
// Apple Pay
|
312 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php" );
|
313 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php" );
|
314 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php" );
|
315 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php" );
|
316 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php" );
|
317 |
+
|
318 |
+
// Google Pay
|
319 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Google_Pay/Google_Pay.php" );
|
320 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Google_Pay/Admin.php" );
|
321 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Google_Pay/AJAX.php" );
|
322 |
+
require_once( "{$payment_gateway_framework_path}/External_Checkout/Google_Pay/Frontend.php" );
|
323 |
|
324 |
// payment tokens
|
325 |
require_once( $payment_gateway_framework_path . '/payment-tokens/class-sv-wc-payment-gateway-payment-token.php' );
|
513 |
}
|
514 |
|
515 |
|
516 |
+
/** Google Pay *************************************************************/
|
517 |
+
|
518 |
+
|
519 |
+
/**
|
520 |
+
* Initializes Google Pay if it's supported.
|
521 |
+
*
|
522 |
+
* @since 5.10.0
|
523 |
+
*/
|
524 |
+
public function maybe_init_google_pay() {
|
525 |
+
|
526 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte( '3.2' ) && $this->supports_google_pay() ) {
|
527 |
+
$this->google_pay = $this->build_google_pay_instance();
|
528 |
+
}
|
529 |
+
}
|
530 |
+
|
531 |
+
|
532 |
+
/**
|
533 |
+
* Builds the Google Pay handler instance.
|
534 |
+
*
|
535 |
+
* Gateways can override this to define their own Google Pay class.
|
536 |
+
*
|
537 |
+
* @since 5.10.0
|
538 |
+
*
|
539 |
+
* @return Google_Pay
|
540 |
+
*/
|
541 |
+
protected function build_google_pay_instance() {
|
542 |
+
|
543 |
+
return new Google_Pay( $this );
|
544 |
+
}
|
545 |
+
|
546 |
+
|
547 |
+
/**
|
548 |
+
* Gets the Google Pay handler instance.
|
549 |
+
*
|
550 |
+
* @since 5.10.0
|
551 |
+
*
|
552 |
+
* @return Google_Pay
|
553 |
+
*/
|
554 |
+
public function get_google_pay_instance() {
|
555 |
+
|
556 |
+
return $this->google_pay;
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
/**
|
561 |
+
* Determines if this plugin has any gateways with Google Pay support.
|
562 |
+
*
|
563 |
+
* @since 5.10.0
|
564 |
+
*
|
565 |
+
* @return bool
|
566 |
+
*/
|
567 |
+
public function supports_google_pay() {
|
568 |
+
|
569 |
+
$is_supported = false;
|
570 |
+
|
571 |
+
foreach ( $this->get_gateways() as $gateway ) {
|
572 |
+
|
573 |
+
if ( $gateway->supports_google_pay() ) {
|
574 |
+
$is_supported = true;
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
return $is_supported;
|
579 |
+
}
|
580 |
+
|
581 |
+
|
582 |
/** Admin methods ******************************************************/
|
583 |
|
584 |
|
669 |
$this->add_gateway_not_configured_notices();
|
670 |
|
671 |
$this->add_apple_pay_not_supported_notices();
|
672 |
+
|
673 |
+
$this->add_google_pay_not_supported_notices();
|
674 |
}
|
675 |
|
676 |
|
923 |
}
|
924 |
|
925 |
|
926 |
+
/**
|
927 |
+
* Adds notices about Google Pay not supported in the current WooCommerce version.
|
928 |
+
*
|
929 |
+
* @since 5.10.0
|
930 |
+
*/
|
931 |
+
protected function add_google_pay_not_supported_notices() {
|
932 |
+
|
933 |
+
if ( 'wc-settings' === SV_WC_Helper::get_requested_value( 'page' ) && SV_WC_Plugin_Compatibility::is_wc_version_lt( '3.2' ) && $this->supports_google_pay() ) {
|
934 |
+
|
935 |
+
$this->get_admin_notice_handler()->add_admin_notice(
|
936 |
+
sprintf(
|
937 |
+
/* translators: Placeholders: %1$s - plugin name, %2$s - opening <a> HTML link tag, %3$s - closing </a> HTML link tag */
|
938 |
+
__( 'Heads up! Google Pay for %1$s requires WooCommerce version 3.2 or greater. Please %2$supdate WooCommerce%3$s.', 'woocommerce-plugin-framework' ),
|
939 |
+
$this->get_plugin_name(),
|
940 |
+
'<a href="' . esc_url( admin_url( 'update-core.php' ) ) .'">',
|
941 |
+
'</a>'
|
942 |
+
),
|
943 |
+
$this->get_id_dasherized() . '-google-pay-requires-wc-version-3-2',
|
944 |
+
[ 'notice_class' => 'error' ]
|
945 |
+
);
|
946 |
+
}
|
947 |
+
}
|
948 |
+
|
949 |
+
|
950 |
/** Integration methods ***************************************************/
|
951 |
|
952 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Privacy' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -124,6 +124,9 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
124 |
/** Apple Pay feature */
|
125 |
const FEATURE_APPLE_PAY = 'apple_pay';
|
126 |
|
|
|
|
|
|
|
127 |
/** Admin token editor feature */
|
128 |
const FEATURE_TOKEN_EDITOR = 'token_editor';
|
129 |
|
@@ -381,7 +384,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
381 |
protected function load_shared_settings() {
|
382 |
|
383 |
// get any other sibling gateways
|
384 |
-
$other_gateway_ids =
|
385 |
|
386 |
// determine if any sibling gateways have any configured shared settings
|
387 |
foreach ( $other_gateway_ids as $other_gateway_id ) {
|
@@ -407,6 +410,19 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
407 |
}
|
408 |
|
409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
/**
|
411 |
* Enqueue the necessary scripts & styles for the gateway, including the
|
412 |
* payment form assets (if supported) and any gateway-specific assets.
|
@@ -444,10 +460,10 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
444 |
}
|
445 |
|
446 |
$handle = 'sv-wc-payment-gateway-payment-form';
|
447 |
-
$versioned_handle = $handle . '-
|
448 |
|
449 |
// Frontend JS
|
450 |
-
wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/
|
451 |
|
452 |
// Frontend CSS
|
453 |
wp_enqueue_style( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array(), SV_WC_Plugin::VERSION );
|
@@ -761,7 +777,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
761 |
*/
|
762 |
public function payment_fields() {
|
763 |
|
764 |
-
if ( $this->supports_payment_form() ) {
|
765 |
|
766 |
$this->get_payment_form_instance()->render();
|
767 |
|
@@ -1134,6 +1150,63 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1134 |
}
|
1135 |
|
1136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1137 |
/**
|
1138 |
* Get the default payment method title, which is configurable within the
|
1139 |
* admin and displayed on checkout
|
@@ -1270,7 +1343,10 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1270 |
|
1271 |
// add the special 'shared-settings-field' class name to any shared settings fields
|
1272 |
foreach ( $this->shared_settings as $field_name ) {
|
1273 |
-
|
|
|
|
|
|
|
1274 |
}
|
1275 |
|
1276 |
/**
|
@@ -1335,7 +1411,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1335 |
protected function add_shared_settings_form_fields( $form_fields ) {
|
1336 |
|
1337 |
// get any sibling gateways
|
1338 |
-
$other_gateway_ids =
|
1339 |
$configured_other_gateway_ids = array();
|
1340 |
$inherit_settings_other_gateway_ids = array();
|
1341 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
124 |
/** Apple Pay feature */
|
125 |
const FEATURE_APPLE_PAY = 'apple_pay';
|
126 |
|
127 |
+
/** Google Pay feature */
|
128 |
+
const FEATURE_GOOGLE_PAY = 'google_pay';
|
129 |
+
|
130 |
/** Admin token editor feature */
|
131 |
const FEATURE_TOKEN_EDITOR = 'token_editor';
|
132 |
|
384 |
protected function load_shared_settings() {
|
385 |
|
386 |
// get any other sibling gateways
|
387 |
+
$other_gateway_ids = $this->get_ids_of_gateways_to_inherit_settings_from();
|
388 |
|
389 |
// determine if any sibling gateways have any configured shared settings
|
390 |
foreach ( $other_gateway_ids as $other_gateway_id ) {
|
410 |
}
|
411 |
|
412 |
|
413 |
+
/**
|
414 |
+
* Gets the IDs of sibling gateways that this gateway can inherit settings from.
|
415 |
+
*
|
416 |
+
* @since 5.10.0
|
417 |
+
*
|
418 |
+
* @return array
|
419 |
+
*/
|
420 |
+
protected function get_ids_of_gateways_to_inherit_settings_from() {
|
421 |
+
|
422 |
+
return array_diff( $this->get_plugin()->get_gateway_ids(), [ $this->get_id() ] );
|
423 |
+
}
|
424 |
+
|
425 |
+
|
426 |
/**
|
427 |
* Enqueue the necessary scripts & styles for the gateway, including the
|
428 |
* payment form assets (if supported) and any gateway-specific assets.
|
460 |
}
|
461 |
|
462 |
$handle = 'sv-wc-payment-gateway-payment-form';
|
463 |
+
$versioned_handle = $handle . '-v5_10_5';
|
464 |
|
465 |
// Frontend JS
|
466 |
+
wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-payment' ), SV_WC_Plugin::VERSION, true );
|
467 |
|
468 |
// Frontend CSS
|
469 |
wp_enqueue_style( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array(), SV_WC_Plugin::VERSION );
|
777 |
*/
|
778 |
public function payment_fields() {
|
779 |
|
780 |
+
if ( $this->get_payment_form_instance() && is_callable( [ $this->get_payment_form_instance(), 'render' ] ) && $this->supports_payment_form() ) {
|
781 |
|
782 |
$this->get_payment_form_instance()->render();
|
783 |
|
1150 |
}
|
1151 |
|
1152 |
|
1153 |
+
/** Google Pay Feature *****************************************************/
|
1154 |
+
|
1155 |
+
|
1156 |
+
/**
|
1157 |
+
* Determines whether this gateway supports Google Pay.
|
1158 |
+
*
|
1159 |
+
* @since 5.10.0
|
1160 |
+
*
|
1161 |
+
* @return bool
|
1162 |
+
*/
|
1163 |
+
public function supports_google_pay() {
|
1164 |
+
|
1165 |
+
return $this->supports( self::FEATURE_GOOGLE_PAY );
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
|
1169 |
+
/**
|
1170 |
+
* Gets the currencies supported by Google Pay.
|
1171 |
+
*
|
1172 |
+
* This method should be overwritten by any gateway that needs to restrict the supported currencies.
|
1173 |
+
*
|
1174 |
+
* @since 5.10.0
|
1175 |
+
*
|
1176 |
+
* @return array
|
1177 |
+
*/
|
1178 |
+
public function get_google_pay_currencies() {
|
1179 |
+
|
1180 |
+
return [];
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
|
1184 |
+
/**
|
1185 |
+
* Adds the Google Pay payment data to the order object.
|
1186 |
+
*
|
1187 |
+
* Gateways should override this to set the appropriate values depending on
|
1188 |
+
* how their processing API needs to handle the data.
|
1189 |
+
*
|
1190 |
+
* @since 5.10.0
|
1191 |
+
*
|
1192 |
+
* @param \WC_Order the order object
|
1193 |
+
* @param mixed|array $response_data authorized payment response data
|
1194 |
+
* @return \WC_Order
|
1195 |
+
*/
|
1196 |
+
public function get_order_for_google_pay( \WC_Order $order, $response_data ) {
|
1197 |
+
|
1198 |
+
$payment_method_data = $response_data['paymentMethodData'];
|
1199 |
+
|
1200 |
+
$order->payment->google_pay = base64_encode( $payment_method_data['tokenizationData']['token'] );
|
1201 |
+
|
1202 |
+
// account last four
|
1203 |
+
$order->payment->account_number = $payment_method_data['info']['cardDetails'];
|
1204 |
+
$order->payment->card_type = SV_WC_Payment_Gateway_Helper::normalize_card_type( $payment_method_data['info']['cardNetwork'] );
|
1205 |
+
|
1206 |
+
return $order;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
|
1210 |
/**
|
1211 |
* Get the default payment method title, which is configurable within the
|
1212 |
* admin and displayed on checkout
|
1343 |
|
1344 |
// add the special 'shared-settings-field' class name to any shared settings fields
|
1345 |
foreach ( $this->shared_settings as $field_name ) {
|
1346 |
+
|
1347 |
+
if ( ! empty( $this->form_fields[ $field_name ] ) ) {
|
1348 |
+
$this->form_fields[ $field_name ]['class'] = trim( isset( $this->form_fields[ $field_name ]['class'] ) ? $this->form_fields[ $field_name ]['class'] : '' ) . ' shared-settings-field';
|
1349 |
+
}
|
1350 |
}
|
1351 |
|
1352 |
/**
|
1411 |
protected function add_shared_settings_form_fields( $form_fields ) {
|
1412 |
|
1413 |
// get any sibling gateways
|
1414 |
+
$other_gateway_ids = $this->get_ids_of_gateways_to_inherit_settings_from();
|
1415 |
$configured_other_gateway_ids = array();
|
1416 |
$inherit_settings_other_gateway_ids = array();
|
1417 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Exception' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -169,8 +169,8 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
169 |
$order->payment->card_type = $token->get_card_type();
|
170 |
|
171 |
// exp month/year
|
172 |
-
$order->payment->exp_month
|
173 |
-
$order->payment->exp_year
|
174 |
|
175 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
176 |
|
@@ -195,8 +195,8 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
195 |
|
196 |
list( $exp_year, $exp_month ) = explode( '-', $expiry_date );
|
197 |
|
198 |
-
$order->payment->exp_month
|
199 |
-
$order->payment->exp_year
|
200 |
}
|
201 |
|
202 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
169 |
$order->payment->card_type = $token->get_card_type();
|
170 |
|
171 |
// exp month/year
|
172 |
+
$order->payment->exp_month = $token->get_exp_month();
|
173 |
+
$order->payment->exp_year = SV_WC_Payment_Gateway_Helper::format_exp_year( $token->get_exp_year() );
|
174 |
|
175 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
176 |
|
195 |
|
196 |
list( $exp_year, $exp_month ) = explode( '-', $expiry_date );
|
197 |
|
198 |
+
$order->payment->exp_month = $exp_month;
|
199 |
+
$order->payment->exp_year = SV_WC_Payment_Gateway_Helper::format_exp_year( $exp_year );
|
200 |
}
|
201 |
|
202 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -76,6 +76,9 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
76 |
'subscription_payment_method_change_admin',
|
77 |
) );
|
78 |
|
|
|
|
|
|
|
79 |
// force tokenization when needed
|
80 |
add_filter( 'wc_payment_gateway_' . $this->get_gateway()->get_id() . '_tokenization_forced', array( $this, 'maybe_force_tokenization' ) );
|
81 |
|
@@ -114,8 +117,8 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
114 |
/* My Payment Methods */
|
115 |
|
116 |
add_filter( 'wc_' . $this->get_gateway()->get_plugin()->get_id() . '_my_payment_methods_table_headers', array( $this, 'add_my_payment_methods_table_header' ), 10, 2 );
|
117 |
-
|
118 |
-
add_filter( '
|
119 |
|
120 |
/* Admin Change Payment Method support */
|
121 |
|
@@ -134,6 +137,26 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
134 |
}
|
135 |
}
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
/**
|
138 |
* Force tokenization for subscriptions, this can be forced either during checkout
|
139 |
* or when the payment method for a subscription is being changed
|
@@ -376,7 +399,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
376 |
|
377 |
$order->payment->card_type = $token->get_card_type();
|
378 |
$order->payment->exp_month = $token->get_exp_month();
|
379 |
-
$order->payment->exp_year = $token->get_exp_year();
|
380 |
|
381 |
} elseif ( $token->is_echeck() ) {
|
382 |
|
@@ -661,10 +684,75 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
661 |
}
|
662 |
|
663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
/**
|
665 |
* Add a subscriptions header to the My Payment Methods table.
|
666 |
*
|
|
|
|
|
|
|
|
|
667 |
* @since 4.3.0
|
|
|
|
|
668 |
* @param array $method the table row data
|
669 |
* @param \SV_WC_Payment_Gateway_Payment_Token $token the payment token
|
670 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods the my payment methods instance
|
@@ -672,21 +760,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
672 |
*/
|
673 |
public function add_my_payment_methods_table_body_row_data( $method, $token, $handler ) {
|
674 |
|
675 |
-
|
676 |
-
if ( isset( $method['subscriptions'] ) || str_replace( '_', '-', $token->get_type() ) !== $this->get_gateway()->get_payment_type() ) {
|
677 |
-
return $method;
|
678 |
-
}
|
679 |
-
|
680 |
-
$subscription_ids = array();
|
681 |
-
|
682 |
-
// Build a link for each subscription
|
683 |
-
foreach ( $this->get_payment_token_subscriptions( get_current_user_id(), $token ) as $subscription ) {
|
684 |
-
$subscription_ids[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $subscription->get_view_order_url() ), esc_attr( sprintf( _x( '#%s', 'hash before order number', 'woocommerce-plugin-framework' ), $subscription->get_order_number() ) ) );
|
685 |
-
}
|
686 |
-
|
687 |
-
if ( ! empty( $subscription_ids ) ) {
|
688 |
-
$method['subscriptions'] = implode( ', ', $subscription_ids );
|
689 |
-
}
|
690 |
|
691 |
return $method;
|
692 |
}
|
@@ -695,7 +769,12 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
695 |
/**
|
696 |
* Disables the "Delete" My Payment Methods method action button if there is an associated subscription.
|
697 |
*
|
|
|
|
|
|
|
|
|
698 |
* @since 4.3.0
|
|
|
699 |
*
|
700 |
* @param array $actions the token actions
|
701 |
* @param SV_WC_Payment_Gateway_Payment_Token the token object
|
@@ -704,24 +783,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
704 |
*/
|
705 |
public function disable_my_payment_methods_table_method_delete( $actions, $token, $handler ) {
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
$subscriptions = $this->get_payment_token_subscriptions( get_current_user_id(), $token );
|
710 |
-
|
711 |
-
// Check each subscription for the ability to change the payment method
|
712 |
-
foreach ( $subscriptions as $subscription ) {
|
713 |
-
|
714 |
-
if ( $subscription->can_be_updated_to( 'new-payment-method' ) ) {
|
715 |
-
$disable_delete = true;
|
716 |
-
break;
|
717 |
-
}
|
718 |
-
}
|
719 |
-
|
720 |
-
// if at least one can be changed, no deleting for you!
|
721 |
-
if ( isset( $actions['delete'] ) && $disable_delete ) {
|
722 |
-
$actions['delete']['class'] = array_merge( (array) $actions['delete']['class'], array( 'disabled' ) );
|
723 |
-
$actions['delete']['tip'] = __( 'This payment method is tied to a subscription and cannot be deleted. Please switch the subscription to another method first.', 'woocommerce-plugin-framework' );
|
724 |
-
}
|
725 |
|
726 |
return $actions;
|
727 |
}
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
76 |
'subscription_payment_method_change_admin',
|
77 |
) );
|
78 |
|
79 |
+
// disable default payment token change notice if wc_add_notice() is not available
|
80 |
+
add_action( 'admin_init', [ $this, 'disable_default_payment_token_change_notice' ] );
|
81 |
+
|
82 |
// force tokenization when needed
|
83 |
add_filter( 'wc_payment_gateway_' . $this->get_gateway()->get_id() . '_tokenization_forced', array( $this, 'maybe_force_tokenization' ) );
|
84 |
|
117 |
/* My Payment Methods */
|
118 |
|
119 |
add_filter( 'wc_' . $this->get_gateway()->get_plugin()->get_id() . '_my_payment_methods_table_headers', array( $this, 'add_my_payment_methods_table_header' ), 10, 2 );
|
120 |
+
|
121 |
+
add_filter( 'woocommerce_account_payment_methods_column_subscriptions', [ $this, 'add_payment_method_subscriptions' ] );
|
122 |
|
123 |
/* Admin Change Payment Method support */
|
124 |
|
137 |
}
|
138 |
}
|
139 |
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Disables Subscription's default payment token change notice if wc_add_notice() is not defined
|
143 |
+
*
|
144 |
+
* This prevents an uncaught error from being triggered when tokens are retrieved and saved in the user profile page.
|
145 |
+
*
|
146 |
+
* @internal
|
147 |
+
*
|
148 |
+
* @see \WCS_My_Account_Payment_Methods::display_default_payment_token_change_notice()
|
149 |
+
*
|
150 |
+
* @since 5.8.0
|
151 |
+
*/
|
152 |
+
public function disable_default_payment_token_change_notice() {
|
153 |
+
|
154 |
+
if ( ! function_exists( 'wc_add_notice' ) ) {
|
155 |
+
remove_action( 'woocommerce_payment_token_set_default', [ 'WCS_My_Account_Payment_Methods', 'display_default_payment_token_change_notice' ], 10, 2 );
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
/**
|
161 |
* Force tokenization for subscriptions, this can be forced either during checkout
|
162 |
* or when the payment method for a subscription is being changed
|
399 |
|
400 |
$order->payment->card_type = $token->get_card_type();
|
401 |
$order->payment->exp_month = $token->get_exp_month();
|
402 |
+
$order->payment->exp_year = SV_WC_Payment_Gateway_Helper::format_exp_year( $token->get_exp_year() );
|
403 |
|
404 |
} elseif ( $token->is_echeck() ) {
|
405 |
|
684 |
}
|
685 |
|
686 |
|
687 |
+
/**
|
688 |
+
* Displays a list of subscriptions orders associated with the current token.
|
689 |
+
*
|
690 |
+
* This method only generates output for tokens created by the framework.
|
691 |
+
*
|
692 |
+
* TODO: Ask Subscriptions developers whether they would be interested in start adding the column to the payment methods table themselves {WV 2020-02-19}
|
693 |
+
*
|
694 |
+
* @internal
|
695 |
+
*
|
696 |
+
* @since 5.8.0
|
697 |
+
*
|
698 |
+
* @param array $method payment method
|
699 |
+
*/
|
700 |
+
public function add_payment_method_subscriptions( $method ) {
|
701 |
+
|
702 |
+
if ( isset( $method['token'] ) ) {
|
703 |
+
|
704 |
+
$token = $this->get_gateway()->get_payment_tokens_handler()->get_token( get_current_user_id(), $method['token'] );
|
705 |
+
|
706 |
+
if ( $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
707 |
+
echo $this->get_payment_method_subscriptions_html( $token );
|
708 |
+
}
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
|
713 |
+
/**
|
714 |
+
* Gets the HTML code for the list of subscriptions orders associated with the given token.
|
715 |
+
*
|
716 |
+
* @since 5.8.0
|
717 |
+
*
|
718 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token the payment token
|
719 |
+
* @return string
|
720 |
+
*/
|
721 |
+
private function get_payment_method_subscriptions_html( $token ) {
|
722 |
+
|
723 |
+
$html = '';
|
724 |
+
|
725 |
+
// make sure the token belongs to this gateway
|
726 |
+
if ( $token->get_gateway_id() === $this->get_gateway()->get_id() ) {
|
727 |
+
|
728 |
+
$subscription_ids = array();
|
729 |
+
|
730 |
+
// build a link for each subscription
|
731 |
+
foreach ( $this->get_payment_token_subscriptions( get_current_user_id(), $token ) as $subscription ) {
|
732 |
+
$subscription_ids[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $subscription->get_view_order_url() ), esc_attr( sprintf( _x( '#%s', 'hash before order number', 'woocommerce-plugin-framework' ), $subscription->get_order_number() ) ) );
|
733 |
+
}
|
734 |
+
|
735 |
+
if ( ! empty( $subscription_ids ) ) {
|
736 |
+
$html = implode( ', ', $subscription_ids );
|
737 |
+
} else {
|
738 |
+
$html = __( 'N/A', 'woocommerce-plugin-framework' );
|
739 |
+
}
|
740 |
+
}
|
741 |
+
|
742 |
+
return $html;
|
743 |
+
}
|
744 |
+
|
745 |
+
|
746 |
/**
|
747 |
* Add a subscriptions header to the My Payment Methods table.
|
748 |
*
|
749 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-20 {WV 2020-02-20}
|
750 |
+
*
|
751 |
+
* @internal
|
752 |
+
*
|
753 |
* @since 4.3.0
|
754 |
+
* @deprecated 5.8.0
|
755 |
+
*
|
756 |
* @param array $method the table row data
|
757 |
* @param \SV_WC_Payment_Gateway_Payment_Token $token the payment token
|
758 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods the my payment methods instance
|
760 |
*/
|
761 |
public function add_my_payment_methods_table_body_row_data( $method, $token, $handler ) {
|
762 |
|
763 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
|
765 |
return $method;
|
766 |
}
|
769 |
/**
|
770 |
* Disables the "Delete" My Payment Methods method action button if there is an associated subscription.
|
771 |
*
|
772 |
+
* TODO: remove this method by version 6.0.0 or by 2021-02-20 {WV 2020-02-20}
|
773 |
+
*
|
774 |
+
* @internal
|
775 |
+
*
|
776 |
* @since 4.3.0
|
777 |
+
* @deprecated 5.8.0
|
778 |
*
|
779 |
* @param array $actions the token actions
|
780 |
* @param SV_WC_Payment_Gateway_Payment_Token the token object
|
783 |
*/
|
784 |
public function disable_my_payment_methods_table_method_delete( $actions, $token, $handler ) {
|
785 |
|
786 |
+
wc_deprecated_function( __METHOD__, '5.8.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
787 |
|
788 |
return $actions;
|
789 |
}
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
@@ -50,11 +50,32 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
50 |
*/
|
51 |
protected $img_url;
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
/**
|
55 |
-
*
|
56 |
-
* have the following members:
|
57 |
*
|
|
|
|
|
|
|
|
|
58 |
* default - boolean optional indicates this is the default payment token
|
59 |
* type - string one of 'credit_card' or 'echeck' ('check' for backwards compatibility)
|
60 |
* last_four - string last four digits of account number
|
@@ -62,120 +83,170 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
62 |
* exp_month - string optional expiration month MM (credit card only)
|
63 |
* exp_year - string optional expiration year YYYY (credit card only)
|
64 |
* account_type - string one of 'checking' or 'savings' (checking gateway only)
|
|
|
65 |
*
|
66 |
* @since 1.0.0
|
|
|
67 |
* @param string $id the payment gateway token ID
|
68 |
-
* @param array $data associated data
|
69 |
*/
|
70 |
public function __construct( $id, $data ) {
|
71 |
|
72 |
-
if (
|
73 |
|
74 |
-
|
75 |
-
if ( isset( $data['card_type'] ) && $data['card_type'] ) {
|
76 |
|
77 |
-
|
78 |
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
}
|
84 |
-
}
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
88 |
|
89 |
-
$this->id
|
90 |
-
$this->data = $data;
|
91 |
}
|
92 |
|
93 |
|
94 |
/**
|
95 |
* Gets the payment token string.
|
96 |
*
|
97 |
-
* @since
|
98 |
-
* @deprecated 4.0.0
|
99 |
*
|
100 |
* @return string payment token string
|
101 |
*/
|
102 |
-
public function
|
103 |
|
104 |
-
|
|
|
105 |
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
|
109 |
|
110 |
/**
|
111 |
-
*
|
112 |
*
|
113 |
-
* @since
|
114 |
-
*
|
|
|
115 |
*/
|
116 |
-
public function
|
117 |
|
118 |
-
return $this->
|
119 |
}
|
120 |
|
121 |
|
122 |
/**
|
123 |
-
*
|
124 |
*
|
125 |
-
* @since
|
126 |
-
*
|
|
|
127 |
*/
|
128 |
-
public function
|
129 |
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
|
133 |
|
134 |
/**
|
135 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
*
|
137 |
* @since 1.0.0
|
138 |
-
*
|
|
|
139 |
*/
|
140 |
-
public function
|
141 |
|
142 |
-
$this->data['default']
|
143 |
}
|
144 |
|
145 |
|
146 |
/**
|
147 |
-
*
|
148 |
*
|
149 |
* @since 1.0.0
|
150 |
-
*
|
|
|
151 |
*/
|
152 |
-
public function
|
153 |
|
154 |
-
|
155 |
}
|
156 |
|
157 |
|
158 |
/**
|
159 |
-
* Determines if this payment token represents
|
160 |
*
|
161 |
* @since 1.0.0
|
162 |
-
* @deprecated since 4.0.0
|
163 |
*
|
164 |
* @return bool
|
165 |
*/
|
166 |
-
public function
|
167 |
-
|
168 |
-
wc_deprecated_function( __METHOD__, '4.0.0', __CLASS__ . '::is_echeck()' );
|
169 |
|
170 |
-
return $this->
|
171 |
}
|
172 |
|
173 |
|
174 |
/**
|
175 |
-
*
|
176 |
*
|
177 |
* @since 4.0.0
|
178 |
-
*
|
|
|
179 |
*/
|
180 |
public function is_echeck() {
|
181 |
|
@@ -184,9 +255,10 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
184 |
|
185 |
|
186 |
/**
|
187 |
-
*
|
188 |
*
|
189 |
* @since 1.0.0
|
|
|
190 |
* @return string the payment type
|
191 |
*/
|
192 |
public function get_type() {
|
@@ -196,12 +268,13 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
196 |
|
197 |
|
198 |
/**
|
199 |
-
*
|
200 |
*
|
201 |
-
* Credit card
|
202 |
*
|
203 |
* @since 1.0.0
|
204 |
-
*
|
|
|
205 |
*/
|
206 |
public function get_card_type() {
|
207 |
|
@@ -210,11 +283,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
210 |
|
211 |
|
212 |
/**
|
213 |
-
*
|
214 |
*
|
215 |
-
* Credit Card
|
216 |
*
|
217 |
* @since 4.0.0
|
|
|
218 |
* @param string $card_type
|
219 |
*/
|
220 |
public function set_card_type( $card_type ) {
|
@@ -224,30 +298,13 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
224 |
|
225 |
|
226 |
/**
|
227 |
-
*
|
228 |
-
*
|
229 |
-
* @since 1.0.0
|
230 |
-
* @deprecated 4.0.0
|
231 |
-
* @see SV_WC_Payment_Gateway_Helper::card_type_from_account_number()
|
232 |
-
*
|
233 |
-
* @param string $account_number the credit card account number
|
234 |
-
* @return string the credit card type
|
235 |
-
*/
|
236 |
-
public static function type_from_account_number( $account_number ) {
|
237 |
-
|
238 |
-
wc_deprecated_function( __METHOD__, '4.0.0', __CLASS__, '::card_type_from_account_number()' );
|
239 |
-
|
240 |
-
return SV_WC_Payment_Gateway_Helper::card_type_from_account_number( $account_number );
|
241 |
-
}
|
242 |
-
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Returns the bank account type, one of 'checking' or 'savings'
|
246 |
*
|
247 |
-
* eCheck
|
248 |
*
|
249 |
* @since 1.0.0
|
250 |
-
*
|
|
|
251 |
*/
|
252 |
public function get_account_type() {
|
253 |
|
@@ -256,11 +313,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
256 |
|
257 |
|
258 |
/**
|
259 |
-
*
|
260 |
*
|
261 |
-
* eCheck
|
262 |
*
|
263 |
* @since 4.0.0
|
|
|
264 |
* @param string $account_type
|
265 |
*/
|
266 |
public function set_account_type( $account_type ) {
|
@@ -270,18 +328,18 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
270 |
|
271 |
|
272 |
/**
|
273 |
-
*
|
274 |
-
* Discover, Diners, JCB, eCheck, etc
|
275 |
*
|
276 |
* @since 1.0.0
|
|
|
277 |
* @return string the payment type
|
278 |
*/
|
279 |
public function get_type_full() {
|
280 |
|
281 |
if ( $this->is_credit_card() ) {
|
282 |
-
$type = $this->get_card_type()
|
283 |
} else {
|
284 |
-
$type = $this->get_account_type()
|
285 |
}
|
286 |
|
287 |
return SV_WC_Payment_Gateway_Helper::payment_type_to_name( $type );
|
@@ -289,9 +347,10 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
289 |
|
290 |
|
291 |
/**
|
292 |
-
*
|
293 |
*
|
294 |
* @since 1.0.0
|
|
|
295 |
* @return string last four of account
|
296 |
*/
|
297 |
public function get_last_four() {
|
@@ -301,9 +360,10 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
301 |
|
302 |
|
303 |
/**
|
304 |
-
*
|
305 |
*
|
306 |
* @since 4.0.0
|
|
|
307 |
* @param string $last_four
|
308 |
*/
|
309 |
public function set_last_four( $last_four ) {
|
@@ -313,10 +373,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
313 |
|
314 |
|
315 |
/**
|
316 |
-
*
|
317 |
-
*
|
|
|
318 |
*
|
319 |
* @since 1.0.0
|
|
|
320 |
* @return string expiration month as a two-digit number
|
321 |
*/
|
322 |
public function get_exp_month() {
|
@@ -326,9 +388,10 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
326 |
|
327 |
|
328 |
/**
|
329 |
-
*
|
330 |
*
|
331 |
* @since 4.0.0
|
|
|
332 |
* @param string $month
|
333 |
*/
|
334 |
public function set_exp_month( $month ) {
|
@@ -338,10 +401,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
338 |
|
339 |
|
340 |
/**
|
341 |
-
*
|
342 |
-
*
|
|
|
343 |
*
|
344 |
* @since 1.0.0
|
|
|
345 |
* @return string expiration year as a four-digit number
|
346 |
*/
|
347 |
public function get_exp_year() {
|
@@ -351,9 +416,10 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
351 |
|
352 |
|
353 |
/**
|
354 |
-
*
|
355 |
*
|
356 |
* @since 4.0.0
|
|
|
357 |
* @param string $year
|
358 |
*/
|
359 |
public function set_exp_year( $year ) {
|
@@ -363,10 +429,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
363 |
|
364 |
|
365 |
/**
|
366 |
-
*
|
367 |
-
*
|
|
|
368 |
*
|
369 |
* @since 1.0.0
|
|
|
370 |
* @return string formatted expiration date
|
371 |
*/
|
372 |
public function get_exp_date() {
|
@@ -376,12 +444,13 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
376 |
|
377 |
|
378 |
/**
|
379 |
-
*
|
380 |
-
* is available for convenience during a single request and will not be
|
381 |
-
* included in persistent storage
|
382 |
*
|
|
|
383 |
* @see SV_WC_Payment_Gateway_Payment_Token::get_image_url()
|
|
|
384 |
* @since 1.0.0
|
|
|
385 |
* @param string $url the full image URL
|
386 |
*/
|
387 |
public function set_image_url( $url ) {
|
@@ -391,10 +460,12 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
391 |
|
392 |
|
393 |
/**
|
394 |
-
*
|
395 |
*
|
396 |
* @see SV_WC_Payment_Gateway_Payment_Token::set_image_url()
|
|
|
397 |
* @since 1.0.0
|
|
|
398 |
* @return string the full image URL
|
399 |
*/
|
400 |
public function get_image_url() {
|
@@ -456,11 +527,156 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
456 |
|
457 |
|
458 |
/**
|
459 |
-
*
|
460 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
*
|
462 |
* @since 1.0.0
|
463 |
-
*
|
|
|
464 |
*/
|
465 |
public function to_datastore_format() {
|
466 |
|
@@ -468,6 +684,135 @@ class SV_WC_Payment_Gateway_Payment_Token {
|
|
468 |
}
|
469 |
|
470 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
}
|
472 |
|
473 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Token' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
50 |
*/
|
51 |
protected $img_url;
|
52 |
|
53 |
+
/**
|
54 |
+
* @var array key-value array to map WooCommerce core token props to framework token `$data` keys
|
55 |
+
*/
|
56 |
+
protected $props = [
|
57 |
+
'gateway_id' => 'gateway_id',
|
58 |
+
'user_id' => 'user_id',
|
59 |
+
'is_default' => 'default',
|
60 |
+
'last4' => 'last_four',
|
61 |
+
'expiry_year' => 'exp_year',
|
62 |
+
'expiry_month' => 'exp_month',
|
63 |
+
'card_type' => 'card_type',
|
64 |
+
];
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @var null|\WC_Payment_Token WooCommerce core token corresponding to the framework token, if set
|
68 |
+
*/
|
69 |
+
protected $token;
|
70 |
+
|
71 |
|
72 |
/**
|
73 |
+
* Initializes a payment token.
|
|
|
74 |
*
|
75 |
+
* The token $data is expected to have the following members:
|
76 |
+
*
|
77 |
+
* gateway_id - string identifier of the gateway the token belongs to (in WooCommerce core tokens this also identifies the environment of the gateway)
|
78 |
+
* user_id - int identifier of the customer user associated to this token
|
79 |
* default - boolean optional indicates this is the default payment token
|
80 |
* type - string one of 'credit_card' or 'echeck' ('check' for backwards compatibility)
|
81 |
* last_four - string last four digits of account number
|
83 |
* exp_month - string optional expiration month MM (credit card only)
|
84 |
* exp_year - string optional expiration year YYYY (credit card only)
|
85 |
* account_type - string one of 'checking' or 'savings' (checking gateway only)
|
86 |
+
* environment - string optional gateway environment id
|
87 |
*
|
88 |
* @since 1.0.0
|
89 |
+
*
|
90 |
* @param string $id the payment gateway token ID
|
91 |
+
* @param array|\WC_Payment_Token $data associated data array or WC core token
|
92 |
*/
|
93 |
public function __construct( $id, $data ) {
|
94 |
|
95 |
+
if ( $data instanceof \WC_Payment_Token ) {
|
96 |
|
97 |
+
$this->token = $data;
|
|
|
98 |
|
99 |
+
$this->read( $this->token );
|
100 |
|
101 |
+
} else {
|
102 |
+
|
103 |
+
if ( isset( $data['type'] ) && 'credit_card' === $data['type'] ) {
|
104 |
+
|
105 |
+
// normalize the provided card type to adjust for possible abbreviations if set
|
106 |
+
if ( isset( $data['card_type'] ) && $data['card_type'] ) {
|
107 |
+
|
108 |
+
$data['card_type'] = SV_WC_Payment_Gateway_Helper::normalize_card_type( $data['card_type'] );
|
109 |
|
110 |
+
// otherwise, get the payment type from the account number
|
111 |
+
} elseif ( isset( $data['account_number'] ) ) {
|
112 |
+
|
113 |
+
$data['card_type'] = SV_WC_Payment_Gateway_Helper::card_type_from_account_number( $data['account_number'] );
|
114 |
+
}
|
115 |
}
|
|
|
116 |
|
117 |
+
// remove account number so it's not saved to the token
|
118 |
+
unset( $data['account_number'] );
|
119 |
+
|
120 |
+
$this->data = $data;
|
121 |
+
}
|
122 |
|
123 |
+
$this->id = (string) $id;
|
|
|
124 |
}
|
125 |
|
126 |
|
127 |
/**
|
128 |
* Gets the payment token string.
|
129 |
*
|
130 |
+
* @since 4.0.0
|
|
|
131 |
*
|
132 |
* @return string payment token string
|
133 |
*/
|
134 |
+
public function get_id() {
|
135 |
|
136 |
+
return $this->id;
|
137 |
+
}
|
138 |
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Sets the payment token string.
|
142 |
+
*
|
143 |
+
* @since 5.8.0
|
144 |
+
*
|
145 |
+
* @param string $id payment token string
|
146 |
+
*/
|
147 |
+
public function set_id( $id ) {
|
148 |
+
|
149 |
+
$this->id = (string) $id;
|
150 |
}
|
151 |
|
152 |
|
153 |
/**
|
154 |
+
* Gets the gateway ID for the token.
|
155 |
*
|
156 |
+
* @since 5.8.0
|
157 |
+
*
|
158 |
+
* @return string
|
159 |
*/
|
160 |
+
public function get_gateway_id() {
|
161 |
|
162 |
+
return isset( $this->data['gateway_id'] ) ? $this->data['gateway_id'] : '';
|
163 |
}
|
164 |
|
165 |
|
166 |
/**
|
167 |
+
* Sets the gateway ID for the token.
|
168 |
*
|
169 |
+
* @since 5.8.0
|
170 |
+
*
|
171 |
+
* @param string $gateway_id
|
172 |
*/
|
173 |
+
public function set_gateway_id( $gateway_id ) {
|
174 |
|
175 |
+
$this->data['gateway_id'] = $gateway_id;
|
176 |
+
}
|
177 |
+
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Gets the ID of the user associated with the token.
|
181 |
+
*
|
182 |
+
* @since 5.8.0
|
183 |
+
*
|
184 |
+
* @return int
|
185 |
+
*/
|
186 |
+
public function get_user_id() {
|
187 |
+
|
188 |
+
return isset( $this->data['user_id'] ) ? absint( $this->data['user_id'] ) : 0;
|
189 |
}
|
190 |
|
191 |
|
192 |
/**
|
193 |
+
* Sets the ID of the user associated with the token.
|
194 |
+
*
|
195 |
+
* @since 5.8.0
|
196 |
+
*
|
197 |
+
* @param int $user_id
|
198 |
+
*/
|
199 |
+
public function set_user_id( $user_id ) {
|
200 |
+
|
201 |
+
$this->data['user_id'] = is_numeric( $user_id ) ? absint( $user_id ) : 0;
|
202 |
+
}
|
203 |
+
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Determines if this payment token is default.
|
207 |
*
|
208 |
* @since 1.0.0
|
209 |
+
*
|
210 |
+
* @return bool
|
211 |
*/
|
212 |
+
public function is_default() {
|
213 |
|
214 |
+
return isset( $this->data['default'] ) && $this->data['default'];
|
215 |
}
|
216 |
|
217 |
|
218 |
/**
|
219 |
+
* Makes this payment token the default or a non-default one.
|
220 |
*
|
221 |
* @since 1.0.0
|
222 |
+
*
|
223 |
+
* @param bool $default
|
224 |
*/
|
225 |
+
public function set_default( $default ) {
|
226 |
|
227 |
+
$this->data['default'] = $default;
|
228 |
}
|
229 |
|
230 |
|
231 |
/**
|
232 |
+
* Determines true if this payment token represents a credit card
|
233 |
*
|
234 |
* @since 1.0.0
|
|
|
235 |
*
|
236 |
* @return bool
|
237 |
*/
|
238 |
+
public function is_credit_card() {
|
|
|
|
|
239 |
|
240 |
+
return 'credit_card' === $this->data['type'];
|
241 |
}
|
242 |
|
243 |
|
244 |
/**
|
245 |
+
* Determines if this payment token represents an eCheck.
|
246 |
*
|
247 |
* @since 4.0.0
|
248 |
+
*
|
249 |
+
* @return bool
|
250 |
*/
|
251 |
public function is_echeck() {
|
252 |
|
255 |
|
256 |
|
257 |
/**
|
258 |
+
* Gets the payment type, one of 'credit_card' or 'echeck'.
|
259 |
*
|
260 |
* @since 1.0.0
|
261 |
+
*
|
262 |
* @return string the payment type
|
263 |
*/
|
264 |
public function get_type() {
|
268 |
|
269 |
|
270 |
/**
|
271 |
+
* Gets the card type ie visa, mc, amex, disc, diners, jcb, etc.
|
272 |
*
|
273 |
+
* Credit card gateways only.
|
274 |
*
|
275 |
* @since 1.0.0
|
276 |
+
*
|
277 |
+
* @return null|string the payment type
|
278 |
*/
|
279 |
public function get_card_type() {
|
280 |
|
283 |
|
284 |
|
285 |
/**
|
286 |
+
* Sets the card type.
|
287 |
*
|
288 |
+
* Credit Card gateways only.
|
289 |
*
|
290 |
* @since 4.0.0
|
291 |
+
*
|
292 |
* @param string $card_type
|
293 |
*/
|
294 |
public function set_card_type( $card_type ) {
|
298 |
|
299 |
|
300 |
/**
|
301 |
+
* Gets the bank account type, one of 'checking' or 'savings'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
*
|
303 |
+
* eCheck gateways only.
|
304 |
*
|
305 |
* @since 1.0.0
|
306 |
+
*
|
307 |
+
* @return null|string the payment type
|
308 |
*/
|
309 |
public function get_account_type() {
|
310 |
|
313 |
|
314 |
|
315 |
/**
|
316 |
+
* Sets the account type
|
317 |
*
|
318 |
+
* eCheck gateways only.
|
319 |
*
|
320 |
* @since 4.0.0
|
321 |
+
*
|
322 |
* @param string $account_type
|
323 |
*/
|
324 |
public function set_account_type( $account_type ) {
|
328 |
|
329 |
|
330 |
/**
|
331 |
+
* Gets the full payment type, ie Visa, MasterCard, American Express, Discover, Diners, JCB, eCheck, etc.
|
|
|
332 |
*
|
333 |
* @since 1.0.0
|
334 |
+
*
|
335 |
* @return string the payment type
|
336 |
*/
|
337 |
public function get_type_full() {
|
338 |
|
339 |
if ( $this->is_credit_card() ) {
|
340 |
+
$type = $this->get_card_type() ?: 'card';
|
341 |
} else {
|
342 |
+
$type = $this->get_account_type() ?: 'bank';
|
343 |
}
|
344 |
|
345 |
return SV_WC_Payment_Gateway_Helper::payment_type_to_name( $type );
|
347 |
|
348 |
|
349 |
/**
|
350 |
+
* Gets the last four digits of the credit card or check account number.
|
351 |
*
|
352 |
* @since 1.0.0
|
353 |
+
*
|
354 |
* @return string last four of account
|
355 |
*/
|
356 |
public function get_last_four() {
|
360 |
|
361 |
|
362 |
/**
|
363 |
+
* Sets the account last four.
|
364 |
*
|
365 |
* @since 4.0.0
|
366 |
+
*
|
367 |
* @param string $last_four
|
368 |
*/
|
369 |
public function set_last_four( $last_four ) {
|
373 |
|
374 |
|
375 |
/**
|
376 |
+
* Gets the expiration month of the credit card.
|
377 |
+
*
|
378 |
+
* This should only be called for credit card tokens.
|
379 |
*
|
380 |
* @since 1.0.0
|
381 |
+
*
|
382 |
* @return string expiration month as a two-digit number
|
383 |
*/
|
384 |
public function get_exp_month() {
|
388 |
|
389 |
|
390 |
/**
|
391 |
+
* Sets the expiration month.
|
392 |
*
|
393 |
* @since 4.0.0
|
394 |
+
*
|
395 |
* @param string $month
|
396 |
*/
|
397 |
public function set_exp_month( $month ) {
|
401 |
|
402 |
|
403 |
/**
|
404 |
+
* Gets the expiration year of the credit card.
|
405 |
+
*
|
406 |
+
* This should only be called for credit card tokens.
|
407 |
*
|
408 |
* @since 1.0.0
|
409 |
+
*
|
410 |
* @return string expiration year as a four-digit number
|
411 |
*/
|
412 |
public function get_exp_year() {
|
416 |
|
417 |
|
418 |
/**
|
419 |
+
* Sets the expiration year.
|
420 |
*
|
421 |
* @since 4.0.0
|
422 |
+
*
|
423 |
* @param string $year
|
424 |
*/
|
425 |
public function set_exp_year( $year ) {
|
429 |
|
430 |
|
431 |
/**
|
432 |
+
* Gets the expiration date in the format MM/YY.
|
433 |
+
*
|
434 |
+
* Suitable for use in order notes or other customer-facing areas.
|
435 |
*
|
436 |
* @since 1.0.0
|
437 |
+
*
|
438 |
* @return string formatted expiration date
|
439 |
*/
|
440 |
public function get_exp_date() {
|
444 |
|
445 |
|
446 |
/**
|
447 |
+
* Sets the full image URL based on the token payment type.
|
|
|
|
|
448 |
*
|
449 |
+
* Note that this is available for convenience during a single request and will not be included in persistent storage.
|
450 |
* @see SV_WC_Payment_Gateway_Payment_Token::get_image_url()
|
451 |
+
*
|
452 |
* @since 1.0.0
|
453 |
+
*
|
454 |
* @param string $url the full image URL
|
455 |
*/
|
456 |
public function set_image_url( $url ) {
|
460 |
|
461 |
|
462 |
/**
|
463 |
+
* Gets the full image URL based on teh token payment type.
|
464 |
*
|
465 |
* @see SV_WC_Payment_Gateway_Payment_Token::set_image_url()
|
466 |
+
*
|
467 |
* @since 1.0.0
|
468 |
+
*
|
469 |
* @return string the full image URL
|
470 |
*/
|
471 |
public function get_image_url() {
|
527 |
|
528 |
|
529 |
/**
|
530 |
+
* Gets the gateway environment that this token is associated with.
|
531 |
+
*
|
532 |
+
* @since 5.8.0
|
533 |
+
*
|
534 |
+
* @return string
|
535 |
+
*/
|
536 |
+
public function get_environment() {
|
537 |
+
|
538 |
+
return isset( $this->data['environment'] ) && is_string( $this->data['environment'] ) ? $this->data['environment'] : '';
|
539 |
+
}
|
540 |
+
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Sets the gateway environment that this token is associated with.
|
544 |
+
*
|
545 |
+
* @since 5.8.0
|
546 |
+
*
|
547 |
+
* @param string $value environment to set
|
548 |
+
*/
|
549 |
+
public function set_environment( $value ) {
|
550 |
+
|
551 |
+
$this->data['environment'] = $value;
|
552 |
+
}
|
553 |
+
|
554 |
+
|
555 |
+
/**
|
556 |
+
* Determines if this token's data has been migrated to core storage.
|
557 |
+
*
|
558 |
+
* @since 5.8.0
|
559 |
+
*
|
560 |
+
* @return bool
|
561 |
+
*/
|
562 |
+
public function is_migrated() {
|
563 |
+
|
564 |
+
$gateway_id = $this->get_gateway_id();
|
565 |
+
$is_migrated = ! empty( $this->data['migrated'] );
|
566 |
+
|
567 |
+
if ( '' !== $gateway_id ) {
|
568 |
+
|
569 |
+
/**
|
570 |
+
* Filters the migration status of a token.
|
571 |
+
*
|
572 |
+
* @since 5.8.0
|
573 |
+
*
|
574 |
+
* @param bool $is_migrated this would be set to true if a migration occurred
|
575 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token the token object
|
576 |
+
*/
|
577 |
+
$is_migrated = (bool) apply_filters( "wc_payment_gateway_{$gateway_id}_migrated_token", $is_migrated, $this );
|
578 |
+
}
|
579 |
+
|
580 |
+
return $is_migrated;
|
581 |
+
}
|
582 |
+
|
583 |
+
|
584 |
+
/**
|
585 |
+
* Sets if this token's data has been migrated to core storage.
|
586 |
+
*
|
587 |
+
* @since 5.8.0
|
588 |
+
*
|
589 |
+
* @param bool $value if this token's data has been migrated to core storage
|
590 |
+
*/
|
591 |
+
public function set_migrated( $value ) {
|
592 |
+
|
593 |
+
$this->data['migrated'] = (bool) $value;
|
594 |
+
}
|
595 |
+
|
596 |
+
|
597 |
+
/**
|
598 |
+
* Gets the framework token type based on the type of the associated WooCommerce core token.
|
599 |
+
*
|
600 |
+
* Defaults to 'echeck' if core token is not an instance of \WC_Payment_Token_CC
|
601 |
+
*
|
602 |
+
* @since 5.10.5
|
603 |
+
*
|
604 |
+
* @param \WC_Payment_Token $token WooCommerce core token
|
605 |
+
*
|
606 |
+
* @return string
|
607 |
+
*/
|
608 |
+
protected function get_type_from_woocommerce_payment_token( \WC_Payment_Token $token ) {
|
609 |
+
|
610 |
+
if ( $token instanceof \WC_Payment_Token_CC ) {
|
611 |
+
return 'credit_card';
|
612 |
+
}
|
613 |
+
|
614 |
+
return 'echeck';
|
615 |
+
}
|
616 |
+
|
617 |
+
|
618 |
+
/**
|
619 |
+
* Gets the WooCommerce core payment token object related to this framework token.
|
620 |
+
*
|
621 |
+
* @since 5.8.0
|
622 |
+
*
|
623 |
+
* @return \WC_Payment_Token|null
|
624 |
+
*/
|
625 |
+
public function get_woocommerce_payment_token() {
|
626 |
+
|
627 |
+
if ( ! $this->token instanceof \WC_Payment_Token && $this->get_user_id() && $this->get_gateway_id() ) {
|
628 |
+
|
629 |
+
// see if there is already a token with this ID saved for this customer and gateway
|
630 |
+
// purposefully do not use \WC_Payment_Tokens::get_customer_tokens() here to avoid an infinite loop since we filter its results
|
631 |
+
$saved_tokens = \WC_Payment_Tokens::get_tokens(
|
632 |
+
[
|
633 |
+
'user_id' => $this->get_user_id(),
|
634 |
+
'gateway_id' => $this->get_gateway_id(),
|
635 |
+
]
|
636 |
+
);
|
637 |
+
|
638 |
+
foreach ( $saved_tokens as $saved_token ) {
|
639 |
+
|
640 |
+
// use a matching token if found in core tokens
|
641 |
+
if ( $saved_token->get_token() === $this->get_id() ) {
|
642 |
+
$this->token = $saved_token;
|
643 |
+
break;
|
644 |
+
}
|
645 |
+
}
|
646 |
+
}
|
647 |
+
|
648 |
+
return $this->token;
|
649 |
+
}
|
650 |
+
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Creates the WooCommerce core payment token object that store the data of this framework token.
|
654 |
+
*
|
655 |
+
* If it's not a credit card, we default to echeck, so there's always an instance.
|
656 |
+
*
|
657 |
+
* @since 5.10.5
|
658 |
+
*
|
659 |
+
* @return \WC_Payment_Token
|
660 |
+
*/
|
661 |
+
protected function make_new_woocommerce_payment_token() {
|
662 |
+
|
663 |
+
if ( $this->is_credit_card() ) {
|
664 |
+
return new \WC_Payment_Token_CC();
|
665 |
+
}
|
666 |
+
|
667 |
+
return new \WC_Payment_Token_ECheck();
|
668 |
+
}
|
669 |
+
|
670 |
+
|
671 |
+
/**
|
672 |
+
* Gets a representation of this token suitable for persisting to a datastore.
|
673 |
+
*
|
674 |
+
* Note: moving forward we will use {@see \WC_Data} and {@see \WC_Payment_Token} to handle data stores.
|
675 |
+
* @see SV_WC_Payment_Gateway_Payment_Token::save()
|
676 |
*
|
677 |
* @since 1.0.0
|
678 |
+
*
|
679 |
+
* @return array|mixed datastore representation of token
|
680 |
*/
|
681 |
public function to_datastore_format() {
|
682 |
|
684 |
}
|
685 |
|
686 |
|
687 |
+
/**
|
688 |
+
* Reads the properties and meta data of a WooCommerce core token.
|
689 |
+
*
|
690 |
+
* Sets the found key-values as an array in the data property.
|
691 |
+
*
|
692 |
+
* @since 5.8.0
|
693 |
+
*
|
694 |
+
* @param \WC_Payment_Token $core_token
|
695 |
+
*/
|
696 |
+
private function read( \WC_Payment_Token $core_token ) {
|
697 |
+
|
698 |
+
$token_data = $core_token->get_data();
|
699 |
+
$meta_data = $token_data['meta_data'] ?: [];
|
700 |
+
|
701 |
+
unset( $token_data['meta_data'] );
|
702 |
+
|
703 |
+
$this->data['type'] = $this->get_type_from_woocommerce_payment_token( $core_token );
|
704 |
+
|
705 |
+
foreach ( $meta_data as $meta_datum ) {
|
706 |
+
$token_data[ $meta_datum->key ] = $meta_datum->value;
|
707 |
+
}
|
708 |
+
|
709 |
+
foreach ( $token_data as $core_key => $value ) {
|
710 |
+
|
711 |
+
if ( array_key_exists( $core_key, $this->props ) ) {
|
712 |
+
|
713 |
+
$framework_key = $this->props[ $core_key ];
|
714 |
+
|
715 |
+
$this->data[ $framework_key ] = $value;
|
716 |
+
|
717 |
+
} elseif ( ! isset( $this->data[ $core_key ] ) ) {
|
718 |
+
|
719 |
+
$this->data[ $core_key ] = $value;
|
720 |
+
}
|
721 |
+
}
|
722 |
+
}
|
723 |
+
|
724 |
+
|
725 |
+
/**
|
726 |
+
* Stores the token data in the database.
|
727 |
+
*
|
728 |
+
* Stores the token as a Woocommerce payment token.
|
729 |
+
* @see \WC_Payment_Token::save()
|
730 |
+
*
|
731 |
+
* @since 5.8.0
|
732 |
+
*
|
733 |
+
* @return int ID of the token saved as returned by {@see \WC_Payment_Token::save()}
|
734 |
+
* @throws SV_WC_Payment_Gateway_Exception when saving and validating the parent token hits an error
|
735 |
+
*/
|
736 |
+
public function save() {
|
737 |
+
|
738 |
+
$token = $this->get_woocommerce_payment_token();
|
739 |
+
|
740 |
+
if ( ! $token instanceof \WC_Payment_Token ) {
|
741 |
+
$token = $this->make_new_woocommerce_payment_token();
|
742 |
+
}
|
743 |
+
|
744 |
+
$token->set_token( $this->get_id() );
|
745 |
+
|
746 |
+
foreach ( $this->data as $key => $value ) {
|
747 |
+
|
748 |
+
// prefix the expiration year if needed (WC_Payment_Token requires it to be 4 digits long)
|
749 |
+
// TODO: figure out how to handle cards expiring before 2000 {DM 2019-12-13}
|
750 |
+
if ( 'exp_year' === $key && 2 === strlen( $value ) ) {
|
751 |
+
$value = '20' . $value;
|
752 |
+
}
|
753 |
+
|
754 |
+
$core_key = array_search( $key, $this->props, false );
|
755 |
+
|
756 |
+
/** \WC_Payment_Token does not define a set_is_default method */
|
757 |
+
if ( 'is_default' === $core_key ) {
|
758 |
+
$token->set_default( $value );
|
759 |
+
} elseif ( false !== $core_key ) {
|
760 |
+
$token->set_props( [ $core_key => $value ] );
|
761 |
+
} else {
|
762 |
+
$token->update_meta_data( $key, $value, true );
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
try {
|
767 |
+
|
768 |
+
$saved = $token->save();
|
769 |
+
|
770 |
+
if ( $saved ) {
|
771 |
+
$this->token = $token;
|
772 |
+
}
|
773 |
+
|
774 |
+
/**
|
775 |
+
* Usually thrown during either of the following:
|
776 |
+
*
|
777 |
+
* @see \WC_Payment_Token::validate() completely missing token data
|
778 |
+
* @see \WC_Payment_Token_CC::validate() missing card type, missing or invalid four digits, expiration year or month
|
779 |
+
* @see \WC_Payment_Token_eCheck::validate() missing last four`
|
780 |
+
*/
|
781 |
+
} catch ( \Exception $e ) {
|
782 |
+
|
783 |
+
$token_id = $this->get_id();
|
784 |
+
$user_id = $this->get_user_id();
|
785 |
+
|
786 |
+
throw new SV_WC_Payment_Gateway_Exception( sprintf( 'Could not save payment token %1$s for user %2$s. ' . $e->getMessage(), $token_id, $user_id ) );
|
787 |
+
}
|
788 |
+
|
789 |
+
return $saved;
|
790 |
+
}
|
791 |
+
|
792 |
+
|
793 |
+
/**
|
794 |
+
* Deletes the associated WooCommerce core token from the database, if any.
|
795 |
+
*
|
796 |
+
* @see \WC_Payment_Token::delete()
|
797 |
+
*
|
798 |
+
* @since 5.8.0
|
799 |
+
*
|
800 |
+
* @param bool $force_delete argument mapped to {@see \WC_Data::delete()}
|
801 |
+
* @return bool
|
802 |
+
*/
|
803 |
+
public function delete( $force_delete = false ) {
|
804 |
+
|
805 |
+
$deleted = false;
|
806 |
+
|
807 |
+
// delete the core token from WooCommerce tables
|
808 |
+
if ( $token = $this->get_woocommerce_payment_token() ) {
|
809 |
+
$deleted = $token->delete( $force_delete );
|
810 |
+
}
|
811 |
+
|
812 |
+
return $deleted;
|
813 |
+
}
|
814 |
+
|
815 |
+
|
816 |
}
|
817 |
|
818 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
|
@@ -44,6 +44,9 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
44 |
/** @var array|SV_WC_Payment_Gateway_Payment_Token[] array of cached user id to array of SV_WC_Payment_Gateway_Payment_Token token objects */
|
45 |
protected $tokens;
|
46 |
|
|
|
|
|
|
|
47 |
/** @var SV_WC_Payment_Gateway gateway instance */
|
48 |
protected $gateway;
|
49 |
|
@@ -60,18 +63,23 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
60 |
$this->gateway = $gateway;
|
61 |
|
62 |
$this->environment_id = $gateway->get_environment();
|
|
|
|
|
63 |
}
|
64 |
|
65 |
|
66 |
/**
|
67 |
-
*
|
68 |
-
*
|
69 |
-
* payment token
|
|
|
|
|
|
|
70 |
*
|
71 |
* @since 4.3.0
|
72 |
*
|
73 |
* @param string $token payment token
|
74 |
-
* @param array $data {
|
75 |
* Payment token data.
|
76 |
*
|
77 |
* @type bool $default Optional. Indicates this is the default payment token
|
@@ -193,7 +201,7 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
193 |
* @param int $user_id user identifier
|
194 |
* @param SV_WC_Payment_Gateway_Payment_Token $token the token
|
195 |
* @param string|null $environment_id optional environment id, defaults to plugin current environment
|
196 |
-
* @return
|
197 |
*/
|
198 |
public function add_token( $user_id, $token, $environment_id = null ) {
|
199 |
|
@@ -202,21 +210,45 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
202 |
$environment_id = $this->get_environment_id();
|
203 |
}
|
204 |
|
205 |
-
// get existing tokens
|
206 |
-
$tokens = $this->get_tokens( $user_id, array( 'environment_id' => $environment_id ) );
|
207 |
-
|
208 |
// if this token is set as active, mark all others as false
|
209 |
if ( $token->is_default() ) {
|
210 |
-
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
|
|
|
|
213 |
}
|
214 |
|
215 |
-
|
216 |
-
$
|
|
|
217 |
|
218 |
-
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
|
@@ -247,7 +279,7 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
247 |
|
248 |
|
249 |
/**
|
250 |
-
* Updates a single token by persisting
|
251 |
*
|
252 |
* @since since 4.0.0
|
253 |
*
|
@@ -263,13 +295,26 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
263 |
$environment_id = $this->get_environment_id();
|
264 |
}
|
265 |
|
266 |
-
$
|
|
|
|
|
267 |
|
268 |
-
|
269 |
-
$
|
|
|
|
|
|
|
270 |
}
|
271 |
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
}
|
274 |
|
275 |
|
@@ -303,25 +348,50 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
303 |
// for direct gateways that allow it, attempt to delete the token from the endpoint
|
304 |
if ( $this->get_gateway()->get_api()->supports_remove_tokenized_payment_method() ) {
|
305 |
|
306 |
-
|
|
|
|
|
|
|
307 |
|
308 |
-
|
|
|
309 |
|
310 |
-
if ( ! $response->transaction_approved() && ! $this->should_delete_token( $token, $response ) ) {
|
311 |
-
return false;
|
312 |
-
}
|
313 |
|
314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
}
|
319 |
|
320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
}
|
|
|
|
|
322 |
}
|
323 |
|
324 |
-
return $
|
325 |
}
|
326 |
|
327 |
|
@@ -353,31 +423,94 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
353 |
public function delete_token( $user_id, SV_WC_Payment_Gateway_Payment_Token $token, $environment_id = null ) {
|
354 |
|
355 |
// default to current environment
|
356 |
-
if (
|
357 |
$environment_id = $this->get_environment_id();
|
358 |
}
|
359 |
|
360 |
-
//
|
361 |
-
$
|
362 |
|
363 |
-
|
364 |
-
return false;
|
365 |
-
}
|
366 |
|
367 |
-
|
|
|
368 |
|
369 |
-
|
370 |
-
if ( $token->is_default() ) {
|
371 |
|
372 |
-
|
|
|
373 |
|
374 |
-
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
}
|
|
|
|
|
|
|
377 |
}
|
378 |
|
379 |
-
|
380 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
}
|
382 |
|
383 |
|
@@ -477,12 +610,57 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
477 |
// default token for those that do
|
478 |
if ( $user_id ) {
|
479 |
|
480 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
}
|
488 |
|
@@ -517,6 +695,11 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
517 |
// persist locally after merging
|
518 |
$this->update_tokens( $user_id, $this->tokens[ $environment_id ][ $user_id ], $environment_id );
|
519 |
|
|
|
|
|
|
|
|
|
|
|
520 |
} catch( SV_WC_Plugin_Exception $e ) {
|
521 |
|
522 |
// communication or other error
|
@@ -553,15 +736,46 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
553 |
}
|
554 |
|
555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
/**
|
557 |
* Updates the given payment tokens for the identified user, in the database.
|
558 |
*
|
559 |
* @since 1.0.0
|
560 |
*
|
561 |
* @param int $user_id WP user ID
|
562 |
-
* @param
|
563 |
* @param string|null $environment_id optional environment id, defaults to plugin current environment
|
564 |
-
* @return
|
565 |
*/
|
566 |
public function update_tokens( $user_id, $tokens, $environment_id = null ) {
|
567 |
|
@@ -576,8 +790,75 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
576 |
// clear the transient
|
577 |
$this->clear_transient( $user_id );
|
578 |
|
579 |
-
|
580 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
}
|
582 |
|
583 |
|
@@ -899,6 +1180,111 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
899 |
}
|
900 |
|
901 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
902 |
}
|
903 |
|
904 |
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) :
|
30 |
|
31 |
|
32 |
|
44 |
/** @var array|SV_WC_Payment_Gateway_Payment_Token[] array of cached user id to array of SV_WC_Payment_Gateway_Payment_Token token objects */
|
45 |
protected $tokens;
|
46 |
|
47 |
+
/** @var array cached legacy tokens, by user ID and environment */
|
48 |
+
protected $legacy_tokens;
|
49 |
+
|
50 |
/** @var SV_WC_Payment_Gateway gateway instance */
|
51 |
protected $gateway;
|
52 |
|
63 |
$this->gateway = $gateway;
|
64 |
|
65 |
$this->environment_id = $gateway->get_environment();
|
66 |
+
|
67 |
+
$this->add_payment_token_deleted_action();
|
68 |
}
|
69 |
|
70 |
|
71 |
/**
|
72 |
+
* Builds the token object.
|
73 |
+
*
|
74 |
+
* A factory method to build and return a payment token object for the gateway.
|
75 |
+
* Child implementations can override this method to return a custom payment token.
|
76 |
+
*
|
77 |
+
* From version 5.8.0, this method can accept a core \WC_Payment_Token type as the second argument to read data from.
|
78 |
*
|
79 |
* @since 4.3.0
|
80 |
*
|
81 |
* @param string $token payment token
|
82 |
+
* @param \WC_Payment_Token|array $data {
|
83 |
* Payment token data.
|
84 |
*
|
85 |
* @type bool $default Optional. Indicates this is the default payment token
|
201 |
* @param int $user_id user identifier
|
202 |
* @param SV_WC_Payment_Gateway_Payment_Token $token the token
|
203 |
* @param string|null $environment_id optional environment id, defaults to plugin current environment
|
204 |
+
* @return int
|
205 |
*/
|
206 |
public function add_token( $user_id, $token, $environment_id = null ) {
|
207 |
|
210 |
$environment_id = $this->get_environment_id();
|
211 |
}
|
212 |
|
|
|
|
|
|
|
213 |
// if this token is set as active, mark all others as false
|
214 |
if ( $token->is_default() ) {
|
215 |
+
|
216 |
+
$existing_tokens = $this->get_tokens( $user_id, array( 'environment_id' => $environment_id ) );
|
217 |
+
|
218 |
+
foreach ( $existing_tokens as $existing_token ) {
|
219 |
+
|
220 |
+
$existing_token->set_default( false );
|
221 |
+
|
222 |
+
try {
|
223 |
+
$existing_token->save();
|
224 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
225 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
226 |
+
}
|
227 |
}
|
228 |
+
|
229 |
+
$this->tokens[ $environment_id ][ $user_id ] = $existing_tokens;
|
230 |
}
|
231 |
|
232 |
+
$token->set_gateway_id( $this->get_gateway()->get_id() );
|
233 |
+
$token->set_user_id( $user_id );
|
234 |
+
$token->set_environment( $environment_id );
|
235 |
|
236 |
+
try {
|
237 |
+
$saved = $token->save();
|
238 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
239 |
+
$saved = false;
|
240 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
241 |
+
}
|
242 |
+
|
243 |
+
// if saved, update the local cache
|
244 |
+
if ( $saved ) {
|
245 |
+
|
246 |
+
$this->tokens[ $environment_id ][ $user_id ][ $token->get_id() ] = $token;
|
247 |
+
|
248 |
+
$this->clear_transient( $user_id );
|
249 |
+
}
|
250 |
+
|
251 |
+
return $saved;
|
252 |
}
|
253 |
|
254 |
|
279 |
|
280 |
|
281 |
/**
|
282 |
+
* Updates a single token by persisting its data as a core token.
|
283 |
*
|
284 |
* @since since 4.0.0
|
285 |
*
|
295 |
$environment_id = $this->get_environment_id();
|
296 |
}
|
297 |
|
298 |
+
$token->set_gateway_id( $this->get_gateway()->get_id() );
|
299 |
+
$token->set_user_id( $user_id );
|
300 |
+
$token->set_environment( $environment_id );
|
301 |
|
302 |
+
try {
|
303 |
+
$saved = $token->save();
|
304 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
305 |
+
$saved = false;
|
306 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
307 |
}
|
308 |
|
309 |
+
// if saved, update the local cache
|
310 |
+
if ( $saved ) {
|
311 |
+
|
312 |
+
$this->tokens[ $environment_id ][ $user_id ][ $token->get_id() ] = $token;
|
313 |
+
|
314 |
+
$this->clear_transient( $user_id );
|
315 |
+
}
|
316 |
+
|
317 |
+
return $saved;
|
318 |
}
|
319 |
|
320 |
|
348 |
// for direct gateways that allow it, attempt to delete the token from the endpoint
|
349 |
if ( $this->get_gateway()->get_api()->supports_remove_tokenized_payment_method() ) {
|
350 |
|
351 |
+
if ( ! $this->remove_token_from_gateway( $user_id, $environment_id, $token ) ) {
|
352 |
+
return false;
|
353 |
+
}
|
354 |
+
}
|
355 |
|
356 |
+
return $this->delete_token( $user_id, $token );
|
357 |
+
}
|
358 |
|
|
|
|
|
|
|
359 |
|
360 |
+
/**
|
361 |
+
* Removes a tokenized payment method using the gateway's API.
|
362 |
+
*
|
363 |
+
* Returns true if the token's local data should be removed.
|
364 |
+
*
|
365 |
+
* @since 5.8.0
|
366 |
+
*
|
367 |
+
* @param int $user_id user identifier
|
368 |
+
* @param string $environment_id environment id
|
369 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token the payment token to remove
|
370 |
+
* @return bool
|
371 |
+
*/
|
372 |
+
private function remove_token_from_gateway( $user_id, $environment_id, $token ) {
|
373 |
|
374 |
+
// remove a token's local data unless an exception occurs or we choose to keep loca data based on the API response
|
375 |
+
$remove_local_data = true;
|
|
|
376 |
|
377 |
+
try {
|
378 |
+
|
379 |
+
$response = $this->get_gateway()->get_api()->remove_tokenized_payment_method( $token->get_id(), $this->get_gateway()->get_customer_id( $user_id, array( 'environment_id' => $environment_id ) ) );
|
380 |
+
|
381 |
+
if ( ! $response->transaction_approved() && ! $this->should_delete_token( $token, $response ) ) {
|
382 |
+
$remove_local_data = false;
|
383 |
+
}
|
384 |
+
|
385 |
+
} catch( SV_WC_Plugin_Exception $e ) {
|
386 |
+
|
387 |
+
if ( $this->get_gateway()->debug_log() ) {
|
388 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage(), $this->get_gateway()->get_id() );
|
389 |
}
|
390 |
+
|
391 |
+
$remove_local_data = false;
|
392 |
}
|
393 |
|
394 |
+
return $remove_local_data;
|
395 |
}
|
396 |
|
397 |
|
423 |
public function delete_token( $user_id, SV_WC_Payment_Gateway_Payment_Token $token, $environment_id = null ) {
|
424 |
|
425 |
// default to current environment
|
426 |
+
if ( null === $environment_id ) {
|
427 |
$environment_id = $this->get_environment_id();
|
428 |
}
|
429 |
|
430 |
+
// always clear the transient
|
431 |
+
$this->clear_transient( $user_id );
|
432 |
|
433 |
+
$is_default = $token->is_default();
|
|
|
|
|
434 |
|
435 |
+
// no need to respond to woocommerce_payment_token_deleted, we will remove remote and legacy data here
|
436 |
+
$this->remove_payment_token_deleted_action();
|
437 |
|
438 |
+
$deleted = $token->delete();
|
|
|
439 |
|
440 |
+
// restore action callback for woocommerce_payment_token_deleted
|
441 |
+
$this->add_payment_token_deleted_action();
|
442 |
|
443 |
+
if ( $deleted ) {
|
444 |
+
|
445 |
+
// delete token from local cache if successful
|
446 |
+
unset( $this->tokens[ $environment_id ][ $user_id ][ $token->get_id() ] );
|
447 |
+
|
448 |
+
// if the deleted token was the default token, make another one the new default
|
449 |
+
if ( $is_default ) {
|
450 |
+
|
451 |
+
foreach ( $this->get_tokens( $user_id, array( 'environment_id' => $environment_id ) ) as $existing_token ) {
|
452 |
+
|
453 |
+
if ( $existing_token->get_id() === $token->get_id() ) {
|
454 |
+
continue;
|
455 |
+
}
|
456 |
+
|
457 |
+
// set the first as default and bail
|
458 |
+
$existing_token->set_default( true );
|
459 |
+
|
460 |
+
try {
|
461 |
+
$existing_token->save();
|
462 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
463 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
464 |
+
}
|
465 |
+
|
466 |
+
// update the local cache
|
467 |
+
$this->tokens[ $environment_id ][ $user_id ][ $existing_token->get_id() ] = $existing_token;
|
468 |
+
|
469 |
+
break;
|
470 |
+
}
|
471 |
}
|
472 |
+
|
473 |
+
// delete the legacy token data now that the token has been removed
|
474 |
+
$this->delete_legacy_token( $user_id, $token, $environment_id );
|
475 |
}
|
476 |
|
477 |
+
return $deleted;
|
478 |
+
}
|
479 |
+
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Deletes a legacy payment token from user meta.
|
483 |
+
*
|
484 |
+
* @see SV_WC_Payment_Gateway_Payment_Token::delete()
|
485 |
+
*
|
486 |
+
* @since 5.8.0
|
487 |
+
*
|
488 |
+
* @param int $user_id WordPress user ID
|
489 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token payment token object
|
490 |
+
* @param string|null $environment_id gateway environment ID
|
491 |
+
* @return bool whether the token was deleted from the user meta
|
492 |
+
*/
|
493 |
+
public function delete_legacy_token( $user_id, SV_WC_Payment_Gateway_Payment_Token $token, $environment_id = null ) {
|
494 |
+
|
495 |
+
$deleted = false;
|
496 |
+
|
497 |
+
// default to current environment
|
498 |
+
if ( null === $environment_id ) {
|
499 |
+
$environment_id = $this->get_environment_id();
|
500 |
+
}
|
501 |
+
|
502 |
+
$legacy_tokens = get_user_meta( $user_id, $this->get_user_meta_name( $environment_id ), true );
|
503 |
+
|
504 |
+
if ( is_array( $legacy_tokens ) && isset( $legacy_tokens[ $token->get_id() ] ) ) {
|
505 |
+
|
506 |
+
unset( $this->legacy_tokens[ $environment_id ][ $user_id ][ $token->get_id() ] );
|
507 |
+
|
508 |
+
unset( $legacy_tokens[ $token->get_id() ] );
|
509 |
+
|
510 |
+
$deleted = (bool) update_user_meta( $user_id, $this->get_user_meta_name( $environment_id ), $legacy_tokens );
|
511 |
+
}
|
512 |
+
|
513 |
+
return $deleted;
|
514 |
}
|
515 |
|
516 |
|
610 |
// default token for those that do
|
611 |
if ( $user_id ) {
|
612 |
|
613 |
+
$core_tokens = \WC_Payment_Tokens::get_customer_tokens( $user_id, $this->get_gateway()->get_id() );
|
614 |
+
|
615 |
+
if ( is_array( $core_tokens ) ) {
|
616 |
+
|
617 |
+
foreach ( $core_tokens as $core_token ) {
|
618 |
+
|
619 |
+
if ( $environment_id === $core_token->get_meta( 'environment' ) ) {
|
620 |
+
$tokens[ $core_token->get_token() ] = $this->build_token( $core_token->get_token(), $core_token );
|
621 |
+
}
|
622 |
+
}
|
623 |
+
}
|
624 |
+
|
625 |
+
// migrate legacy tokens if necessary
|
626 |
+
if ( ! $this->user_legacy_tokens_migrated( $user_id ) ) {
|
627 |
+
|
628 |
+
$legacy_tokens = $this->get_legacy_tokens( $user_id );
|
629 |
+
$migrated_tokens = 0;
|
630 |
+
|
631 |
+
// migrate any legacy tokens that haven't already been migrated
|
632 |
+
foreach ( $legacy_tokens as $legacy_token ) {
|
633 |
|
634 |
+
if ( ! isset( $tokens[ $legacy_token->get_id() ] ) && ! $legacy_token->is_migrated() ) {
|
635 |
+
|
636 |
+
$legacy_token->set_gateway_id( $this->get_gateway()->get_id() );
|
637 |
+
$legacy_token->set_user_id( $user_id );
|
638 |
+
$legacy_token->set_environment( $environment_id );
|
639 |
+
|
640 |
+
try {
|
641 |
+
|
642 |
+
if ( $legacy_token->save() ) {
|
643 |
+
|
644 |
+
$tokens[ $legacy_token->get_id() ] = $legacy_token;
|
645 |
+
|
646 |
+
$migrated_tokens++;
|
647 |
+
|
648 |
+
$legacy_token->set_migrated( true );
|
649 |
+
|
650 |
+
$this->update_legacy_token( $user_id, $legacy_token );
|
651 |
+
}
|
652 |
+
|
653 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
654 |
+
|
655 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
656 |
+
}
|
657 |
+
|
658 |
+
}
|
659 |
+
}
|
660 |
+
|
661 |
+
// if all of the tokens were successfully migrated, flag the user for no further migrations
|
662 |
+
if ( count( $legacy_tokens ) === $migrated_tokens ) {
|
663 |
+
$this->set_user_legacy_tokens_migrated( $user_id );
|
664 |
}
|
665 |
}
|
666 |
|
695 |
// persist locally after merging
|
696 |
$this->update_tokens( $user_id, $this->tokens[ $environment_id ][ $user_id ], $environment_id );
|
697 |
|
698 |
+
// remove local tokens not present in remote data
|
699 |
+
foreach ( array_diff_key( $tokens, $this->tokens[ $environment_id ][ $user_id ] ) as $key => $token ) {
|
700 |
+
$this->delete_token( $user_id, $token, $environment_id );
|
701 |
+
}
|
702 |
+
|
703 |
} catch( SV_WC_Plugin_Exception $e ) {
|
704 |
|
705 |
// communication or other error
|
736 |
}
|
737 |
|
738 |
|
739 |
+
/**
|
740 |
+
* Gets token objects from the legacy user meta data store.
|
741 |
+
*
|
742 |
+
* @since 5.8.0
|
743 |
+
*
|
744 |
+
* @param int $user_id WordPress user ID
|
745 |
+
* @param null|string $environment_id desired environment ID
|
746 |
+
* @return SV_WC_Payment_Gateway_Payment_Token[]
|
747 |
+
*/
|
748 |
+
public function get_legacy_tokens( $user_id, $environment_id = null ) {
|
749 |
+
|
750 |
+
if ( null === $environment_id ) {
|
751 |
+
$environment_id = $this->get_environment_id();
|
752 |
+
}
|
753 |
+
|
754 |
+
$this->legacy_tokens[ $environment_id ][ $user_id ] = [];
|
755 |
+
|
756 |
+
$token_data = get_user_meta( $user_id, $this->get_user_meta_name( $environment_id ), true );
|
757 |
+
|
758 |
+
// from database format
|
759 |
+
if ( is_array( $token_data ) ) {
|
760 |
+
|
761 |
+
foreach ( $token_data as $token => $data ) {
|
762 |
+
$this->legacy_tokens[ $environment_id ][ $user_id ][ $token ] = $this->build_token( $token, $data );
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
return $this->legacy_tokens[ $environment_id ][ $user_id ];
|
767 |
+
}
|
768 |
+
|
769 |
+
|
770 |
/**
|
771 |
* Updates the given payment tokens for the identified user, in the database.
|
772 |
*
|
773 |
* @since 1.0.0
|
774 |
*
|
775 |
* @param int $user_id WP user ID
|
776 |
+
* @param SV_WC_Payment_Gateway_Payment_Token[] $tokens array of tokens
|
777 |
* @param string|null $environment_id optional environment id, defaults to plugin current environment
|
778 |
+
* @return bool
|
779 |
*/
|
780 |
public function update_tokens( $user_id, $tokens, $environment_id = null ) {
|
781 |
|
790 |
// clear the transient
|
791 |
$this->clear_transient( $user_id );
|
792 |
|
793 |
+
$updated_tokens = [];
|
794 |
+
|
795 |
+
foreach ( $tokens as $token ) {
|
796 |
+
|
797 |
+
// skip invalid objects
|
798 |
+
if ( ! $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
799 |
+
continue;
|
800 |
+
}
|
801 |
+
|
802 |
+
// ensure the vital properties are set
|
803 |
+
$token->set_user_id( $user_id );
|
804 |
+
$token->set_gateway_id( $this->get_gateway()->get_id() );
|
805 |
+
$token->set_environment( $environment_id );
|
806 |
+
|
807 |
+
try {
|
808 |
+
$token_id = $token->save();
|
809 |
+
} catch ( SV_WC_Payment_Gateway_Exception $e ) {
|
810 |
+
$token_id = 0;
|
811 |
+
$this->get_gateway()->get_plugin()->log( $e->getMessage() );
|
812 |
+
}
|
813 |
+
|
814 |
+
if ( $token_id ) {
|
815 |
+
$updated_tokens[] = $token_id;
|
816 |
+
}
|
817 |
+
}
|
818 |
+
|
819 |
+
return count( $tokens ) === count( $updated_tokens );
|
820 |
+
}
|
821 |
+
|
822 |
+
|
823 |
+
/**
|
824 |
+
* Updates a single legacy token in user meta.
|
825 |
+
*
|
826 |
+
* @see SV_WC_Payment_Gateway_Payment_Token::save()
|
827 |
+
*
|
828 |
+
* @since 5.8.0
|
829 |
+
*
|
830 |
+
* @param int $user_id WP user ID
|
831 |
+
* @param SV_WC_Payment_Gateway_Payment_Token $token token to update
|
832 |
+
* @param string|null $environment_id optional environment ID, defaults to plugin current environment
|
833 |
+
* @param bool $migrated whether the token was migrated to the new datastore
|
834 |
+
* @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure
|
835 |
+
*/
|
836 |
+
public function update_legacy_token( $user_id, $token, $environment_id = null, $migrated = false ) {
|
837 |
+
|
838 |
+
$updated = false;
|
839 |
+
|
840 |
+
// default to current environment
|
841 |
+
if ( null === $environment_id ) {
|
842 |
+
$environment_id = $this->get_environment_id();
|
843 |
+
}
|
844 |
+
|
845 |
+
$legacy_tokens = get_user_meta( $user_id, $this->get_user_meta_name( $environment_id ), true );
|
846 |
+
|
847 |
+
if ( is_array( $legacy_tokens ) && isset( $legacy_tokens[ $token->get_id() ] ) ) {
|
848 |
+
|
849 |
+
// update the cached token
|
850 |
+
$this->legacy_tokens[ $environment_id ][ $user_id ][ $token->get_id() ] = $token;
|
851 |
+
|
852 |
+
$legacy_tokens[ $token->get_id() ] = $token->to_datastore_format();
|
853 |
+
|
854 |
+
if ( $migrated ) {
|
855 |
+
$legacy_tokens[ $token->get_id() ]['migrated'] = true;
|
856 |
+
}
|
857 |
+
|
858 |
+
$updated = update_user_meta( $user_id, $this->get_user_meta_name( $environment_id ), $legacy_tokens );
|
859 |
+
}
|
860 |
+
|
861 |
+
return $updated;
|
862 |
}
|
863 |
|
864 |
|
1180 |
}
|
1181 |
|
1182 |
|
1183 |
+
/**
|
1184 |
+
* Determines whether a user's tokens have been migrated.
|
1185 |
+
*
|
1186 |
+
* @since 5.8.0
|
1187 |
+
*
|
1188 |
+
* @param int $user_id WordPress user ID
|
1189 |
+
* @param string|null $environment_id environment ID
|
1190 |
+
* @return bool
|
1191 |
+
*/
|
1192 |
+
public function user_legacy_tokens_migrated( $user_id, $environment_id = null ) {
|
1193 |
+
|
1194 |
+
if ( null === $environment_id ) {
|
1195 |
+
$environment_id = $this->get_environment_id();
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
$migrated = 'yes' === get_user_meta( $user_id, $this->get_user_meta_name( $environment_id ) . '_migrated', true );
|
1199 |
+
|
1200 |
+
/**
|
1201 |
+
* Filters whether a user's legacy tokens have been migrated.
|
1202 |
+
*
|
1203 |
+
* @since 5.8.0
|
1204 |
+
*
|
1205 |
+
* @param bool $migrated whether the tokens have been migrated
|
1206 |
+
* @param int $user_id user ID
|
1207 |
+
* @param string $environment_id the gateway environment the tokens are related to
|
1208 |
+
*/
|
1209 |
+
return (bool) apply_filters( 'wc_payment_gateway_' . $this->get_gateway()->get_id() . '_user_legacy_tokens_migrated', $migrated, $user_id, $environment_id );
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
|
1213 |
+
/**
|
1214 |
+
* Marks a user as having their tokens migrated.
|
1215 |
+
*
|
1216 |
+
* @since 5.8.0
|
1217 |
+
*
|
1218 |
+
* @param int $user_id WordPress user ID
|
1219 |
+
* @param string|null $environment_id environment ID
|
1220 |
+
*/
|
1221 |
+
public function set_user_legacy_tokens_migrated( $user_id, $environment_id = null ) {
|
1222 |
+
|
1223 |
+
if ( null === $environment_id ) {
|
1224 |
+
$environment_id = $this->get_environment_id();
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
update_user_meta( $user_id, $this->get_user_meta_name( $environment_id ) . '_migrated', 'yes' );
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
|
1231 |
+
/**
|
1232 |
+
* Adds the callback action for woocommerce_payment_token_deleted.
|
1233 |
+
*
|
1234 |
+
* @since 5.8.0
|
1235 |
+
*/
|
1236 |
+
private function add_payment_token_deleted_action() {
|
1237 |
+
|
1238 |
+
add_action( 'woocommerce_payment_token_deleted', [ $this, 'payment_token_deleted' ], 10, 2 );
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
|
1242 |
+
/**
|
1243 |
+
* Removes the callback action for woocommerce_payment_token_deleted.
|
1244 |
+
*
|
1245 |
+
* @since 5.8.0
|
1246 |
+
*/
|
1247 |
+
private function remove_payment_token_deleted_action() {
|
1248 |
+
|
1249 |
+
remove_action( 'woocommerce_payment_token_deleted', [ $this, 'payment_token_deleted' ], 10, 2 );
|
1250 |
+
}
|
1251 |
+
|
1252 |
+
|
1253 |
+
/**
|
1254 |
+
* Deletes remote token data and legacy token data when the corresponding core token is deleted.
|
1255 |
+
*
|
1256 |
+
* @internal
|
1257 |
+
*
|
1258 |
+
* @since 5.8.0
|
1259 |
+
*
|
1260 |
+
* @param int $token_id the ID of a core token
|
1261 |
+
* @param \WC_Payment_Token $core_token the core token object
|
1262 |
+
*/
|
1263 |
+
public function payment_token_deleted( $token_id, $core_token ) {
|
1264 |
+
|
1265 |
+
if ( $this->get_gateway()->get_id() === $core_token->get_gateway_id() ) {
|
1266 |
+
|
1267 |
+
$token = $this->build_token( $core_token->get_token(), $core_token );
|
1268 |
+
|
1269 |
+
$user_id = $token->get_user_id();
|
1270 |
+
$environment_id = $token->get_environment();
|
1271 |
+
|
1272 |
+
// for direct gateways that allow it, attempt to delete the token from the endpoint
|
1273 |
+
if ( ! $this->get_gateway()->get_api()->supports_remove_tokenized_payment_method() || $this->remove_token_from_gateway( $user_id, $environment_id, $token ) ) {
|
1274 |
+
|
1275 |
+
// clear tokens transient
|
1276 |
+
$this->clear_transient( $user_id );
|
1277 |
+
|
1278 |
+
// delete token from local cache
|
1279 |
+
unset( $this->tokens[ $environment_id ][ $user_id ][ $token->get_id() ] );
|
1280 |
+
|
1281 |
+
// delete the legacy token data now that the token has been removed
|
1282 |
+
$this->delete_legacy_token( $user_id, $token, $environment_id );
|
1283 |
+
}
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
|
1287 |
+
|
1288 |
}
|
1289 |
|
1290 |
|
vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php
CHANGED
@@ -22,18 +22,18 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
31 |
|
32 |
|
33 |
/**
|
34 |
* The payment gateway plugin REST API handler class.
|
35 |
*
|
36 |
-
* @see \SkyVerge\WooCommerce\PluginFramework\
|
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\
|
49 |
*
|
50 |
* @since 5.2.0
|
51 |
*
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway;
|
26 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API as Plugin_REST_API;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\Payment_Gateway\\REST_API' ) ) :
|
31 |
|
32 |
|
33 |
/**
|
34 |
* The payment gateway plugin REST API handler class.
|
35 |
*
|
36 |
+
* @see \SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API
|
37 |
*
|
38 |
* @since 5.2.0
|
39 |
*/
|
45 |
*
|
46 |
* Plugins can override this to add their own data.
|
47 |
*
|
48 |
+
* @see \SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API::get_system_status_data()
|
49 |
*
|
50 |
* @since 5.2.0
|
51 |
*
|
vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/Controllers/Settings.php
CHANGED
@@ -22,14 +22,14 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
28 |
-
use SkyVerge\WooCommerce\PluginFramework\
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
32 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
33 |
|
34 |
/**
|
35 |
* The settings controller class.
|
@@ -274,7 +274,7 @@ class Settings extends \WP_REST_Controller {
|
|
274 |
return $item;
|
275 |
}
|
276 |
|
277 |
-
|
278 |
/**
|
279 |
* Retrieves the item's schema, conforming to JSON Schema.
|
280 |
*
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5\REST_API\Controllers;
|
26 |
|
27 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API\Abstract_Settings;
|
28 |
+
use SkyVerge\WooCommerce\PluginFramework\v5_10_5\Settings_API\Setting;
|
29 |
|
30 |
defined( 'ABSPATH' ) or exit;
|
31 |
|
32 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\REST_API\\Controllers\\Settings' ) ) :
|
33 |
|
34 |
/**
|
35 |
* The settings controller class.
|
274 |
return $item;
|
275 |
}
|
276 |
|
277 |
+
|
278 |
/**
|
279 |
* Retrieves the item's schema, conforming to JSON Schema.
|
280 |
*
|
vendor/skyverge/wc-plugin-framework/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\REST_API' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-async-request.php
CHANGED
@@ -23,11 +23,11 @@
|
|
23 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
24 |
*/
|
25 |
|
26 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
31 |
|
32 |
|
33 |
/**
|
23 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
24 |
*/
|
25 |
|
26 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Async_Request' ) ) :
|
31 |
|
32 |
|
33 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-background-job-handler.php
CHANGED
@@ -23,11 +23,11 @@
|
|
23 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
24 |
*/
|
25 |
|
26 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
31 |
|
32 |
|
33 |
/**
|
23 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
24 |
*/
|
25 |
|
26 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
27 |
|
28 |
defined( 'ABSPATH' ) or exit;
|
29 |
|
30 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Background_Job_Handler' ) ) :
|
31 |
|
32 |
|
33 |
/**
|
vendor/skyverge/wc-plugin-framework/woocommerce/utilities/class-sv-wp-job-batch-handler.php
CHANGED
@@ -22,11 +22,11 @@
|
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
-
namespace SkyVerge\WooCommerce\PluginFramework\
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
-
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\
|
30 |
|
31 |
|
32 |
/**
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
25 |
+
namespace SkyVerge\WooCommerce\PluginFramework\v5_10_5;
|
26 |
|
27 |
defined( 'ABSPATH' ) or exit;
|
28 |
|
29 |
+
if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_5\\SV_WP_Job_Batch_Handler' ) ) :
|
30 |
|
31 |
|
32 |
/**
|
woocommerce-gateway-paypal-powered-by-braintree.php
CHANGED
@@ -2,15 +2,16 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Braintree for WooCommerce Payment Gateway
|
4 |
* Plugin URI: https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/
|
|
|
5 |
* 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+
|
6 |
* Author: WooCommerce
|
7 |
* Author URI: http://woocommerce.com/
|
8 |
-
* Version: 2.
|
9 |
* Text Domain: woocommerce-gateway-paypal-powered-by-braintree
|
10 |
* Domain Path: /i18n/languages/
|
11 |
*
|
12 |
* WC requires at least: 3.0.9
|
13 |
-
* WC tested up to:
|
14 |
*
|
15 |
* Copyright (c) 2016-2020, Automattic, Inc.
|
16 |
*
|
@@ -43,22 +44,22 @@ define( 'WC_PAYPAL_BRAINTREE_FILE', __FILE__ );
|
|
43 |
/**
|
44 |
* The plugin loader class.
|
45 |
*
|
46 |
-
* @since
|
47 |
*/
|
48 |
class WC_PayPal_Braintree_Loader {
|
49 |
|
50 |
|
51 |
/** minimum PHP version required by this plugin */
|
52 |
-
const MINIMUM_PHP_VERSION = '
|
53 |
|
54 |
/** minimum WordPress version required by this plugin */
|
55 |
-
const MINIMUM_WP_VERSION = '
|
56 |
|
57 |
/** minimum WooCommerce version required by this plugin */
|
58 |
-
const MINIMUM_WC_VERSION = '3.
|
59 |
|
60 |
/** SkyVerge plugin framework version used by this plugin */
|
61 |
-
const FRAMEWORK_VERSION = '5.
|
62 |
|
63 |
/** the plugin name, for displaying notices */
|
64 |
const PLUGIN_NAME = 'Braintree for WooCommerce';
|
@@ -68,26 +69,28 @@ class WC_PayPal_Braintree_Loader {
|
|
68 |
private static $instance;
|
69 |
|
70 |
/** @var array the admin notices to add */
|
71 |
-
public $notices =
|
72 |
|
73 |
|
74 |
/**
|
75 |
* Constructs the loader.
|
76 |
*
|
77 |
-
* @since
|
78 |
*/
|
79 |
protected function __construct() {
|
80 |
|
81 |
-
register_activation_hook( __FILE__,
|
82 |
|
83 |
-
add_action( 'admin_init',
|
84 |
-
add_action( 'admin_init',
|
85 |
|
86 |
-
add_action( 'admin_notices',
|
|
|
|
|
87 |
|
88 |
// if the environment check fails, initialize the plugin
|
89 |
if ( $this->is_environment_compatible() ) {
|
90 |
-
add_action( 'plugins_loaded',
|
91 |
}
|
92 |
}
|
93 |
|
@@ -95,7 +98,7 @@ class WC_PayPal_Braintree_Loader {
|
|
95 |
/**
|
96 |
* Cloning instances is forbidden due to singleton pattern.
|
97 |
*
|
98 |
-
* @since
|
99 |
*/
|
100 |
public function __clone() {
|
101 |
_doing_it_wrong( __FUNCTION__, sprintf( 'You cannot clone instances of %s.', get_class( $this ) ), '1.0.0' );
|
@@ -105,7 +108,7 @@ class WC_PayPal_Braintree_Loader {
|
|
105 |
/**
|
106 |
* Unserializing instances is forbidden due to singleton pattern.
|
107 |
*
|
108 |
-
* @since
|
109 |
*/
|
110 |
public function __wakeup() {
|
111 |
_doing_it_wrong( __FUNCTION__, sprintf( 'You cannot unserialize instances of %s.', get_class( $this ) ), '1.0.0' );
|
@@ -159,7 +162,7 @@ class WC_PayPal_Braintree_Loader {
|
|
159 |
/**
|
160 |
* Loads the base framework classes.
|
161 |
*
|
162 |
-
* @since 2.3.0
|
163 |
*/
|
164 |
protected function load_framework() {
|
165 |
|
@@ -176,7 +179,7 @@ class WC_PayPal_Braintree_Loader {
|
|
176 |
/**
|
177 |
* Gets the framework version in namespace form.
|
178 |
*
|
179 |
-
* @since 2.3.0
|
180 |
*
|
181 |
* @return string
|
182 |
*/
|
@@ -189,7 +192,7 @@ class WC_PayPal_Braintree_Loader {
|
|
189 |
/**
|
190 |
* Gets the framework version used by this plugin.
|
191 |
*
|
192 |
-
* @since 2.3.0
|
193 |
*
|
194 |
* @return string
|
195 |
*/
|
@@ -200,12 +203,11 @@ class WC_PayPal_Braintree_Loader {
|
|
200 |
|
201 |
|
202 |
/**
|
203 |
-
* Checks the server environment and other factors and deactivates plugins
|
204 |
-
* as necessary.
|
205 |
*
|
206 |
-
* Based on http://wptavern.com/how-to-prevent-wordpress-plugins-from-activating-on-sites-with-incompatible-hosting-environments
|
207 |
*
|
208 |
-
* @since
|
209 |
*/
|
210 |
public function activation_check() {
|
211 |
|
@@ -224,14 +226,16 @@ class WC_PayPal_Braintree_Loader {
|
|
224 |
// enable the PayPal gateway on activation
|
225 |
$paypal_settings = get_option( 'woocommerce_braintree_paypal_settings', array() );
|
226 |
$paypal_settings['enabled'] = 'yes';
|
|
|
227 |
update_option( 'woocommerce_braintree_paypal_settings', $paypal_settings );
|
228 |
}
|
229 |
|
230 |
/**
|
231 |
-
* Checks the environment
|
232 |
-
*
|
|
|
233 |
*
|
234 |
-
* @since
|
235 |
*/
|
236 |
public function check_environment() {
|
237 |
|
@@ -247,7 +251,8 @@ class WC_PayPal_Braintree_Loader {
|
|
247 |
/**
|
248 |
* Checks the environment for compatibility problems.
|
249 |
*
|
250 |
-
* @since
|
|
|
251 |
* @param bool $during_activation whether this check is during plugin activation
|
252 |
* @return string|bool the error message if one exists, or false if everything's okay
|
253 |
*/
|
@@ -272,7 +277,9 @@ class WC_PayPal_Braintree_Loader {
|
|
272 |
/**
|
273 |
* Adds notices for out-of-date WordPress and/or WooCommerce versions.
|
274 |
*
|
275 |
-
* @
|
|
|
|
|
276 |
*/
|
277 |
public function add_plugin_notices() {
|
278 |
|
@@ -309,7 +316,7 @@ class WC_PayPal_Braintree_Loader {
|
|
309 |
/**
|
310 |
* Determines if the required plugins are compatible.
|
311 |
*
|
312 |
-
* @since 2.3.0
|
313 |
*
|
314 |
* @return bool
|
315 |
*/
|
@@ -322,7 +329,7 @@ class WC_PayPal_Braintree_Loader {
|
|
322 |
/**
|
323 |
* Determines if the WordPress compatible.
|
324 |
*
|
325 |
-
* @since 2.3.0
|
326 |
*
|
327 |
* @return bool
|
328 |
*/
|
@@ -335,7 +342,7 @@ class WC_PayPal_Braintree_Loader {
|
|
335 |
/**
|
336 |
* Determines if the WooCommerce compatible.
|
337 |
*
|
338 |
-
* @since 2.3.0
|
339 |
*
|
340 |
* @return bool
|
341 |
*/
|
@@ -348,7 +355,7 @@ class WC_PayPal_Braintree_Loader {
|
|
348 |
/**
|
349 |
* Deactivates the plugin.
|
350 |
*
|
351 |
-
* @since 2.3.0
|
352 |
*/
|
353 |
protected function deactivate_plugin() {
|
354 |
|
@@ -363,9 +370,7 @@ class WC_PayPal_Braintree_Loader {
|
|
363 |
/**
|
364 |
* Determines if the server environment is compatible with this plugin.
|
365 |
*
|
366 |
-
*
|
367 |
-
*
|
368 |
-
* @since 2.3.0-dev.1
|
369 |
*
|
370 |
* @return bool
|
371 |
*/
|
@@ -378,7 +383,7 @@ class WC_PayPal_Braintree_Loader {
|
|
378 |
/**
|
379 |
* Gets the message for display when the environment is incompatible with this plugin.
|
380 |
*
|
381 |
-
* @since 2.3.0
|
382 |
*
|
383 |
* @return string
|
384 |
*/
|
@@ -391,7 +396,7 @@ class WC_PayPal_Braintree_Loader {
|
|
391 |
/**
|
392 |
* Adds an admin notice to be displayed.
|
393 |
*
|
394 |
-
* @since
|
395 |
*
|
396 |
* @param string $slug notice slug/ID
|
397 |
* @param string $class notice HTML class
|
@@ -399,39 +404,60 @@ class WC_PayPal_Braintree_Loader {
|
|
399 |
*/
|
400 |
public function add_admin_notice( $slug, $class, $message ) {
|
401 |
|
402 |
-
$this->notices[ $slug ] =
|
403 |
'class' => $class,
|
404 |
'message' => $message
|
405 |
-
|
406 |
}
|
407 |
|
408 |
|
409 |
/**
|
410 |
-
* Displays any admin notices added
|
411 |
*
|
412 |
* @internal
|
413 |
*
|
414 |
-
* @since
|
415 |
*/
|
416 |
public function admin_notices() {
|
417 |
|
418 |
-
foreach ( (array) $this->notices as $notice_key => $notice )
|
419 |
|
420 |
-
|
421 |
-
echo
|
422 |
-
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
|
426 |
|
427 |
/**
|
428 |
-
* Gets the main
|
429 |
*
|
430 |
* Ensures only one instance can be loaded.
|
431 |
*
|
432 |
-
* @since 2.3.0
|
433 |
*
|
434 |
-
* @return WC_PayPal_Braintree_Loader
|
435 |
*/
|
436 |
public static function instance() {
|
437 |
|
2 |
/**
|
3 |
* Plugin Name: Braintree for WooCommerce Payment Gateway
|
4 |
* Plugin URI: https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/
|
5 |
+
* Documentation URI: https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/
|
6 |
* Description: Receive credit card or PayPal payments using Braintree for WooCommerce. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
|
7 |
* Author: WooCommerce
|
8 |
* Author URI: http://woocommerce.com/
|
9 |
+
* Version: 2.5.0
|
10 |
* Text Domain: woocommerce-gateway-paypal-powered-by-braintree
|
11 |
* Domain Path: /i18n/languages/
|
12 |
*
|
13 |
* WC requires at least: 3.0.9
|
14 |
+
* WC tested up to: 5.1.0
|
15 |
*
|
16 |
* Copyright (c) 2016-2020, Automattic, Inc.
|
17 |
*
|
44 |
/**
|
45 |
* The plugin loader class.
|
46 |
*
|
47 |
+
* @since 2.3.0
|
48 |
*/
|
49 |
class WC_PayPal_Braintree_Loader {
|
50 |
|
51 |
|
52 |
/** minimum PHP version required by this plugin */
|
53 |
+
const MINIMUM_PHP_VERSION = '7.0';
|
54 |
|
55 |
/** minimum WordPress version required by this plugin */
|
56 |
+
const MINIMUM_WP_VERSION = '5.2';
|
57 |
|
58 |
/** minimum WooCommerce version required by this plugin */
|
59 |
+
const MINIMUM_WC_VERSION = '3.5';
|
60 |
|
61 |
/** SkyVerge plugin framework version used by this plugin */
|
62 |
+
const FRAMEWORK_VERSION = '5.10.5';
|
63 |
|
64 |
/** the plugin name, for displaying notices */
|
65 |
const PLUGIN_NAME = 'Braintree for WooCommerce';
|
69 |
private static $instance;
|
70 |
|
71 |
/** @var array the admin notices to add */
|
72 |
+
public $notices = array();
|
73 |
|
74 |
|
75 |
/**
|
76 |
* Constructs the loader.
|
77 |
*
|
78 |
+
* @since 2.3.0
|
79 |
*/
|
80 |
protected function __construct() {
|
81 |
|
82 |
+
register_activation_hook( __FILE__, array( $this, 'activation_check' ) );
|
83 |
|
84 |
+
add_action( 'admin_init', array( $this, 'check_environment' ) );
|
85 |
+
add_action( 'admin_init', array( $this, 'add_plugin_notices' ) );
|
86 |
|
87 |
+
add_action( 'admin_notices', array( $this, 'admin_notices' ), 15 );
|
88 |
+
|
89 |
+
add_filter( 'extra_plugin_headers', array( $this, 'add_documentation_header' ) );
|
90 |
|
91 |
// if the environment check fails, initialize the plugin
|
92 |
if ( $this->is_environment_compatible() ) {
|
93 |
+
add_action( 'plugins_loaded', array( $this, 'init_plugin' ) );
|
94 |
}
|
95 |
}
|
96 |
|
98 |
/**
|
99 |
* Cloning instances is forbidden due to singleton pattern.
|
100 |
*
|
101 |
+
* @since 2.3.0
|
102 |
*/
|
103 |
public function __clone() {
|
104 |
_doing_it_wrong( __FUNCTION__, sprintf( 'You cannot clone instances of %s.', get_class( $this ) ), '1.0.0' );
|
108 |
/**
|
109 |
* Unserializing instances is forbidden due to singleton pattern.
|
110 |
*
|
111 |
+
* @since 2.3.0
|
112 |
*/
|
113 |
public function __wakeup() {
|
114 |
_doing_it_wrong( __FUNCTION__, sprintf( 'You cannot unserialize instances of %s.', get_class( $this ) ), '1.0.0' );
|
162 |
/**
|
163 |
* Loads the base framework classes.
|
164 |
*
|
165 |
+
* @since 2.3.0
|
166 |
*/
|
167 |
protected function load_framework() {
|
168 |
|
179 |
/**
|
180 |
* Gets the framework version in namespace form.
|
181 |
*
|
182 |
+
* @since 2.3.0
|
183 |
*
|
184 |
* @return string
|
185 |
*/
|
192 |
/**
|
193 |
* Gets the framework version used by this plugin.
|
194 |
*
|
195 |
+
* @since 2.3.0
|
196 |
*
|
197 |
* @return string
|
198 |
*/
|
203 |
|
204 |
|
205 |
/**
|
206 |
+
* Checks the server environment and other factors and deactivates plugins as necessary.
|
|
|
207 |
*
|
208 |
+
* Based on {@link http://wptavern.com/how-to-prevent-wordpress-plugins-from-activating-on-sites-with-incompatible-hosting-environments}
|
209 |
*
|
210 |
+
* @since 2.3.0
|
211 |
*/
|
212 |
public function activation_check() {
|
213 |
|
226 |
// enable the PayPal gateway on activation
|
227 |
$paypal_settings = get_option( 'woocommerce_braintree_paypal_settings', array() );
|
228 |
$paypal_settings['enabled'] = 'yes';
|
229 |
+
|
230 |
update_option( 'woocommerce_braintree_paypal_settings', $paypal_settings );
|
231 |
}
|
232 |
|
233 |
/**
|
234 |
+
* Checks the environment when loading WordPress, just in case the environment changes after activation.
|
235 |
+
*
|
236 |
+
* @internal
|
237 |
*
|
238 |
+
* @since 2.3.0
|
239 |
*/
|
240 |
public function check_environment() {
|
241 |
|
251 |
/**
|
252 |
* Checks the environment for compatibility problems.
|
253 |
*
|
254 |
+
* @since 2.3.0
|
255 |
+
*
|
256 |
* @param bool $during_activation whether this check is during plugin activation
|
257 |
* @return string|bool the error message if one exists, or false if everything's okay
|
258 |
*/
|
277 |
/**
|
278 |
* Adds notices for out-of-date WordPress and/or WooCommerce versions.
|
279 |
*
|
280 |
+
* @internal
|
281 |
+
*
|
282 |
+
* @since 2.3.0
|
283 |
*/
|
284 |
public function add_plugin_notices() {
|
285 |
|
316 |
/**
|
317 |
* Determines if the required plugins are compatible.
|
318 |
*
|
319 |
+
* @since 2.3.0
|
320 |
*
|
321 |
* @return bool
|
322 |
*/
|
329 |
/**
|
330 |
* Determines if the WordPress compatible.
|
331 |
*
|
332 |
+
* @since 2.3.0
|
333 |
*
|
334 |
* @return bool
|
335 |
*/
|
342 |
/**
|
343 |
* Determines if the WooCommerce compatible.
|
344 |
*
|
345 |
+
* @since 2.3.0
|
346 |
*
|
347 |
* @return bool
|
348 |
*/
|
355 |
/**
|
356 |
* Deactivates the plugin.
|
357 |
*
|
358 |
+
* @since 2.3.0
|
359 |
*/
|
360 |
protected function deactivate_plugin() {
|
361 |
|
370 |
/**
|
371 |
* Determines if the server environment is compatible with this plugin.
|
372 |
*
|
373 |
+
* @since 2.3.0
|
|
|
|
|
374 |
*
|
375 |
* @return bool
|
376 |
*/
|
383 |
/**
|
384 |
* Gets the message for display when the environment is incompatible with this plugin.
|
385 |
*
|
386 |
+
* @since 2.3.0
|
387 |
*
|
388 |
* @return string
|
389 |
*/
|
396 |
/**
|
397 |
* Adds an admin notice to be displayed.
|
398 |
*
|
399 |
+
* @since 2.3.0
|
400 |
*
|
401 |
* @param string $slug notice slug/ID
|
402 |
* @param string $class notice HTML class
|
404 |
*/
|
405 |
public function add_admin_notice( $slug, $class, $message ) {
|
406 |
|
407 |
+
$this->notices[ $slug ] = array(
|
408 |
'class' => $class,
|
409 |
'message' => $message
|
410 |
+
);
|
411 |
}
|
412 |
|
413 |
|
414 |
/**
|
415 |
+
* Displays any admin notices added by the plugin loader
|
416 |
*
|
417 |
* @internal
|
418 |
*
|
419 |
+
* @since 2.3.0
|
420 |
*/
|
421 |
public function admin_notices() {
|
422 |
|
423 |
+
foreach ( (array) $this->notices as $notice_key => $notice ) :
|
424 |
|
425 |
+
?>
|
426 |
+
<div class="<?php echo esc_attr( $notice['class'] ); ?>">
|
427 |
+
<p><?php echo wp_kses( $notice['message'], array( 'a' => array( 'href' => array() ) ) ); ?></p>
|
428 |
+
</div>
|
429 |
+
<?php
|
430 |
+
|
431 |
+
endforeach;
|
432 |
+
}
|
433 |
+
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Adds the Documentation URI header.
|
437 |
+
*
|
438 |
+
* @internal
|
439 |
+
*
|
440 |
+
* @since 2.5.0
|
441 |
+
*
|
442 |
+
* @param array $headers original plugin headers
|
443 |
+
* @return array
|
444 |
+
*/
|
445 |
+
public function add_documentation_header( $headers ) {
|
446 |
+
|
447 |
+
$headers[] = 'Documentation URI';
|
448 |
+
|
449 |
+
return $headers;
|
450 |
}
|
451 |
|
452 |
|
453 |
/**
|
454 |
+
* Gets the main loader instance.
|
455 |
*
|
456 |
* Ensures only one instance can be loaded.
|
457 |
*
|
458 |
+
* @since 2.3.0
|
459 |
*
|
460 |
+
* @return \WC_PayPal_Braintree_Loader
|
461 |
*/
|
462 |
public static function instance() {
|
463 |
|