paytrail / paytrail-for-woocommerce

Paytrail payment service for WooCommerce
MIT License
4 stars 9 forks source link

Manual recurring payments not working with WooCommerce Subscriptions #30

Closed villesiltala closed 1 year ago

villesiltala commented 2 years ago

Describe the bug

When the gateway plugin is activated with WooCommerce Subscriptions, the customer is unable to use payment methods supporting manual renewals, e.g. online banking payments. This bug is caused by the insufficient logic in the ProviderForm.php file. It uses a helper method from \Paytrail\WooCommercePaymentGateway\Helper::getIsSubscriptionsEnabled() to determine whether to render other than credit card payment methods. If the plugin is enabled, no other payment methods are rendered on the form. This check should take into account the manual recurring payments option in WooCommerce Subscriptions.

Steps to Reproduce

  1. Install WooCommerce Subscriptions.
  2. Install Paytrail For WooCommerce.
  3. Enable manual recurring payments in WooCommerce Subscriptions settings.
  4. Go to the checkout page in the front-end with a subscription product in the cart.
  5. See only the card payment option in the provider selection form.

Expected behaviour

If manual recurring payments are enabled, all payment methods should be available in the provider selection form. If the end-user selects a method other than credit card, the subscription orders should be set to be renewed manually. If the credit card option is selected, the automatically scheduled token payment process should be activated.

To do this, add a check for the manual recurring payments option for the provider form and display all methods if the option is enabled.

villesiltala commented 2 years ago

Here's a link to the setting guide: https://woocommerce.com/document/subscriptions/store-manager-guide/#renewal-settings

villesiltala commented 2 years ago

At least the newest versions of WooCommerce Subscrptions provide a helper method for checking the setting: https://github.com/Automattic/woocommerce-subscriptions-core/blob/c87beae8bb1996e67f6c8ed16d212048c4df6155/includes/wcs-renewal-functions.php#L161

loueranta-paytrail commented 2 years ago

@villesiltala We actually had support for manual recurring payments in the past, but it caused problems to certain merchants, so we decided to stop supporting it.

However, we are now planning on adding an option to the module settings which would enable merchants to use this functionality if they so choose.

I will let you know when it's available.

villesiltala commented 2 years ago

@loueranta-paytrail thanks for the reply! In this case, the merchant does not have credit card payments enabled and thus automatically recurring payments are not available. Allowing users to manually renew their subscriptions has been the solution for the shop.

villesiltala commented 1 year ago

Any updates on this? This missing feature prevents us from using the new official Paytrail plugin version for various customers. We are still relying on a forked version of the old Checkout Finland implementation. This situation is not optimal, but until the official plugin starts supporting manual renewals and stops forcing credit card payments as the only payment option for WooCommerce Subscription orders, we are forced to use forked versions.

Could you give us some schedule, when this feature will be implemented? If this is not on the roadmap anymore, please let us know, and we can start looking for alternative payment gateways. Thanks!

loueranta-paytrail commented 1 year ago

@villesiltala This was fixed in the latest release (1.3.0)