Is your feature request related to a problem? Please describe.
We ran into an issue where successful PaymentRequests contained items with invalid vatPrecentage values that are not supported by the merchant of the WooCommerce site.
This was due to how we were handling negative fees in order to be compatible with Paytrail API. Apparently negative fees are now supported so this is no longer an issue.
We understand that Paytrail API validates vatPercentages between 0-100 and obviously has no idea what the merchant would like the vatPercentage to be.
Describe the solution you'd like
In order to avoid similar issues in future it would be helpful if it were possible to have a filter that allows the developer to validate the Paytrail\SDK\Request\PaymentRequest before it is sent to the Paytrail API.
In this instance, we would like to go through the items array and look for any vatPercentage values that do not align with WooCommerce settings. If there are any items with invalid vatPercentage, return false and display an error message at checkout without ever sending the PaymentRequest to the Paytrail API.
Additional context
Example Paytrail\SDK\Request\PaymentRequest JSON that has items containing invalid vatPercentage values.
Is your feature request related to a problem? Please describe.
We ran into an issue where successful PaymentRequests contained items with invalid vatPrecentage values that are not supported by the merchant of the WooCommerce site.
This was due to how we were handling negative fees in order to be compatible with Paytrail API. Apparently negative fees are now supported so this is no longer an issue.
We understand that Paytrail API validates vatPercentages between 0-100 and obviously has no idea what the merchant would like the vatPercentage to be.
Describe the solution you'd like
In order to avoid similar issues in future it would be helpful if it were possible to have a filter that allows the developer to validate the Paytrail\SDK\Request\PaymentRequest before it is sent to the Paytrail API.
In this instance, we would like to go through the items array and look for any vatPercentage values that do not align with WooCommerce settings. If there are any items with invalid vatPercentage, return false and display an error message at checkout without ever sending the PaymentRequest to the Paytrail API.
Additional context
Example Paytrail\SDK\Request\PaymentRequest JSON that has items containing invalid vatPercentage values.