Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with updating payment method WooCommerce Subscriptions #173

Open
marconmartins opened this issue Sep 26, 2024 · 1 comment · May be fixed by #174
Open

Issues with updating payment method WooCommerce Subscriptions #173

marconmartins opened this issue Sep 26, 2024 · 1 comment · May be fixed by #174
Labels
question Further information is requested

Comments

@marconmartins
Copy link

Describe the bug

With WooCommerce Subscriptions it is not possible to update the credit card.

Steps to Reproduce

  1. In the My Account page Subscriptions page, open an active subscription.
  2. Click on the button to change the payment method.
  3. Click on an existing card.
  4. Click on the delete card.

Expected behaviour

The current payment method should be highlighted when loading the page. When clicked, the delete button, the selected card should be deleted.

Actual behaviour

There is no highlight in the currently used card. When clicked, the delete button does nothing.

There is a request to /paytrail/card/delete returning code 500 and the error log throws:

PHP Fatal error:  Uncaught Error: Class "Paytrail\WooCommercePaymentGateway\Exception" not found in /var/www/html/wordpress/wp-content/plugins/paytrail-for-woocommerce/src/Controllers/Card.php:77
Stack trace:
#0 /var/www/html/wordpress/wp-content/plugins/paytrail-for-woocommerce/src/Controllers/Card.php(34): Paytrail\WooCommercePaymentGateway\Controllers\Card->validate_request()
#1 /var/www/html/wordpress/wp-content/plugins/paytrail-for-woocommerce/src/Controllers/AbstractController.php(12): Paytrail\WooCommercePaymentGateway\Controllers\Card->delete()
#2 /var/www/html/wordpress/wp-content/plugins/paytrail-for-woocommerce/src/Router.php(89): Paytrail\WooCommercePaymentGateway\Controllers\AbstractController->execute('delete')
#3 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): Paytrail\WooCommercePaymentGateway\Router->routes('/var/www/html/w...')
#4 /var/www/html/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters('/var/www/html/w...', Array)
#5 /var/www/html/wordpress/wp-includes/template-loader.php(104): apply_filters('template_includ...', '/var/www/html/w...')
#6 /var/www/html/wordpress/wp-blog-header.php(19): require_once('/var/www/html/w...')
#7 /var/www/html/wordpress/index.php(17): require('/var/www/html/w...')
#8 {main}
  thrown in /var/www/html/wordpress/wp-content/plugins/paytrail-for-woocommerce/src/Controllers/Card.php on line 77

Commenting out Paytrail\WooCommercePaymentGateway\Controllers\Card->validate_request() removes the issue and the request response is fine, but the UI is not updated. After refreshing the page the card is not displayed anymore.

Additional context

Paytrail for WooCommerce: 2.1.1
WooCommerce Subscriptions: 6.3.1

@marconmartins marconmartins added the question Further information is requested label Sep 26, 2024
@kotivuori
Copy link
Collaborator

Thanks for reporting this @marconmartins. We’ll look into it shortly.

@kotivuori kotivuori linked a pull request Oct 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants