Skip to content

Commit

Permalink
Merge pull request #123 from degica/update/3.1.5
Browse files Browse the repository at this point in the history
Check compatibility for WooCommerce 9.4.1 and Wordpress 6.7.0
  • Loading branch information
Dinwy authored Nov 20, 2024
2 parents e2b4459 + d812623 commit 2855300
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 173 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wordpress:6.5.3
FROM wordpress:6.7.0

ARG woocommerce_version

Expand Down
2 changes: 1 addition & 1 deletion class-wc-gateway-komoju.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @extends WC_Payment_Gateway
*
* @version 3.1.4
* @version 3.1.5
*
* @author Komoju
*/
Expand Down
2 changes: 1 addition & 1 deletion class-wc-settings-page-komoju.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @extends WC_Settings_Page
*
* @version 3.1.4
* @version 3.1.5
*
* @author Komoju
*/
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
db:
ports:
- "8001:3306"
image: mysql:5.7
image: mysql:8.0
volumes:
- db_data:/var/lib/mysql
restart: always
Expand All @@ -21,7 +21,7 @@ services:
context: .
dockerfile: Dockerfile
args:
woocommerce_version: 8.8.3
woocommerce_version: 9.4.1
ports:
- "8000:80"
restart: always
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Description: Extends WooCommerce with KOMOJU gateway.
* Author: KOMOJU
* Author URI: https://komoju.com
* Version: 3.1.4
* Version: 3.1.5
* WC requires at least: 6.0
* WC tested up to: 8.8.3
* WC tested up to: 9.4.1
*/

add_action('before_woocommerce_init', function () {
Expand Down
25 changes: 14 additions & 11 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== KOMOJU Payments ===
Contributors: degica
Tags: WooCommerce,Payment Gateway,Komoju
Requires at least: 5.3
Tested up to: 6.5.3
Requires at least: 6.0
Tested up to: 6.7.0
Stable tag: trunk
Requires PHP: 7.2
WC requires at least: 3.0.0
WC tested up to: 8.8.3
WC requires at least: 6.0.0
WC tested up to: 9.4.1
License: MIT
License URI: https://directory.fsf.org/wiki/License:X11

Expand Down Expand Up @@ -98,15 +98,13 @@ We currently accept the following payment methods:
= What versions of WordPress and WooCommerce is this compatible with? =

At the moment, this plugin has been tested and is known to work up to WordPress
6.5.3 and WooCommerce 8.8.3 If you are using a later version, please check the
6.7.0 and WooCommerce 9.4.1 If you are using a later version, please check the
next section or contact us regarding this.

= What should I do if I am using newer versions of WordPress and WooCommerce? =

2024/05/22

We recommend performing a fresh install of WordPress 6.5.3 and WooCommerce
8.8.3 before proceeding to install this plugin. You can temporarily downgrade
We recommend performing a fresh install of WordPress 6.7.0 and WooCommerce
9.4.1 before proceeding to install this plugin. You can temporarily downgrade
from a newer version of WordPress and WooCommerce before continuing installation.
However, downgrading from newer versions of WordPress and WooCommerce may result in
issues with installing this plugin. If you are experiencing problems, please
Expand All @@ -118,11 +116,11 @@ Please contact [email protected] if you have any questions about
the installation of the module.

= どのWordPress・WooCommerceのバージョンに対応していますか?=
現時点でこのプラグインは、WordPress 6.5.3およびWooCommerce 8.8.3まで動作することが確認されています
現時点でこのプラグインは、WordPress 6.7.0およびWooCommerce 9.4.1まで動作することが確認されています
それ以降のバージョンをお使いの場合は、以下をお試し頂くか、[email protected]までご連絡ください。

= 新しいバージョンのWordPressとWooCommerceを使用している場合はどうすればよいですか? =
このプラグインをインストールする前に、まずWordPress 6.5.3とWooCommerce 8.8.3を新規インストールすることをお勧めします
このプラグインをインストールする前に、まずWordPress 6.7.0とWooCommerce 9.4.1を新規インストールすることをお勧めします
新しいバージョンから旧バージョンへ一時的にダウングレードし、接続頂くことも可能ですが、新しいバージョンからダウングレードすると、このプラグインのインストールに問題が生じる可能性がございます。
問題が発生した場合は、サポートチーム([email protected])までご連絡ください。

Expand Down Expand Up @@ -171,6 +169,11 @@ Go back to your Wordpress instance and set the "Webhook Secret Token" value on t

== Changelog ==

= 3.1.5 =

Updated compatibility for WordPress 6.7.0.
Upgraded support for WooCommerce 9.4.1 (previously 8.8.3).

= 3.1.4 =

Suppressed incompatibility error messages in the page editor
Expand Down
10 changes: 7 additions & 3 deletions tests/cypress/e2e/admin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ describe('KOMOJU for WooCommerce: Admin', () => {

cy.visit('/wp-admin/admin.php?page=wc-settings&tab=komoju_settings&section=api_settings');
cy.get('.komoju-endpoint-field').contains('Reset').click();
cy.contains('Save changes').click();
cy.contains('Save changes').then(($button) => {
if (!$button.is(':disabled')) {
cy.wrap($button).click();
}
});
});
})

