Changeset 2776894
- Timestamp:
- 08/29/2022 04:04:15 AM (4 years ago)
- Location:
- zipmoney-payments-woocommerce
- Files:
-
- 242 added
- 18 edited
-
tags/2.3.14 (added)
-
tags/2.3.14/LICENSE.txt (added)
-
tags/2.3.14/README.txt (added)
-
tags/2.3.14/assets (added)
-
tags/2.3.14/assets/css (added)
-
tags/2.3.14/assets/css/woocommerce-zipmoney-payment-admin.css (added)
-
tags/2.3.14/assets/css/woocommerce-zipmoney-payment-front.css (added)
-
tags/2.3.14/assets/img (added)
-
tags/2.3.14/assets/img/loader.gif (added)
-
tags/2.3.14/assets/img/loading.gif (added)
-
tags/2.3.14/assets/js (added)
-
tags/2.3.14/assets/js/admin_options.js (added)
-
tags/2.3.14/assets/js/woocommerce-zipmoney-payment-front.js (added)
-
tags/2.3.14/assets/js/zip_order_button.js (added)
-
tags/2.3.14/bin (added)
-
tags/2.3.14/bin/install-wp-tests.sh (added)
-
tags/2.3.14/build (added)
-
tags/2.3.14/build.xml (added)
-
tags/2.3.14/build/index.asset.php (added)
-
tags/2.3.14/build/index.js (added)
-
tags/2.3.14/build/index.js.map (added)
-
tags/2.3.14/composer.json (added)
-
tags/2.3.14/includes (added)
-
tags/2.3.14/includes/api (added)
-
tags/2.3.14/includes/api/class-wc-zipmoney-payment-gateway-api-abstract.php (added)
-
tags/2.3.14/includes/api/class-wc-zipmoney-payment-gateway-api-charge.php (added)
-
tags/2.3.14/includes/api/class-wc-zipmoney-payment-gateway-api-checkout.php (added)
-
tags/2.3.14/includes/class-wc-zipmoney-payment-gateway-blocks-support.php (added)
-
tags/2.3.14/includes/class-wc-zipmoney-payment-gateway-config.php (added)
-
tags/2.3.14/includes/class-wc-zipmoney-payment-gateway-util.php (added)
-
tags/2.3.14/includes/class-wc-zipmoney-payment-gateway-widget.php (added)
-
tags/2.3.14/includes/class-wc-zipmoney-payment-gateway.php (added)
-
tags/2.3.14/includes/compatibility (added)
-
tags/2.3.14/includes/compatibility/abstract-wc-data-compatibility.php (added)
-
tags/2.3.14/includes/compatibility/class-wc-core-compatibility.php (added)
-
tags/2.3.14/includes/compatibility/class-wc-order-compatibility.php (added)
-
tags/2.3.14/includes/controller (added)
-
tags/2.3.14/includes/controller/class-wc-zipmoney-payment-abstract-controller.php (added)
-
tags/2.3.14/includes/controller/class-wc-zipmoney-payment-charge-controller.php (added)
-
tags/2.3.14/includes/controller/class-wc-zipmoney-payment-checkout-controller.php (added)
-
tags/2.3.14/includes/view (added)
-
tags/2.3.14/includes/view/backend (added)
-
tags/2.3.14/includes/view/backend/admin_options.php (added)
-
tags/2.3.14/includes/view/backend/charge_buttons.php (added)
-
tags/2.3.14/includes/view/frontend (added)
-
tags/2.3.14/includes/view/frontend/checkout_notification_section.php (added)
-
tags/2.3.14/includes/view/frontend/error_page.php (added)
-
tags/2.3.14/includes/view/frontend/express_payment_button.php (added)
-
tags/2.3.14/includes/view/frontend/iframe_redirect.php (added)
-
tags/2.3.14/includes/view/frontend/notification_page.php (added)
-
tags/2.3.14/includes/view/frontend/order_button.php (added)
-
tags/2.3.14/languages (added)
-
tags/2.3.14/languages/default.mo (added)
-
tags/2.3.14/languages/default.po (added)
-
tags/2.3.14/languages/default.pot (added)
-
tags/2.3.14/languages/zippayment-es_MX.mo (added)
-
tags/2.3.14/languages/zippayment-es_MX.po (added)
-
tags/2.3.14/log.txt (added)
-
tags/2.3.14/test.txt (added)
-
tags/2.3.14/tests (added)
-
tags/2.3.14/tests/bootstrap.php (added)
-
tags/2.3.14/tests/test-charge-api.php (added)
-
tags/2.3.14/tests/test-checkout-api.php (added)
-
tags/2.3.14/tests/test-sample.php (added)
-
tags/2.3.14/tests/wc-zipmoney-test-main.php (added)
-
tags/2.3.14/vendor (added)
-
tags/2.3.14/vendor/autoload.php (added)
-
tags/2.3.14/vendor/bin (added)
-
tags/2.3.14/vendor/composer (added)
-
tags/2.3.14/vendor/composer/ClassLoader.php (added)
-
tags/2.3.14/vendor/composer/LICENSE (added)
-
tags/2.3.14/vendor/composer/autoload_classmap.php (added)
-
tags/2.3.14/vendor/composer/autoload_namespaces.php (added)
-
tags/2.3.14/vendor/composer/autoload_psr4.php (added)
-
tags/2.3.14/vendor/composer/autoload_real.php (added)
-
tags/2.3.14/vendor/composer/autoload_static.php (added)
-
tags/2.3.14/vendor/composer/installed.json (added)
-
tags/2.3.14/vendor/zipmoney (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/HEAD (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/ORIG_HEAD (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/config (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/description (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/applypatch-msg.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/commit-msg.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/fsmonitor-watchman.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/post-update.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-applypatch.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-commit.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-merge-commit.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-push.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-rebase.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/pre-receive.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/prepare-commit-msg.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/hooks/update.sample (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/index (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/info (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/info/exclude (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/info/refs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/HEAD (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs/heads (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs/heads/master (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs/remotes (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs/remotes/origin (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/logs/refs/remotes/origin/HEAD (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/5e (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/5e/60a146bdbcfb2e8af7cd835441c880325d9419 (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/info (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/info/packs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/pack (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/pack/pack-82db4f4ceed51fa2276ce058eab640bbc348d4fd.idx (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/objects/pack/pack-82db4f4ceed51fa2276ce058eab640bbc348d4fd.pack (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/packed-refs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/heads (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/heads/master (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/remotes (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/remotes/origin (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/remotes/origin/HEAD (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/.git/refs/tags (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/LICENSE.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/README.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/autoload.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/build (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/build.xml (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/build/shell (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/build/shell/publish.sh (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/composer.json (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/ChargesApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/CheckoutsApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/CustomersApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/RefundsApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/SettlementsApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Api/TokensApi.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Address.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Authority.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CaptureChargeRequest.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Charge.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ChargeCollection.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ChargeOrder.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Checkout.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutConfiguration.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutFeatures.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutFeaturesTokenisation.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutOrder.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateChargeRequest.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequest.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequestFeatures.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequestFeaturesTokenisation.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateRefundRequest.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/CreateTokenRequest.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Customer.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponse.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponseError.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponseErrorDetails.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Flightadditionaldetails.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/FlightadditionaldetailsPassengers.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/HateoasLinks.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/HateoaslinksLinks.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/InlineResponse200.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Metadata.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/OrderItem.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/OrderItemAdditionalDetails.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/OrderShipping.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/OrderShippingTracking.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Refund.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Settlement.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/SettlementTransactions.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Shopper.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/ShopperStatistics.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/docs/Model/Token.md (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/ChargesApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/CheckoutsApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/CustomersApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/RefundsApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/SettlementsApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Api/TokensApi.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/ApiClient.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/ApiException.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Configuration.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Address.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Authority.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CaptureChargeRequest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Charge.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ChargeCollection.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ChargeOrder.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Checkout.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutConfiguration.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutFeatures.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutFeaturesTokenisation.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutOrder.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateChargeRequest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequestFeatures.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequestFeaturesTokenisation.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateRefundRequest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CreateTokenRequest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/CurrencyUtil.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Customer.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponse.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponseError.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponseErrorDetails.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Flightadditionaldetails.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/FlightadditionaldetailsPassengers.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/HateoasLinks.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/HateoaslinksLinks.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/InlineResponse200.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Metadata.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/OrderItem.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/OrderItemAdditionalDetails.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/OrderShipping.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/OrderShippingTracking.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Refund.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Settlement.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/SettlementTransactions.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Shopper.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/ShopperStatistics.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/Model/Token.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/lib/ObjectSerializer.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/phpunit.xml.dist (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Api (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Api/ChargesApiTest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Api/CheckoutsApiTest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Api/RefundsApiTest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/ConfigurationTest.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Helper (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Helper/Payload.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/Setup.php (added)
-
tags/2.3.14/vendor/zipmoney/merchantapi-php/test/auth.ini (added)
-
tags/2.3.14/zipmoney-payment-gateway.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/css/woocommerce-zipmoney-payment-front.css (modified) (1 diff)
-
trunk/assets/js/zip_order_button.js (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/build/index.js.map (modified) (1 diff)
-
trunk/includes/api/class-wc-zipmoney-payment-gateway-api-charge.php (modified) (10 diffs)
-
trunk/includes/api/class-wc-zipmoney-payment-gateway-api-checkout.php (modified) (3 diffs)
-
trunk/includes/class-wc-zipmoney-payment-gateway-blocks-support.php (modified) (1 diff)
-
trunk/includes/class-wc-zipmoney-payment-gateway-config.php (modified) (10 diffs)
-
trunk/includes/class-wc-zipmoney-payment-gateway-util.php (modified) (1 diff)
-
trunk/includes/class-wc-zipmoney-payment-gateway-widget.php (modified) (3 diffs)
-
trunk/includes/class-wc-zipmoney-payment-gateway.php (modified) (8 diffs)
-
trunk/includes/controller/class-wc-zipmoney-payment-charge-controller.php (modified) (7 diffs)
-
trunk/includes/controller/class-wc-zipmoney-payment-checkout-controller.php (modified) (2 diffs)
-
trunk/includes/view/frontend/order_button.php (modified) (1 diff)
-
trunk/vendor/zipmoney/merchantapi-php/lib/Api/ChargesApi.php (modified) (1 diff)
-
trunk/zipmoney-payment-gateway.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zipmoney-payments-woocommerce/trunk/README.txt
r2685692 r2776894 3 3 Tags: zipmoney payments woocommerce, zipmoney payments module for woocommerce, zipmoney woocommerce addon , zipmoney payment gateway for woocommerce, zipmoney for woocommerce, zipmoney payment gateway for wordpress, buy now pay later, zippay woocommerce plugin, Own it now, pay later, Zip Co, Zip 4 4 Requires at least: WP 4.0 5 Tested up to: 5.96 Stable tag: 2.3.1 35 Tested up to: 6.0.1 6 Stable tag: 2.3.14 7 7 License: GPLv2 or later License http://www.gnu.org/licenses/gpl-2.0.html 8 8 … … 207 207 * Plugin tested under wordpress version 5.9 208 208 * fixed Divi plugin Interfering issue 209 210 = 2.3.14 = 211 * Plugin tested under wordpress version 6.0.1 212 * Plugin tested under woocommerce version 6.7.0 213 * Added tokenisation feature -
zipmoney-payments-woocommerce/trunk/assets/css/woocommerce-zipmoney-payment-front.css
r2464696 r2776894 63 63 -ms-transform: translate(-50%,-50%); 64 64 } 65 66 .save-zip-account{ 67 margin-left: 10px; 68 display: inline; 69 } -
zipmoney-payments-woocommerce/trunk/assets/js/zip_order_button.js
r2464696 r2776894 89 89 } 90 90 }); 91 $(".wc-block-components-checkout-place-order-button").on('click', function(e){ 92 var payment_method = $('input[name="radio-control-wc-payment-method-options"]:checked').val(); 93 //show the over lay 94 if (payment_method == 'zipmoney') { 95 $('div.zip-overlay').css('display', 'block'); 96 } 97 }); 91 98 92 99 }); -
zipmoney-payments-woocommerce/trunk/build/index.asset.php
r2662714 r2776894 1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n'), 'version' => ' d1f398c13142613a11516c4c7e32b5fc');1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n'), 'version' => 'eb121aaca370f966dd6eda9416301a5e'); -
zipmoney-payments-woocommerce/trunk/build/index.js
r2662714 r2776894 1 !function(){"use strict";var e=window.wp.element,t=window.wp.i18n,n=window.wc.wcSettings,i=window.wc.wcBlocksRegistry;const a="zipmoney";var o;const l=(0,n.getSetting)("zipmoney_data",{}),c=(0,t.__)("Zip now, pay later","zippayment"),r=l.title?l.title:c,s=()=>l.description?l.description:"",p={name:a,label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:r})}),null),content:(0,e.createElement)(s,null),edit:(0,e.createElement)(s,null),canMakePayment:()=>!0,paymentMethodId:a,ariaLabel:r,supports:{features:null!==(o=null==l?void 0:l.supports)&&void 0!==o?o:[]}};(0,i.registerPaymentMethod)(p)}(); 1 /******/ (function() { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./client/blocks/constants.js": 6 /*!************************************!*\ 7 !*** ./client/blocks/constants.js ***! 8 \************************************/ 9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "PAYMENT_METHOD_NAME": function() { return /* binding */ PAYMENT_METHOD_NAME; } 14 /* harmony export */ }); 15 const PAYMENT_METHOD_NAME = 'zipmoney'; 16 17 /***/ }), 18 19 /***/ "@woocommerce/blocks-registry": 20 /*!******************************************!*\ 21 !*** external ["wc","wcBlocksRegistry"] ***! 22 \******************************************/ 23 /***/ (function(module) { 24 25 module.exports = window["wc"]["wcBlocksRegistry"]; 26 27 /***/ }), 28 29 /***/ "@woocommerce/settings": 30 /*!************************************!*\ 31 !*** external ["wc","wcSettings"] ***! 32 \************************************/ 33 /***/ (function(module) { 34 35 module.exports = window["wc"]["wcSettings"]; 36 37 /***/ }), 38 39 /***/ "@wordpress/element": 40 /*!*********************************!*\ 41 !*** external ["wp","element"] ***! 42 \*********************************/ 43 /***/ (function(module) { 44 45 module.exports = window["wp"]["element"]; 46 47 /***/ }), 48 49 /***/ "@wordpress/i18n": 50 /*!******************************!*\ 51 !*** external ["wp","i18n"] ***! 52 \******************************/ 53 /***/ (function(module) { 54 55 module.exports = window["wp"]["i18n"]; 56 57 /***/ }) 58 59 /******/ }); 60 /************************************************************************/ 61 /******/ // The module cache 62 /******/ var __webpack_module_cache__ = {}; 63 /******/ 64 /******/ // The require function 65 /******/ function __webpack_require__(moduleId) { 66 /******/ // Check if module is in cache 67 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 68 /******/ if (cachedModule !== undefined) { 69 /******/ return cachedModule.exports; 70 /******/ } 71 /******/ // Create a new module (and put it into the cache) 72 /******/ var module = __webpack_module_cache__[moduleId] = { 73 /******/ // no module.id needed 74 /******/ // no module.loaded needed 75 /******/ exports: {} 76 /******/ }; 77 /******/ 78 /******/ // Execute the module function 79 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 80 /******/ 81 /******/ // Return the exports of the module 82 /******/ return module.exports; 83 /******/ } 84 /******/ 85 /************************************************************************/ 86 /******/ /* webpack/runtime/compat get default export */ 87 /******/ !function() { 88 /******/ // getDefaultExport function for compatibility with non-harmony modules 89 /******/ __webpack_require__.n = function(module) { 90 /******/ var getter = module && module.__esModule ? 91 /******/ function() { return module['default']; } : 92 /******/ function() { return module; }; 93 /******/ __webpack_require__.d(getter, { a: getter }); 94 /******/ return getter; 95 /******/ }; 96 /******/ }(); 97 /******/ 98 /******/ /* webpack/runtime/define property getters */ 99 /******/ !function() { 100 /******/ // define getter functions for harmony exports 101 /******/ __webpack_require__.d = function(exports, definition) { 102 /******/ for(var key in definition) { 103 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 104 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 105 /******/ } 106 /******/ } 107 /******/ }; 108 /******/ }(); 109 /******/ 110 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 111 /******/ !function() { 112 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 113 /******/ }(); 114 /******/ 115 /******/ /* webpack/runtime/make namespace object */ 116 /******/ !function() { 117 /******/ // define __esModule on exports 118 /******/ __webpack_require__.r = function(exports) { 119 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 120 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 121 /******/ } 122 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 123 /******/ }; 124 /******/ }(); 125 /******/ 126 /************************************************************************/ 127 var __webpack_exports__ = {}; 128 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 129 !function() { 130 /*!********************************!*\ 131 !*** ./client/blocks/index.js ***! 132 \********************************/ 133 __webpack_require__.r(__webpack_exports__); 134 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 135 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 136 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 137 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 138 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); 139 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__); 140 /* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/blocks-registry */ "@woocommerce/blocks-registry"); 141 /* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_3__); 142 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./client/blocks/constants.js"); 143 144 145 /** 146 * External dependencies 147 */ 148 149 150 151 152 /** 153 * Internal dependencies 154 */ 155 156 157 const settings = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('zipmoney_data', {}); 158 console.log('zip settings:'.settings); 159 160 const defaultLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Zip now, pay later', 'zippayment'); 161 162 const label = settings.title ? settings.title : defaultLabel; 163 /** 164 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps 165 */ 166 167 const saveZip = () => { 168 return settings.savezip; 169 }; 170 171 const SaveZipCheckbox = () => { 172 const [isChecked, setChecked] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(saveZip); 173 174 const handleChange = event => { 175 setChecked(!isChecked); 176 let formData = new FormData(); 177 formData.append("savezipaccount", !isChecked); 178 const requestOptions = { 179 method: 'POST', 180 body: formData 181 }; 182 fetch(settings.sessionUrl, requestOptions).then(response => response.json()); 183 }; 184 185 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 186 Zip.Widget.render(); 187 }, []); 188 189 if (settings.tokenisation === true) { 190 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, ' ', (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 191 class: "zip-overlay", 192 onclick: "this.style.display = 'none';" 193 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 194 class: "zip-overlay-text" 195 }, "Creating charge, please wait...")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { 196 id: "zipmoney-learn-more", 197 class: "zip-hover", 198 "zm-widget": "popup", 199 "zm-popup-asset": "checkoutdialog" 200 }, "Learn More"), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { 201 type: "checkbox", 202 rel: "saveZipAccount", 203 value: "{isChecked}", 204 id: "saveZipAccount", 205 checked: isChecked, 206 onChange: handleChange, 207 disabled: false 208 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", { 209 className: "save-zip-account", 210 htmlFor: "saveZipAccount" 211 }, "Save Zip Account for future purchases")); 212 } 213 214 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, ' ', (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 215 class: "zip-overlay", 216 onclick: "this.style.display = 'none';" 217 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 218 class: "zip-overlay-text" 219 }, "Creating charge, please wait...")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { 220 id: "zipmoney-learn-more", 221 class: "zip-hover", 222 "zm-widget": "popup", 223 "zm-popup-asset": "checkoutdialog" 224 }, "Learn More")); 225 }; 226 /** 227 * Label component 228 * 229 * @param {*} props Props from payment API. 230 */ 231 232 233 const Label = props => { 234 const { 235 PaymentMethodLabel 236 } = props.components; 237 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PaymentMethodLabel, { 238 text: label 239 }); 240 }; 241 /** 242 * Zipmoney payment method config object. 243 */ 244 245 246 const zipMoneyPaymentMethod = { 247 name: _constants__WEBPACK_IMPORTED_MODULE_4__.PAYMENT_METHOD_NAME, 248 label: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Label, null), 249 content: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SaveZipCheckbox, null), 250 edit: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SaveZipCheckbox, null), 251 canMakePayment: () => true, 252 paymentMethodId: _constants__WEBPACK_IMPORTED_MODULE_4__.PAYMENT_METHOD_NAME, 253 supports: { 254 features: ['products'] 255 }, 256 ariaLabel: label 257 }; 258 (0,_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_3__.registerPaymentMethod)(zipMoneyPaymentMethod); 259 }(); 260 /******/ })() 261 ; 262 //# sourceMappingURL=index.js.map -
zipmoney-payments-woocommerce/trunk/build/index.js.map
r2662714 r2776894 1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAO,MAAMA,mBAAmB,GAAG,UAA5B;;;;;;;;;;ACAP;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;; ;;ACNA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AACA;AAEA,MAAMI,QAAQ,GAAGF,iEAAU,CAAE,eAAF,EAAmB,EAAnB,CAA3B;;AACA,MAAMG,YAAY,GAAGJ,mDAAE,CAAE,oBAAF,EAAwB,YAAxB,CAAvB;;AACA,MAAMK,KAAK,GAAGF,QAAQ,CAACG,KAAT,GAAiBH,QAAQ,CAACG,KAA1B,GAAkCF,YAAhD;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AACA,MAAMG,OAAO,GAAG,MAAM;AACrB,SAAOJ,QAAQ,CAACK,WAAT,GAAuBL,QAAQ,CAACK,WAAhC,GAA8C,EAArD;AACA,CAFD;AAIA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,KAAK,GAAKC,KAAF,IAAa;AAC1B,QAAM;AAAEC,IAAAA;AAAF,MAAyBD,KAAK,CAACE,UAArC;AACA,SAAO,kEAAC,kBAAD;AAAoB,QAAI,EAAGP;AAA3B,IAAP;AACA,CAHD;AAKA;AACA;AACA;;;AACA,MAAMQ,qBAAqB,GAAG;AAC7BC,EAAAA,IAAI,EAAEf,2DADuB;AAE7BM,EAAAA,KAAK,EAAE,kEAAC,KAAD,OAFsB;AAG7BU,EAAAA,OAAO,EAAE,kEAAC,OAAD,OAHoB;AAI7BC,EAAAA,IAAI,EAAE,kEAAC,OAAD,OAJuB;AAK7BC,EAAAA,cAAc,EAAE,MAAM,IALO;AAM7BC,EAAAA,eAAe,EAAEnB,2DANY;AAO7BoB,EAAAA,SAAS,EAAEd,KAPkB;AAQ7Be,EAAAA,QAAQ,EAAE;AACTC,IAAAA,QAAQ,wBAAElB,QAAF,aAAEA,QAAF,uBAAEA,QAAQ,CAAEiB,QAAZ,mEAAwB;AADvB;AARmB,CAA9B;AAaAlB,mFAAqB,CAAEW,qBAAF,CAArB,C","sources":["webpack://zipmoney-payments-woocommerce/./client/blocks/constants.js","webpack://zipmoney-payments-woocommerce/external window [\"wc\",\"wcBlocksRegistry\"]","webpack://zipmoney-payments-woocommerce/external window [\"wc\",\"wcSettings\"]","webpack://zipmoney-payments-woocommerce/external window [\"wp\",\"element\"]","webpack://zipmoney-payments-woocommerce/external window [\"wp\",\"i18n\"]","webpack://zipmoney-payments-woocommerce/webpack/bootstrap","webpack://zipmoney-payments-woocommerce/webpack/runtime/compat get default export","webpack://zipmoney-payments-woocommerce/webpack/runtime/define property getters","webpack://zipmoney-payments-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://zipmoney-payments-woocommerce/webpack/runtime/make namespace object","webpack://zipmoney-payments-woocommerce/./client/blocks/index.js"],"sourcesContent":["export const PAYMENT_METHOD_NAME = 'zipmoney';\n","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getSetting } from '@woocommerce/settings';\nimport { registerPaymentMethod } from '@woocommerce/blocks-registry';\n\n/**\n * Internal dependencies\n */\nimport { PAYMENT_METHOD_NAME } from './constants';\n\nconst settings = getSetting( 'zipmoney_data', {} );\nconst defaultLabel = __( 'Zip now, pay later', 'zippayment' );\nconst label = settings.title ? settings.title : defaultLabel;\n\n/**\n * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps\n */\n\n/**\n * Content component\n */\nconst Content = () => {\n\treturn settings.description ? settings.description : '';\n};\n\n/**\n * Label component\n *\n * @param {*} props Props from payment API.\n */\nconst Label = ( props ) => {\n\tconst { PaymentMethodLabel } = props.components;\n\treturn <PaymentMethodLabel text={ label } />;\n};\n\n/**\n * Zipmoney payment method config object.\n */\nconst zipMoneyPaymentMethod = {\n\tname: PAYMENT_METHOD_NAME,\n\tlabel: <Label />,\n\tcontent: <Content />,\n\tedit: <Content />,\n\tcanMakePayment: () => true,\n\tpaymentMethodId: PAYMENT_METHOD_NAME,\n\tariaLabel: label,\n\tsupports: {\n\t\tfeatures: settings?.supports ?? [],\n\t},\n};\n\nregisterPaymentMethod( zipMoneyPaymentMethod );\n"],"names":["PAYMENT_METHOD_NAME","__","getSetting","registerPaymentMethod","settings","defaultLabel","label","title","Content","description","Label","props","PaymentMethodLabel","components","zipMoneyPaymentMethod","name","content","edit","canMakePayment","paymentMethodId","ariaLabel","supports","features"],"sourceRoot":""}1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAO,MAAMA,mBAAmB,GAAG,UAA5B;;;;;;;;;;ACAP;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACC;AACA;AACA;AACA;AAEA;AACD;AACA;;AACC;AAEA,MAAMM,QAAQ,GAAGJ,iEAAU,CAAE,eAAF,EAAmB,EAAnB,CAA3B;AACAK,OAAO,CAACC,GAAR,CAAY,gBAAgBF,QAA5B;;AACA,MAAMG,YAAY,GAAGR,mDAAE,CAAE,oBAAF,EAAwB,YAAxB,CAAvB;;AACA,MAAMS,KAAK,GAAGJ,QAAQ,CAACK,KAAT,GAAiBL,QAAQ,CAACK,KAA1B,GAAkCF,YAAhD;AAEA;AACD;AACA;;AAEC,MAAMG,OAAO,GAAG,MAAM;AACrB,SAAON,QAAQ,CAACO,OAAhB;AACA,CAFD;;AAIA,MAAMC,eAAe,GAAG,MAAM;AAC9B,QAAM,CAAEC,SAAF,EAAaC,UAAb,IAA4BX,4DAAQ,CAAEO,OAAF,CAA1C;;AACA,QAAMK,YAAY,GAAIC,KAAD,IAAW;AAC/BF,IAAAA,UAAU,CAAC,CAACD,SAAF,CAAV;AACA,QAAII,QAAQ,GAAG,IAAIC,QAAJ,EAAf;AACUD,IAAAA,QAAQ,CAACE,MAAT,CAAgB,gBAAhB,EAAkC,CAACN,SAAnC;AACV,UAAMO,cAAc,GAAG;AACtBC,MAAAA,MAAM,EAAE,MADc;AAEtBC,MAAAA,IAAI,EAAEL;AAFgB,KAAvB;AAIAM,IAAAA,KAAK,CAACnB,QAAQ,CAACoB,UAAV,EAAsBJ,cAAtB,CAAL,CACEK,IADF,CACOC,QAAQ,IAAIA,QAAQ,CAACC,IAAT,EADnB;AAEE,GAVH;;AAWEzB,EAAAA,6DAAS,CAAC,MAAM;AACjB0B,IAAAA,GAAG,CAACC,MAAJ,CAAWC,MAAX;AACE,GAFQ,EAEN,EAFM,CAAT;;AAGA,MAAG1B,QAAQ,CAAC2B,YAAT,KAA0B,IAA7B,EAAmC;AACrC,WACC,kIACG,GADH,EAEC;AAAK,WAAK,EAAC,aAAX;AAAyB,aAAO,EAAC;AAAjC,OACI;AAAK,WAAK,EAAC;AAAX,yCADJ,CAFD,EAKC;AAAI,QAAE,EAAC,qBAAP;AAA6B,WAAK,EAAC,WAAnC;AAAgD,mBAAU,OAA1D;AAAmE,wBAAe;AAAlF,oBALD,EAMC;AACC,UAAI,EAAC,UADN;AAEC,SAAG,EAAC,gBAFL;AAGC,WAAK,EAAC,aAHP;AAIC,QAAE,EAAC,gBAJJ;AAKC,aAAO,EAAGlB,SALX;AAMC,cAAQ,EAAGE,YANZ;AAOC,cAAQ,EAAG;AAPZ,MAND,EAgBC;AAAO,eAAS,EAAC,kBAAjB;AAAoC,aAAO,EAAG;AAA9C,OACO,uCADP,CAhBD,CADD;AAuBG;;AACF,SACA,kIACE,GADF,EAEA;AAAK,SAAK,EAAC,aAAX;AAAyB,WAAO,EAAC;AAAjC,KACI;AAAK,SAAK,EAAC;AAAX,uCADJ,CAFA,EAKA;AAAI,MAAE,EAAC,qBAAP;AAA6B,SAAK,EAAC,WAAnC;AAAgD,iBAAU,OAA1D;AAAmE,sBAAe;AAAlF,kBALA,CADA;AASD,CAlDA;AAoDA;AACD;AACA;AACA;AACA;;;AACC,MAAMiB,KAAK,GAAKC,KAAF,IAAa;AAC1B,QAAM;AAAEC,IAAAA;AAAF,MAAyBD,KAAK,CAACE,UAArC;AACA,SAAO,kEAAC,kBAAD;AAAoB,QAAI,EAAG3B;AAA3B,IAAP;AACA,CAHD;AAKA;AACD;AACA;;;AACC,MAAM4B,qBAAqB,GAAG;AAC7BC,EAAAA,IAAI,EAAEvC,2DADuB;AAE7BU,EAAAA,KAAK,EAAE,kEAAC,KAAD,OAFsB;AAG7B8B,EAAAA,OAAO,EAAE,kEAAC,eAAD,OAHoB;AAI7BC,EAAAA,IAAI,EAAE,kEAAC,eAAD,OAJuB;AAK7BC,EAAAA,cAAc,EAAE,MAAM,IALO;AAM7BC,EAAAA,eAAe,EAAE3C,2DANY;AAO7B4C,EAAAA,QAAQ,EAAE;AACTC,IAAAA,QAAQ,EAAE,CAAE,UAAF;AADD,GAPmB;AAU7BC,EAAAA,SAAS,EAAEpC;AAVkB,CAA9B;AAaAP,mFAAqB,CAAEmC,qBAAF,CAArB,C","sources":["webpack://zipmoney-payments-woocommerce/./client/blocks/constants.js","webpack://zipmoney-payments-woocommerce/external window [\"wc\",\"wcBlocksRegistry\"]","webpack://zipmoney-payments-woocommerce/external window [\"wc\",\"wcSettings\"]","webpack://zipmoney-payments-woocommerce/external window [\"wp\",\"element\"]","webpack://zipmoney-payments-woocommerce/external window [\"wp\",\"i18n\"]","webpack://zipmoney-payments-woocommerce/webpack/bootstrap","webpack://zipmoney-payments-woocommerce/webpack/runtime/compat get default export","webpack://zipmoney-payments-woocommerce/webpack/runtime/define property getters","webpack://zipmoney-payments-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://zipmoney-payments-woocommerce/webpack/runtime/make namespace object","webpack://zipmoney-payments-woocommerce/./client/blocks/index.js"],"sourcesContent":["export const PAYMENT_METHOD_NAME = 'zipmoney';\r\n","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\r\n * External dependencies\r\n */\r\n import { __ } from '@wordpress/i18n';\r\n import { getSetting } from '@woocommerce/settings';\r\n import { registerPaymentMethod } from '@woocommerce/blocks-registry';\r\n import { useEffect, useState } from '@wordpress/element';\r\n \r\n /**\r\n * Internal dependencies\r\n */\r\n import { PAYMENT_METHOD_NAME } from './constants';\r\n \r\n const settings = getSetting( 'zipmoney_data', {} );\r\n console.log('zip settings:'.settings);\r\n const defaultLabel = __( 'Zip now, pay later', 'zippayment' );\r\n const label = settings.title ? settings.title : defaultLabel;\r\n \r\n /**\r\n * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps\r\n */\r\n \r\n const saveZip = () => {\r\n\t return settings.savezip;\r\n }\r\n \r\n const SaveZipCheckbox = () => {\r\n\tconst [ isChecked, setChecked ] = useState( saveZip );\r\n\tconst handleChange = (event) => {\r\n\t\tsetChecked(!isChecked);\r\n\t\tlet formData = new FormData();\r\n formData.append(\"savezipaccount\", !isChecked);\r\n\t\tconst requestOptions = {\r\n\t\t\tmethod: 'POST',\r\n\t\t\tbody: formData\r\n\t\t};\r\n\t\tfetch(settings.sessionUrl, requestOptions)\r\n\t\t\t.then(response => response.json());\r\n\t };\r\n\t useEffect(() => {\r\n\t\tZip.Widget.render();\r\n\t }, []);\r\n\t if(settings.tokenisation === true) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{ ' ' }\r\n\t\t\t<div class=\"zip-overlay\" onclick=\"this.style.display = 'none';\">\r\n \t\t\t<div class=\"zip-overlay-text\">Creating charge, please wait...</div>\r\n\t\t\t</div>\r\n\t\t\t<a id=\"zipmoney-learn-more\" class=\"zip-hover\" zm-widget=\"popup\" zm-popup-asset=\"checkoutdialog\">Learn More</a>\r\n\t\t\t<input\r\n\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\trel=\"saveZipAccount\"\r\n\t\t\t\tvalue=\"{isChecked}\"\r\n\t\t\t\tid=\"saveZipAccount\"\r\n\t\t\t\tchecked={ isChecked }\r\n\t\t\t\tonChange={ handleChange }\r\n\t\t\t\tdisabled={ false }\r\n\r\n\t\t\t/>\r\n\t\t\t<label className='save-zip-account' htmlFor={ \"saveZipAccount\" }>\r\n\t\t\t\t\t\t\t\t{ \"Save Zip Account for future purchases\" }\r\n\t\t\t</label>\r\n\t\t</>\t\r\n\t\t\r\n\t);\r\n\t }\r\n\t return (\r\n\t\t<>\r\n\t\t{ ' ' }\r\n\t\t<div class=\"zip-overlay\" onclick=\"this.style.display = 'none';\">\r\n \t\t<div class=\"zip-overlay-text\">Creating charge, please wait...</div>\r\n\t\t</div>\r\n\t\t<a id=\"zipmoney-learn-more\" class=\"zip-hover\" zm-widget=\"popup\" zm-popup-asset=\"checkoutdialog\">Learn More</a>\r\n\t\t</>\r\n\t ); \r\n};\r\n\r\n /**\r\n * Label component\r\n *\r\n * @param {*} props Props from payment API.\r\n */\r\n const Label = ( props ) => {\r\n\t const { PaymentMethodLabel } = props.components;\r\n\t return <PaymentMethodLabel text={ label } />;\r\n };\r\n \r\n /**\r\n * Zipmoney payment method config object.\r\n */\r\n const zipMoneyPaymentMethod = {\r\n\t name: PAYMENT_METHOD_NAME,\r\n\t label: <Label />,\r\n\t content: <SaveZipCheckbox />,\r\n\t edit: <SaveZipCheckbox />,\r\n\t canMakePayment: () => true,\r\n\t paymentMethodId: PAYMENT_METHOD_NAME,\r\n\t supports: {\r\n\t\t features: [ 'products' ],\r\n\t },\r\n\t ariaLabel: label,\r\n };\r\n \r\n registerPaymentMethod( zipMoneyPaymentMethod );\r\n "],"names":["PAYMENT_METHOD_NAME","__","getSetting","registerPaymentMethod","useEffect","useState","settings","console","log","defaultLabel","label","title","saveZip","savezip","SaveZipCheckbox","isChecked","setChecked","handleChange","event","formData","FormData","append","requestOptions","method","body","fetch","sessionUrl","then","response","json","Zip","Widget","render","tokenisation","Label","props","PaymentMethodLabel","components","zipMoneyPaymentMethod","name","content","edit","canMakePayment","paymentMethodId","supports","features","ariaLabel"],"sourceRoot":""} -
zipmoney-payments-woocommerce/trunk/includes/api/class-wc-zipmoney-payment-gateway-api-charge.php
r2560395 r2776894 11 11 use \zipMoney\ObjectSerializer; 12 12 use \zipMoney\Api\CheckoutsApi; 13 use \zipMoney\Api\TokensApi; 14 use \zipMoney\Model\CreateTokenRequest; 13 15 14 16 class WC_Zipmoney_Payment_Gateway_API_Request_Charge extends WC_Zipmoney_Payment_Gateway_API_Abstract … … 242 244 * ) 243 245 */ 244 public function create_charge(WC_Session $WC_Session, $checkout_id, $ api_key)246 public function create_charge(WC_Session $WC_Session, $checkout_id, $orderId, $api_key) 245 247 { 246 248 $response = array( … … 248 250 'message' => '' 249 251 ); 250 252 251 253 252 254 parent::set_api_key($api_key); 253 255 254 256 try { 255 256 $order_id = get_option($checkout_id); 257 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation()) { 258 $order_id = $orderId; 259 } 260 if (!$order_id) { 261 $order_id = get_option($checkout_id); 262 } 257 263 //$region = $this->WC_Zipmoney_Payment_Gateway->get_option(WC_Zipmoney_Payment_Gateway_Config::CONFIG_SELECT_REGION); 258 if ($order_id == null) {264 if ($order_id == null) { 259 265 260 266 WC_Zipmoney_Payment_Gateway_Util::log(" get checkout API"); … … 263 269 } 264 270 265 $order = new WC_Order( $order_id);266 if ($order->get_status() == "processing" || $order->get_status() == "zip-authorised"){267 WC_Zipmoney_Payment_Gateway_Util::log(" calling charge 2nd time, order completed, redirect to thank you page");268 wp_redirect($order->get_checkout_order_received_url());269 exit;270 } 271 271 $order = new WC_Order($order_id); 272 if ($order->get_status() == "processing" || $order->get_status() == "zip-authorised") { 273 WC_Zipmoney_Payment_Gateway_Util::log(" calling charge 2nd time, order completed, redirect to thank you page"); 274 wp_redirect($order->get_checkout_order_received_url()); 275 exit; 276 } 277 272 278 $body = $this->_prepare_charges_request($checkout_id, $order_id, $order); 273 WC_Zipmoney_Payment_Gateway_Util::log(sprintf('Charge request sent for order (%s)', $order_id) , WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_DEBUG);274 275 279 WC_Zipmoney_Payment_Gateway_Util::log(sprintf('Charge request sent for order (%s)', $order_id), WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_DEBUG); 280 281 276 282 //write the charge object info to order meta 277 283 … … 326 332 WC_Zipmoney_Payment_Gateway_Util::log('Order cancelled', WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_DEBUG); 327 333 } 328 } catch (ApiException $exception) {334 } catch (ApiException $exception) { 329 335 $response = WC_Zipmoney_Payment_Gateway_Util::handle_create_charge_api_exception($exception); 330 336 WC_Zipmoney_Payment_Gateway_Util::log($response['message'], WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_INFO); 331 if(!empty($order)){ 337 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation() && $response['code'] == 403) { 338 $current_user = wp_get_current_user(); 339 $uId = $current_user->ID; 340 $this->_removeCustomerToken($uId); 341 } 342 if (!empty($order)) { 332 343 $order->add_order_note($response['message']); 333 344 $order->update_status('cancelled', 'order_note'); … … 336 347 //delete the option 337 348 delete_option($checkout_id); 338 339 349 } catch (Exception $exception) { 340 if (!empty($order)){350 if (!empty($order)) { 341 351 $order->add_order_note($exception->getCode() . $exception->getMessage()); 342 352 $order->update_status('cancelled', 'order_note'); … … 345 355 $response['message'] = $exception->getMessage(); 346 356 347 WC_Zipmoney_Payment_Gateway_Util::log("Create charge exception " . $exception->getCode() . $exception->getMessage(), WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_INFO);357 WC_Zipmoney_Payment_Gateway_Util::log("Create charge exception " . $exception->getCode() . $exception->getMessage(), WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_INFO); 348 358 wc_add_notice(__('Payment error:', 'zippayment') . $exception->getMessage(), 'error'); 349 359 delete_option($checkout_id); … … 367 377 //get the charge order 368 378 $charge_order = $this->_create_charge_order($order_id, $order); 369 379 $accountType = 'checkout_id'; 380 $accountValue = $checkout_id; 381 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation()) { 382 $accountType = 'account_token'; 383 $accountValue = $this->getCustomerToken($checkout_id); 384 } 370 385 //get authority 371 386 $authority = new Authority( 372 387 array( 373 'type' => 'checkout_id',374 'value' => $ checkout_id388 'type' => $accountType, 389 'value' => $accountValue 375 390 ) 376 391 ); … … 400 415 { 401 416 $is_pickup = false; 402 417 403 418 //check order containing physical products, then create shipping address 404 419 // if order contains only virtual & downloadable products shipping address is not required. 405 if (WC_Zipmoney_Order_Compatibility::has_shipping_address($order)){ 406 $order_shipping = new OrderShipping( 407 array( 408 'address' => $this->_create_shipping_address($order), 409 'pickup' => $is_pickup 410 ) 411 ); 412 } 413 else{ 414 $is_pickup = true; 415 $order_shipping = new OrderShipping( 416 array( 417 'pickup' => $is_pickup 418 ) 419 ); 420 } 421 $website_abbr = substr(sanitize_key( get_bloginfo( 'name' ) ), 0, 3); 420 if (WC_Zipmoney_Order_Compatibility::has_shipping_address($order)) { 421 $order_shipping = new OrderShipping( 422 array( 423 'address' => $this->_create_shipping_address($order), 424 'pickup' => $is_pickup 425 ) 426 ); 427 } else { 428 $is_pickup = true; 429 $order_shipping = new OrderShipping( 430 array( 431 'pickup' => $is_pickup 432 ) 433 ); 434 } 435 $website_abbr = substr(sanitize_key(get_bloginfo('name')), 0, 3); 422 436 423 437 return new ChargeOrder( 424 438 array( 425 'reference' => strtoupper($website_abbr) . "-". $order_id ."-". strtotime("now"),439 'reference' => strtoupper($website_abbr) . "-" . $order_id . "-" . strtotime("now"), 426 440 'shipping' => $order_shipping, 427 441 'items' => $this->_get_order_items($order) … … 429 443 ); 430 444 } 445 446 /** 447 * save customer in the DB 448 */ 449 private function _saveToken($customerId, $token) 450 { 451 global $wpdb; 452 $table_name = $wpdb->prefix . 'zip_tokenisation'; 453 $encrypttedToken = WC_Zipmoney_Payment_Gateway_Util::wpcodetips_twoway_encrypt($token, 'e'); 454 $wpdb->insert($table_name, array('customer_id' => $customerId, 'token' => $encrypttedToken)); 455 } 456 457 /** 458 * check the DB for customer token. 459 * if not in the DB then get it by call token api 460 */ 461 public function getCustomerToken($checkout_id) 462 { 463 global $wpdb; 464 $current_user = wp_get_current_user(); 465 $uId = $current_user->ID; 466 $tokenTable = $wpdb->prefix . 'zip_tokenisation'; 467 $result = $wpdb->get_results("SELECT * FROM $tokenTable WHERE `customer_id` = $uId"); 468 foreach ($result as $customerToken) { 469 $dycrpttedToken = WC_Zipmoney_Payment_Gateway_Util::wpcodetips_twoway_encrypt($customerToken->token, 'd'); 470 return $dycrpttedToken; 471 } 472 //get authority 473 $authority = new Authority( 474 array( 475 'type' => 'checkout_id', 476 'value' => $checkout_id 477 ) 478 ); 479 $tokenReq = new CreateTokenRequest(); 480 $tokenReq->setAuthority($authority); 481 $tokenApi = new TokensApi(); 482 $token = $tokenApi->tokensCreate($tokenReq, WC_Zipmoney_Payment_Gateway_Util::get_uuid()); 483 $this->_saveToken($uId, $token->getValue()); 484 return $token->getValue(); 485 } 486 487 private function _removeCustomerToken($customerId) 488 { 489 global $wpdb; 490 $table_name = $wpdb->prefix . 'zip_tokenisation'; 491 $wpdb->delete($table_name, array('customer_id' => $customerId)); 492 } 431 493 } -
zipmoney-payments-woocommerce/trunk/includes/api/class-wc-zipmoney-payment-gateway-api-checkout.php
r2560395 r2776894 1 1 <?php 2 2 3 use \zipMoney\ApiException; 3 4 use \zipMoney\Model\CheckoutConfiguration; … … 6 7 use \zipMoney\Model\OrderShipping; 7 8 use \zipMoney\Model\Shopper; 9 use \zipMoney\Model\CheckoutFeatures; 10 use \zipMoney\Model\CreateCheckoutRequestFeaturesTokenisation as Tokenisation; 8 11 9 12 class WC_Zipmoney_Payment_Gateway_API_Request_Checkout extends WC_Zipmoney_Payment_Gateway_API_Abstract … … 93 96 ) 94 97 ); 95 96 return new CreateCheckoutRequest( 97 array( 98 'shopper' => $shopper, 99 'order' => $checkout_order, 100 'metadata' => $this->_getMetadata(), 101 'config' => $checkout_configuration, 102 ) 103 ); 98 $checkoutReq = new CreateCheckoutRequest(); 99 $checkoutReq->setType("standard") 100 ->setShopper($shopper) 101 ->setOrder($checkout_order) 102 ->setMetadata($this->_getMetadata()) 103 ->setConfig($checkout_configuration); 104 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation()) { 105 $checkoutReq->setFeatures($this->getTokenisationFeature()); 106 } 107 return $checkoutReq; 108 } 109 110 /** 111 * get tokenisation feature when tokenisation is enable 112 */ 113 public function getTokenisationFeature() 114 { 115 $feature = new CheckoutFeatures; 116 $tokenisation = new Tokenisation; 117 $tokenisation->setRequired(true); 118 $feature->setTokenisation($tokenisation); 119 120 return $feature; 104 121 } 105 122 -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-blocks-support.php
r2662714 r2776894 48 48 * @return array 49 49 */ 50 public function get_payment_method_data() { 51 return [ 52 'title' => $this->get_setting( 'title' ), 53 'description' => $this->get_setting( 'description' ), 54 'supports' => $this->get_supported_features(), 50 public function get_payment_method_data() 51 { 52 $url = home_url() . "/?p=zipmoneypayment&route=updatesession"; 53 $payment_method_data = [ 54 'title' => $this->WC_Zipmoney_Payment_Gateway->title, 55 'description' => $this->WC_Zipmoney_Payment_Gateway->description, 56 'supports' => $this->get_supported_features(), 57 'tokenisation' => $this->WC_Zipmoney_Payment_Gateway->showSaveAccountInCheckout(), 58 'savezip' => $this->WC_Zipmoney_Payment_Gateway->customerHasToken(), 59 'sessionUrl' => $url, 55 60 ]; 61 62 return $payment_method_data; 56 63 } 57 64 -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-config.php
r2633893 r2776894 53 53 const CONFIG_SELECT_REGION = 'select_region'; 54 54 const CONFIG_CHECK_CREDENTIALS_BTN = 'check_credentials'; 55 const CONFIG_ENABLE_TOKENISATION = 'enable_tokenisation'; 55 56 /*const PRODUCT_ZIP_MONEY = 'zipMoney'; 56 57 const PRODUCT_ZIP_PAY = 'zipPay';*/ … … 123 124 $( '.woocommerce_banner_option' ).closest( 'tr' ).hide(); 124 125 } 126 if($('#woocommerce_zipmoney_select_region :selected').val() === 'au'){ 127 $( '.woocommerce_banner_enable' ).closest( 'tr' ).show(); 128 $('.woocommerce_tokenisation_enable_option').closest( 'tr' ).show(); 129 $('.woocommerce_iframe_enable_option').closest( 'tr' ).show(); 130 if($('.woocommerce_banner_enable').prop('checked') == true){ 131 $( '.woocommerce_banner_option' ).closest( 'tr' ).show(); 132 }else{ 133 $( '.woocommerce_banner_option' ).closest( 'tr' ).hide(); 134 } 135 }else{ 136 $( '.woocommerce_banner_enable' ).closest( 'tr' ).hide(); 137 $('.woocommerce_tokenisation_enable_option').closest( 'tr' ).hide(); 138 $('.woocommerce_iframe_enable_option').closest( 'tr' ).hide(); 139 $( '.woocommerce_banner_option' ).closest( 'tr' ).hide(); 140 } 125 141 126 142 … … 142 158 }); 143 159 160 $('#woocommerce_zipmoney_select_region').on('change',function(){ 161 //Getting Value 162 var selValue = $('#woocommerce_zipmoney_select_region :selected').val(); 163 if(selValue === 'au'){ 164 $( '.woocommerce_banner_enable' ).closest( 'tr' ).show(); 165 $('.woocommerce_tokenisation_enable_option').closest( 'tr' ).show(); 166 $('.woocommerce_iframe_enable_option').closest( 'tr' ).show(); 167 if($('.woocommerce_banner_enable').prop('checked') == true){ 168 $( '.woocommerce_banner_option' ).closest( 'tr' ).show(); 169 }else{ 170 $( '.woocommerce_banner_option' ).closest( 'tr' ).hide(); 171 } 172 }else{ 173 $( '.woocommerce_banner_enable' ).closest( 'tr' ).hide(); 174 $('.woocommerce_tokenisation_enable_option').closest( 'tr' ).hide(); 175 $('.woocommerce_iframe_enable_option').closest( 'tr' ).hide(); 176 $( '.woocommerce_banner_option' ).closest( 'tr' ).hide(); 177 } 178 }); 179 144 180 $( '.woocommerce_banner_enable' ).change( function( event ) { 145 181 var checked = $( event.target ).is( ':checked' ); … … 210 246 'class' => 'check_private_key', 211 247 'desc_tip' => true, 248 ), 249 self::CONFIG_SELECT_REGION => array( 250 'title' => __('Widget Region', 'zippayment'), 251 'type' => 'select', 252 'desc_tip' => __('Select Region to show proper zip widget in product, cart and checkout page', 'zippayment'), 253 'default' => self::REGION_AU, 254 'options' => array( 255 self::REGION_AU => 'Australia', 256 self::REGION_CA => 'Canada', 257 self::REGION_MX => 'Mexico', 258 self::REGION_NZ => 'New Zealand', 259 self::REGION_SG => 'Singapore', 260 self::REGION_ZA => 'South Africa', 261 self::REGION_AE => 'United Arab Emirates', 262 self::REGION_GB => 'United Kingdom', 263 self::REGION_US => 'United States', 264 ) 265 ), 266 self::CONFIG_ENABLE_TOKENISATION => array( 267 'title' => __('Tokenisation', 'zippayment'), 268 'label' => __('Enable Tokenisation', 'zippayment'), 269 'class' => 'woocommerce_tokenisation_enable_option', 270 'type' => 'checkbox', 271 'description' => __('Tokenisation allows a seamless one-click checkout experience for returning Zip customers, removing the need to redirect and complete a Zip login after their first purchase. (Australia only)', 'zippayment'), 272 'default' => 'no' 212 273 ), 213 274 self::CONFIG_CHARGE_CAPTURE => array( … … 239 300 'title' => __('In-context checkout', 'zippayment'), 240 301 'label' => __('Enable in-context checkout flow', 'zippayment'), 302 'class' => 'woocommerce_iframe_enable_option', 241 303 'type' => 'checkbox', 242 304 'desc_tip' => __('Enable to offer your customers an iframe checkout experience without being redirected away from your website. But this feature only work for AU region. Other region customer will redirect to zip for payment.', 'zippayment'), 243 'description' => __('Iframe zip checkout only work for AU region. Other region customer will redirect to zip for payment.', 'zippayment'),305 'description' => __('Iframe Zip checkout will only work for merchants based in Australia”', 'zippayment'), 244 306 'default' => 'no' 245 307 ), … … 255 317 'desc_tip' => __('Set the maximum shopping cart value that Zip will be available for use.', 'zippayment'), 256 318 'default' => 1500 257 ),258 self::CONFIG_SELECT_REGION => array(259 'title' => __('Widget Region', 'zippayment'),260 'type' => 'select',261 'desc_tip' => __('Select Region to show proper zip widget in product, cart and checkout page', 'zippayment'),262 'default' => self::REGION_AU,263 'options' => array(264 self::REGION_AU => 'Australia',265 self::REGION_CA => 'Canada',266 self::REGION_MX => 'Mexico',267 self::REGION_NZ => 'New Zealand',268 self::REGION_SG => 'Singapore',269 self::REGION_ZA => 'South Africa',270 self::REGION_AE => 'United Arab Emirates',271 self::REGION_GB => 'United Kingdom',272 self::REGION_US => 'United States',273 )274 319 ), 275 320 self::CONFIG_DISPLAY_WIDGET_MODE => array( … … 287 332 'label' => __('Display on product page', 'zippayment'), 288 333 'type' => 'checkbox', 289 'desc_tip' => __(' Enable to display the Zip widget below the add to cart button on the product page.', 'zippayment'),334 'desc_tip' => __('The product widget will break down the price of the item and display a minimum weekly repayment or divide the price by 4 and show the customer an equal price breakdown', 'zippayment'), 290 335 'default' => 'yes' 291 336 ), … … 293 338 'label' => __('Display on cart page', 'zippayment'), 294 339 'type' => 'checkbox', 295 'desc_tip' => __(' Enable to display the Zip widget below the checkout button on the cart page.', 'zippayment'),340 'desc_tip' => __('The cart widget will break down the price of the item and display a minimum weekly repayment or divide the price by 4 and show the customer an equal price breakdown', 'zippayment'), 296 341 'default' => 'yes' 297 342 ), … … 299 344 'title' => __('Marketing taglines', 'zippayment'), 300 345 'label' => __('Display on product page', 'zippayment'), 301 'desc_tip' => __(' Enable to display the Zip tagline widget below the price on the product page.', 'zippayment'),346 'desc_tip' => __('The tagline does not show any price breakdown or minimum repayments. A tagline will show a static message of "Own it now, pay later."', 'zippayment'), 302 347 'type' => 'checkbox', 303 348 'default' => 'no' … … 305 350 self::CONFIG_DISPLAY_TAGLINE_CART => array( 306 351 'label' => __('Display on cart page', 'zippayment'), 307 'desc_tip' => __(' Enable to display the Zip tagline widget below the total price on the cart page.', 'zippayment'),352 'desc_tip' => __('The tagline does not show any price breakdown or minimum repayments. A tagline will show a static message of "Own it now, pay later".', 'zippayment'), 308 353 'type' => 'checkbox', 309 354 'default' => 'no' -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-util.php
r2476029 r2776894 554 554 WC()->session->set('zip_shipping_details', $zip_shipping_details); 555 555 } 556 557 // encrypt and decrypt token 558 public static function wpcodetips_twoway_encrypt($stringToHandle = "", $encryptDecrypt = 'e') 559 { 560 // Set secret keys 561 require_once plugin_dir_path(__FILE__) . '/class-wc-zipmoney-payment-gateway.php'; 562 $WC_Zipmoney_Payment_Gateway = new WC_Zipmoney_Payment_Gateway(); 563 $WC_Zipmoney_Payment_Gateway_Config = new WC_Zipmoney_Payment_Gateway_Config($WC_Zipmoney_Payment_Gateway); 564 $secret_key = $WC_Zipmoney_Payment_Gateway_Config->get_merchant_public_key(); // Change this! 565 $secret_iv = $WC_Zipmoney_Payment_Gateway_Config->get_merchant_private_key(); // Change this! 566 $key = hash('sha256', $secret_key); 567 $iv = substr(hash('sha256', $secret_iv), 0, 16); 568 // Check whether encryption or decryption 569 if ($encryptDecrypt == 'e') { 570 // We are encrypting 571 $output = base64_encode(openssl_encrypt($stringToHandle, "AES-256-CBC", $key, 0, $iv)); 572 } else if ($encryptDecrypt == 'd') { 573 // We are decrypting 574 $output = openssl_decrypt(base64_decode($stringToHandle), "AES-256-CBC", $key, 0, $iv); 575 } 576 return $output; 577 } 556 578 } -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-widget.php
r2685692 r2776894 11 11 public function init_hooks() 12 12 { 13 add_action('woocommerce_before_main_content', array($this, 'render_root_el')); 14 add_action('woocommerce_before_single_product_summary', array($this, 'render_root_el')); 15 add_action('woocommerce_before_cart', array($this, 'render_root_el')); 16 add_action('woocommerce_before_checkout_form', array($this, 'render_root_el')); 13 add_action('wp_footer', array($this, 'render_root_el')); 17 14 18 15 add_filter('woocommerce_gateway_description', array($this, 'updateMethodDescription'), 10, 2); … … 21 18 22 19 //inject the order button 23 if ($WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow()){20 if ($WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow()) { 24 21 add_filter('woocommerce_order_button_html', array($this, 'order_button'), 10, 2); 25 22 } 26 23 27 24 //use this hook to convert customer address 28 25 add_action('woocommerce_checkout_update_order_review', array('WC_Zipmoney_Payment_Gateway_Util', 'update_customer_details')); … … 411 408 public function updateMethodDescription($description, $id) 412 409 { 413 if ($id != $this->WC_Zipmoney_Payment_Gateway->id) {410 if ($id != $this->WC_Zipmoney_Payment_Gateway->id) { 414 411 return $description; 415 412 } 416 417 return '<span zm-widget=\'inline\' zm-asset=\'checkoutdescription\'></span> <a id="zipmoney-learn-more" class="zip-hover" zm-widget="popup" zm-popup-asset="checkoutdialog">Learn More</a> 418 <script>if(window.$zmJs!==undefined) window.$zmJs._collectWidgetsEl(window.$zmJs);</script>'; 413 $description = '<span zm-widget=\'inline\' zm-asset=\'checkoutdescription\'></span> <a id="zipmoney-learn-more" class="zip-hover" zm-widget="popup" zm-popup-asset="checkoutdialog">Learn More</a>'; 414 // show Save Zip account option in checkout when tokenisation is enable and customer logged in 415 if ($this->WC_Zipmoney_Payment_Gateway->showSaveAccountInCheckout()) { 416 $checked = ($this->WC_Zipmoney_Payment_Gateway->customerHasToken()) ? 'checked' : ''; 417 session_status() === PHP_SESSION_ACTIVE ?: session_start(); 418 $_SESSION["saveZipAccount"] = $this->WC_Zipmoney_Payment_Gateway->customerHasToken(); 419 $description .= '<label><input type="checkbox" id="saveZipAccount" ' . $checked . ' onchange="Check(this)" /><span>Save Zip Account for future purchases</span></label>'; 420 } 421 $description .= '<script>if(window.$zmJs!==undefined) window.$zmJs._collectWidgetsEl(window.$zmJs);</script>'; 422 return $description; 419 423 } 420 424 -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway.php
r2685692 r2776894 12 12 { 13 13 const ADMIN_CSS_VERSION = '1.0'; 14 const FRONT_CSS_VERSION = '1. 1';14 const FRONT_CSS_VERSION = '1.2'; 15 15 16 16 //essential settings … … 24 24 public $description = 'Own the way you pay'; 25 25 26 public $version = '2.3.1 3';26 public $version = '2.3.14'; 27 27 28 28 public $supports = array('products', 'refunds'); … … 78 78 add_filter('woocommerce_order_get_payment_method_title', array($this, 'zip_order_payment_title'), 10, 2); 79 79 add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links')); 80 }81 80 add_action('wp_footer', array($this, 'update_zip_session')); 81 } 82 82 // when zip private key is not valid then show this error in admin 83 83 public function invalid_key_error_notice($display = false) … … 317 317 318 318 /** 319 * get tokenisation option status from zip admin setting 320 */ 321 public function get_tokenisation_status() 322 { 323 $this->WC_Zipmoney_Payment_Gateway_Config = new WC_Zipmoney_Payment_Gateway_Config($this); 324 325 return $this->WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_ENABLE_TOKENISATION); 326 } 327 328 /** 319 329 * Check the environment meet the minimum requirement 320 330 */ … … 377 387 wp_send_json($result); 378 388 break; 389 case 'updatesession': 390 // this route use for setting session for save zip account option wheither it is checked or unchecked 391 $saveZipaccount = sanitize_text_field($_POST['savezipaccount']); 392 session_status() === PHP_SESSION_ACTIVE ?: session_start(); 393 $_SESSION["saveZipAccount"] = $saveZipaccount; 394 $result = $result = array( 395 'code' => 200, 396 'message' => 'success', 397 ); 398 wp_send_json($result); 379 399 } 380 400 } … … 396 416 set_post_type($order_id, 'shop_quote'); 397 417 398 $ response= array();399 400 $ response= $checkout_controller->create_checkout($_POST, $order_id);418 $checkout = array(); 419 420 $checkout = $checkout_controller->create_checkout($_POST, $order_id); 401 421 } catch (ApiException $exception) { 402 422 WC_Zipmoney_Payment_Gateway_Util::log($exception->getCode() . $exception->getMessage()); … … 411 431 ); 412 432 } 413 if (isset($response['redirect_uri'])) { 414 return array( 415 'result' => $response['result'], 416 'checkout_id' => $response['checkout_id'], 417 'redirect' => $response['redirect_uri'] 433 if (isset($checkout['redirect_uri'])) { 434 435 $response = array( 436 'result' => $checkout['result'], 437 'checkout_id' => $checkout['checkout_id'], 438 'redirect' => $checkout['redirect_uri'] 418 439 ); 419 } 420 wc_add_notice(__('Payment error: ', 'zippayment') . $response['message'], 'error'); 440 441 if (isset($checkout['token'])) { 442 $token = $checkout['token']; 443 $response['token'] = $token; 444 } 445 return $response; 446 } 447 wc_add_notice(__('Payment error: ', 'zippayment') . $checkout['message'], 'error'); 421 448 } 422 449 … … 515 542 } 516 543 } 544 /** 545 * check tokenisation is enable, user logged in and currency is AUD 546 */ 547 public function showSaveAccountInCheckout() 548 { 549 $currency = get_option('woocommerce_currency'); 550 if (is_user_logged_in() && $this->get_tokenisation_status() && $currency == CurrencyUtil::CURRENCY_AUD) { 551 return true; 552 } 553 return false; 554 } 555 556 /** 557 * check tokenisation is enable, user logged in and currency is AUD 558 * as well as checking saveZipAccount is checked or not 559 */ 560 public function doTokenisation() 561 { 562 session_status() === PHP_SESSION_ACTIVE ?: session_start(); 563 if (isset($_SESSION['saveZipAccount']) && filter_var($_SESSION['saveZipAccount'], FILTER_VALIDATE_BOOLEAN) && $this->showSaveAccountInCheckout()) { 564 return true; 565 } 566 return false; 567 } 568 569 /** 570 * check customer has token 571 */ 572 public function customerHasToken() 573 { 574 global $wpdb; 575 $current_user = wp_get_current_user(); 576 $uid = $current_user->ID; 577 $tokenTable = $wpdb->prefix . 'zip_tokenisation'; 578 $result = $wpdb->get_results("SELECT * FROM $tokenTable WHERE `customer_id` = $uid"); 579 foreach ($result as $customerToken) { 580 return $customerToken->token; 581 } 582 return false; 583 } 584 /** 585 * update session when customer check or uncheck Save Zip account in checkout page 586 */ 587 public function update_zip_session() 588 { 589 $url = home_url(); 590 ?> 591 592 <script type="text/javascript"> 593 function Check(value) { 594 let formData = new FormData(); 595 var url = '<?php echo $url . "/?p=zipmoneypayment&route=updatesession"; ?>'; 596 formData.append("savezipaccount", value.checked); 597 const requestOptions = { 598 method: "POST", 599 body: formData 600 }; 601 fetch(url, requestOptions) 602 .then(response => response.json()); 603 }; 604 </script> 605 <?php 606 } 517 607 } -
zipmoney-payments-woocommerce/trunk/includes/controller/class-wc-zipmoney-payment-charge-controller.php
r2560395 r2776894 44 44 45 45 //Once the result is approved, change the post_type from "shop_quote" to "shop_order" 46 //$order_id = WC()->session->get('_post_id'); 47 $order_id = get_option($checkoutId); 46 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation()) { 47 $order_id = wc_get_order_id_by_order_key(wc_clean(wp_unslash($options['key']))); 48 } 49 50 if (!$order_id) { 51 $order_id = get_option($checkoutId); 52 } 48 53 // AU SMI adding prefix but lightbox redirect will not have prefix 49 54 if (!$order_id) { 50 55 $order_id = get_option('au-' . $checkoutId); 51 if ($order_id){52 $checkoutId = 'au-' .$checkoutId;56 if ($order_id) { 57 $checkoutId = 'au-' . $checkoutId; 53 58 } 54 59 } … … 63 68 WC()->session, 64 69 $checkoutId, 70 $order_id, 65 71 $this->WC_Zipmoney_Payment_Gateway_Config->get_merchant_private_key() 66 72 ); … … 72 78 //wc_add_notice('Your zip payment successful, thank you.', 'success'); 73 79 } else { 80 $result['redirect_url'] = $this->wc_get_checkout_url(); 74 81 $result['content'] = $response['message']; 75 82 $result['title'] = 'Error'; 76 wc_add_notice(__("An error occurred while processing payment", "zippayment"), 'error');83 wc_add_notice(__("An error occurred while processing payment", "zippayment"), 'error'); 77 84 } 78 85 } else { … … 80 87 $result['content'] = 'Could not find the order, please try again later.'; 81 88 $result['title'] = 'Error'; 82 wc_add_notice(__("Could not find the order, please try again later.", "zippament"), 'error');89 wc_add_notice(__("Could not find the order, please try again later.", "zippament"), 'error'); 83 90 } 84 91 break; … … 86 93 $result['title'] = 'The payment is in referred state'; 87 94 $result['content'] = 'Your application is currently under review by zipMoney and will be processed very shortly. You can contact the customer care at [email protected] for any enquiries.'; 88 wc_add_notice(__('Payment pending, your application is currently under review and will be processed shortly.', "zippayment"), 'success');95 wc_add_notice(__('Payment pending, your application is currently under review and will be processed shortly.', "zippayment"), 'success'); 89 96 WC()->cart->empty_cart(); 90 97 break; … … 93 100 $result['content'] = 'Your application has been declined by zipMoney. Please contact zipMoney for further information.'; 94 101 $result['redirect_url'] = $this->wc_get_checkout_url(); 95 wc_add_notice(__('Your application has been declined. Please contact Zip Co for further information.', "zippayment"), 'error');102 wc_add_notice(__('Your application has been declined. Please contact Zip Co for further information.', "zippayment"), 'error'); 96 103 //remove the wp_option 97 104 delete_option($checkoutId); … … 100 107 $result['title'] = 'The checkout has been cancelled'; 101 108 $result['content'] = 'The checkout has been cancelled.'; 102 wc_add_notice(__('The payment has been cancelled.', "zippayment"), 'error');109 wc_add_notice(__('The payment has been cancelled.', "zippayment"), 'error'); 103 110 $result['redirect_url'] = $this->wc_get_checkout_url(); 104 111 //remove the wp_option -
zipmoney-payments-woocommerce/trunk/includes/controller/class-wc-zipmoney-payment-checkout-controller.php
r2560395 r2776894 24 24 new CheckoutsApi() 25 25 ); 26 $redirect_url = WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url(); 27 $user = wp_get_current_user(); 28 if ($this->WC_Zipmoney_Payment_Gateway->doTokenisation()) { 29 if ($this->WC_Zipmoney_Payment_Gateway->customerHasToken()) { 30 WC_Zipmoney_Payment_Gateway_Util::log('customerHasToken'); 31 $order = wc_get_order($order_id); 32 $order_key = $order->get_order_key(); 33 $redirect_url .= "&result=approved&token=true&checkoutId=checkoutId&key=" . $order_key; 34 return array( 35 'redirect_uri' => $redirect_url, 36 'message' => 'Redirecting to charge.', 37 'result' => 'success', 38 'checkout_id' => 'checkoutId', 39 'token' => true, 40 ); 41 } 42 } else { 43 if ($this->WC_Zipmoney_Payment_Gateway->showSaveAccountInCheckout()) { 44 $this->_removeCustomerToken($user->ID); 45 } 46 } 26 47 27 48 $checkout_response = $WC_Zipmoney_Payment_Gateway_API_Request_Checkout->create_checkout( 28 49 WC()->session, 29 WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url(),50 $redirect_url, 30 51 $this->WC_Zipmoney_Payment_Gateway_Config->get_merchant_private_key(), 31 52 $order_id … … 51 72 } 52 73 return array( 53 'message' => __("An error occurred while getting the redirect url from Zip.", "zippayment"),74 'message' => __("An error occurred while getting the redirect url from Zip.", "zippayment"), 54 75 'result' => 'failure' 55 76 ); 56 77 } 78 79 private function _removeCustomerToken($customerId) 80 { 81 global $wpdb; 82 $table_name = $wpdb->prefix . 'zip_tokenisation'; 83 $wpdb->delete($table_name, array('customer_id' => $customerId)); 84 } 57 85 } -
zipmoney-payments-woocommerce/trunk/includes/view/frontend/order_button.php
r2464696 r2776894 5 5 <script src="https://static.zipmoney.com.au/checkout/checkout-v1.js"></script> 6 6 <script type="text/javascript"> 7 (function($){8 $(document).ready(function(){9 //your code7 (function($) { 8 $(document).ready(function() { 9 //your code 10 10 11 $('#place_order').on('click', function(e){12 var zipMoneyErrorDiv = $('#zipMoneyErrorDiv');13 var zipMoneyInfoDiv = $('#zipMoneyInfoDiv');14 zipMoneyErrorDiv.hide();15 zipMoneyInfoDiv.hide();11 $('#place_order').on('click', function(e) { 12 var zipMoneyErrorDiv = $('#zipMoneyErrorDiv'); 13 var zipMoneyInfoDiv = $('#zipMoneyInfoDiv'); 14 zipMoneyErrorDiv.hide(); 15 zipMoneyInfoDiv.hide(); 16 16 17 var payment_method = $('form[name="checkout"] input[name="payment_method"]:checked').val();17 var payment_method = $('form[name="checkout"] input[name="payment_method"]:checked').val(); 18 18 19 var checkoutId = null; //log the checkoutId. if the user close the iframe, it will make an ajax call to remove the record in19 var checkoutId = null; //log the checkoutId. if the user close the iframe, it will make an ajax call to remove the record in 20 20 21 if (payment_method == 'zipmoney') {21 if (payment_method == 'zipmoney') { 22 22 23 Zip.Checkout.init({24 redirect: <?php echo $is_iframe_checkout ? 0 : 1?>,25 checkoutUri: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_checkout_endpoint_url();?>',26 redirectUri: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url()?>',27 onCheckout: function(resolve, reject, args) {28 var errorDiv = $('#zipMoneyErrorDiv');29 errorDiv.hide();23 Zip.Checkout.init({ 24 redirect: <?php echo $is_iframe_checkout ? 0 : 1 ?>, 25 checkoutUri: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_checkout_endpoint_url(); ?>', 26 redirectUri: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url() ?>', 27 onCheckout: function(resolve, reject, args) { 28 var errorDiv = $('#zipMoneyErrorDiv'); 29 errorDiv.hide(); 30 30 31 $.ajax({32 type: 'POST',33 url: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_wc_checkout_url()?>',34 data: $('form.checkout').serialize(),35 dataType: 'json',36 success: function(result) {37 console.log('successfully triggered');38 // console.log("test ". result);31 $.ajax({ 32 type: 'POST', 33 url: '<?php echo WC_Zipmoney_Payment_Gateway_Util::get_wc_checkout_url() ?>', 34 data: $('form.checkout').serialize(), 35 dataType: 'json', 36 success: function(result) { 37 console.log('successfully triggered'); 38 // console.log("test ". result); 39 39 40 if(result.checkout_id){ 41 checkoutId = result.checkout_id; 42 } 43 44 if(result.redirect){ 45 //if the checkout is successful 46 console.log('resolved'); 47 resolve({ 48 data: {redirect_uri: result.redirect} 49 }); 50 } else { 51 //console.log('reject'); 52 errorDiv.html(result.messages); 53 errorDiv.show(); 54 //scroll up to show the error 55 $('html, body').animate({ 56 scrollTop: ( $('form.checkout').offset().top - 200) 57 }, 1000); 40 if (result.checkout_id) { 41 checkoutId = result.checkout_id; 42 } 43 if (result.token === true) { 44 $('div.zip-overlay').css('display', 'block'); 45 window.location.href = result.redirect; 46 return; 47 } 48 if (result.redirect) { 49 //if the checkout is successful 50 console.log('resolved'); 51 resolve({ 52 data: { 53 redirect_uri: result.redirect 54 } 55 }); 56 } else { 57 //console.log('reject'); 58 errorDiv.html(result.messages); 59 errorDiv.show(); 60 //scroll up to show the error 61 $('html, body').animate({ 62 scrollTop: ($('form.checkout').offset().top - 200) 63 }, 1000); 64 reject(result); 65 } 66 }, 67 error: function(jqXHR, textStatus, errorThrown) { 68 //console.log('error triggered'); 69 //console.log(errorThrown); 58 70 reject(result); 59 71 } 60 }, 61 error: function (jqXHR, textStatus, errorThrown) { 62 //console.log('error triggered'); 63 //console.log(errorThrown); 64 reject(result); 72 }); 73 }, 74 onComplete: function(response) { 75 //console.log('onComplete is called.'); 76 77 //console.log(response); 78 79 if (response.state == "approved" || response.state == "referred") { 80 //show the redirect block 81 $('div.zip-overlay').css('display', 'block'); 82 83 location.href = "<?php echo WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url(); ?>&result=" + 84 response.state + "&checkoutId=" + response.checkoutId; 85 86 //show the over lay 87 } else if ((response.state == 'cancelled' || response.state == 'declined') && checkoutId) { 88 //clear the wp_options 89 // console.log('clear options. ' + checkoutId); 90 $.post('<?php echo WC_Zipmoney_Payment_Gateway_Util::get_clear_options_url() ?>', { 91 checkout_id: checkoutId 92 }); 65 93 } 66 }); 67 }, 68 onComplete: function (response) { 69 //console.log('onComplete is called.'); 94 }, 95 onError: function(response) { 96 //console.log('onError is called.'); 97 var errorMessage = "An error occurred while redirect to Zip."; 98 var message = $(response.detail.messages).text(); 99 if (typeof message != 'undefined' && message != null && message.length > 0) { 100 message = message.trim(); 101 message = message.replace(/\s+/g, ' '); 102 message = message.replace(/\./g, '.\n'); 103 errorMessage = message; 104 } 105 alert(errorMessage); 106 } 70 107 71 //console.log(response);108 }); 72 109 73 if (response.state == "approved" || response.state == "referred") {74 //show the redirect block75 $('div.zip-overlay').css('display', 'block');110 e.preventDefault(); 111 } 112 }); 76 113 77 location.href = "<?php echo WC_Zipmoney_Payment_Gateway_Util::get_complete_endpoint_url();?>&result=" +78 response.state + "&checkoutId=" + response.checkoutId;79 80 //show the over lay81 } else if((response.state == 'cancelled' || response.state == 'declined') && checkoutId){82 //clear the wp_options83 // console.log('clear options. ' + checkoutId);84 $.post('<?php echo WC_Zipmoney_Payment_Gateway_Util::get_clear_options_url()?>', {checkout_id:checkoutId});85 }86 },87 onError: function(response){88 //console.log('onError is called.');89 var errorMessage = "An error occurred while redirect to Zip.";90 var message = $(response.detail.messages).text();91 if (typeof message != 'undefined' && message != null && message.length > 0) {92 message = message.trim();93 message = message.replace(/\s+/g, ' ');94 message = message.replace(/\./g, '.\n');95 errorMessage = message;96 }97 alert(errorMessage);98 }99 100 });101 102 e.preventDefault();103 }104 114 }); 105 115 106 }); 107 108 })(window.jQuery || window.$); 109 116 })(window.jQuery || window.$); 110 117 </script> -
zipmoney-payments-woocommerce/trunk/vendor/zipmoney/merchantapi-php/lib/Api/ChargesApi.php
r2283719 r2776894 163 163 $e->setResponseObject($data); 164 164 break; 165 case 403: 166 $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\zipMoney\Model\ErrorResponse', $e->getResponseHeaders()); 167 $e->setResponseObject($data); 168 break; 165 169 case 409: 166 170 $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\zipMoney\Model\ErrorResponse', $e->getResponseHeaders()); -
zipmoney-payments-woocommerce/trunk/zipmoney-payment-gateway.php
r2685692 r2776894 7 7 * Give your customers the power to pay later, interest free and watch your sales grow. 8 8 * Take advantage of our fast-growing customer base, proven revenue uplift, fast and simple integration. 9 * Version: 2.3.1 39 * Version: 2.3.14 10 10 * Author: Zip 11 11 * Author URI: https://www.zip.co/ … … 14 14 * Github URI: https://github.com/zipMoney/woocommerce/ 15 15 * WC requires at least: 2.6.13 16 * WC tested up to: 6. 0.017 * @version 2.3.1 316 * WC tested up to: 6.7.0 17 * @version 2.3.14 18 18 * @package Zip 19 19 * @author Zip … … 24 24 die; 25 25 } 26 register_activation_hook(__FILE__, 'plugin_activation'); 26 27 require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php'; 27 define('WOOCOMMERCE_GATEWAY_ZIPMONEY_VERSION', '2.3.1 3');28 define('WOOCOMMERCE_GATEWAY_ZIPMONEY_VERSION', '2.3.14'); 28 29 define('WOOCOMMERCE_GATEWAY_ZIPMONEY_URL', untrailingslashit(plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__)))); 29 30 define('WOOCOMMERCE_GATEWAY_ZIPMONEY_PATH', untrailingslashit(plugin_dir_path(__FILE__))); 30 31 31 /** 32 32 * Add zipMoney gateway class to hook … … 40 40 return $methods; 41 41 } 42 43 /** 44 * install tokenisation table 45 */ 46 function plugin_activation() 47 { 48 global $wpdb; 49 $charset_collate = $wpdb->get_charset_collate(); 50 $table_name = $wpdb->prefix . 'zip_tokenisation'; 51 $customer_table = $wpdb->prefix . 'users'; 52 $sql = "CREATE TABLE `$table_name` ( 53 `id` int(11) NOT NULL AUTO_INCREMENT, 54 `customer_id` bigint(20) unsigned NOT NULL, 55 `token` varchar(220) DEFAULT NULL, 56 PRIMARY KEY(id), 57 INDEX customer_id(customer_id), 58 FOREIGN KEY(customer_id) REFERENCES $customer_table(id) ON UPDATE CASCADE ON DELETE CASCADE 59 ) $charset_collate ; 60 "; 61 if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { 62 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 63 dbDelta($sql); 64 } 65 } 66 42 67 43 68 /**
Note: See TracChangeset
for help on using the changeset viewer.