Problem / motivation
Currently response error codes are only stored in the PaymentGatewayException error code, but not in the error message.
By default, exception error codes which contain relevant information about the error are not logged. (Payment init failed)
Proposed solution
Add error code to the exception's message in:
\Drupal\commerce_otpsp\PluginForm\SimplePayRedirectOffSitePaymentForm::buildConfigurationForm
something like
throw new PaymentGatewayException(sprintf('Payment init failed, code: %s', $paymentResponse->errorCodes[0]));
and fix invalid exception initialization in
\Drupal\commerce_otpsp\Plugin\Commerce\PaymentGateway\SimplePay::onReturnUpdatePayment
Comments
Comment #2
bpstr commented