Expand All @@ -33,14 +37,14 @@ describe('KOMOJU for WooCommerce: Admin', () => {
cy.visit('/wp-admin/admin.php?page=wc-settings&tab=komoju_settings&section=api_settings');

cy.get('.komoju-endpoint-komoju_woocommerce_api_endpoint').contains('Edit').click();
cy.get('#komoju_woocommerce_api_endpoint').type('{selectAll}https://example.com');
cy.get('#komoju_woocommerce_api_endpoint').clear().type('https://example.com');
cy.contains('Save changes').click();

cy.contains('Payment methods').click();
cy.get('#mainform').should('include.text', 'Unable to reach KOMOJU. Is your secret key correct?');
cy.contains('API settings').click();

cy.get('.komoju-endpoint-komoju_woocommerce_api_endpoint').contains('Reset').click();
cy.get('#komoju_woocommerce_api_endpoint').clear().type('https://komoju.com');
cy.contains('Save changes').click();

cy.contains('Payment methods').click();
Expand Down
21 changes: 12 additions & 9 deletions tests/cypress/e2e/checkout.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ describe('KOMOJU for WooCommerce: Checkout', () => {
cy.setupKomoju(['credit_card']);
cy.clickPaymentTab();
cy.enablePaymentGateway('komoju_credit_card');
cy.contains('Save changes').click();
cy.goToStore();

cy.addItemAndProceedToCheckout();
Expand All @@ -67,7 +66,6 @@ describe('KOMOJU for WooCommerce: Checkout', () => {
cy.setupKomoju(['credit_card', 'konbini', 'web_money']);
cy.clickPaymentTab();
cy.enablePaymentGateway('komoju_web_money');
cy.contains('Save changes').click();
cy.goToStore();

cy.addItemAndProceedToCheckout();
Expand All @@ -94,22 +92,27 @@ describe('KOMOJU for WooCommerce: Checkout', () => {

cy.get('#woocommerce_komoju_credit_card_showIcon').then(input => {
cy.log(input.attr('checked'));
if (input.attr('checked')) cy.wrap(input).click()
if (input.prop('checked')) {
cy.wrap(input).uncheck({ force: true });
cy.contains('Save changes').click()
}
})
cy.contains('Save changes').click()
cy.contains('Your settings have been saved.').should('exist')

cy.goToStore();
cy.addItemAndProceedToCheckout();
cy.get('label[for="radio-control-wc-payment-method-options-komoju_credit_card"] img').should('not.exist')

// radio-control-wc-payment-method-options-komoju_credit_card__label
cy.visit('/wp-admin/admin.php?page=wc-settings&tab=checkout')
cy.get('[data-gateway_id="komoju_credit_card"] a.button')
.click()

cy.get('#woocommerce_komoju_credit_card_showIcon').click()
cy.contains('Save changes').click()
cy.contains('Your settings have been saved.').should('exist')
cy.get('#woocommerce_komoju_credit_card_showIcon').then(input => {
cy.log(input.attr('checked'));
if (!input.prop('checked')) {
cy.wrap(input).check({ force: true });
cy.contains('Save changes').click()
}
})

cy.goToStore();
cy.addItemAndProceedToCheckout();
Expand Down
20 changes: 12 additions & 8 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,18 @@ Cypress.Commands.add('goToStore', () => {
});

Cypress.Commands.add('fillInAddress', () => {
cy.get('#billing-last_name').clear().type('Johnson');
cy.get('#billing-first_name').clear().type('Test');
cy.get('#billing-country').find('#components-form-token-input-0').type('Japan').first().click();
cy.get('#billing-state').find('input').type('Tokyo').first().click();
cy.get('#billing-postcode').clear().type('180-0004');
cy.get('#billing-city').clear().type('Musashino');
cy.get('#billing-address_1').clear().type('address');
cy.get('#billing-phone').clear().type('123123213213213');
cy.get('.wc-block-components-address-address-wrapper').then(($el) => {
if ($el.hasClass('is-editing')) {
cy.get('#billing-last_name').clear().type('Johnson');
cy.get('#billing-first_name').clear().type('Test');
cy.get('#billing-country').select('Japan');
cy.get('#billing-state').select('Tokyo');
cy.get('#billing-postcode').clear().type('180-0004');
cy.get('#billing-city').clear().type('Musashino');
cy.get('#billing-address_1').clear().type('address');
cy.get('#billing-phone').clear().type('123123213213213');
}
});
});

Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe) => {
Expand Down
Loading

0 comments on commit 2855300

Please sign in to comment.