- Issue created by @znerol
Copy&paste from a first-glance review via email:
In the code, some of the error handling looks fishy. For example:
$merchantRefundResponse = $client->postOrderRefund($remoteId,
$refundRequest);
if ($merchantRefundResponse === FALSE) {
throw new PaymentGatewayException('Failed to create refund
request on GNU Taler backend');
}
discards all of the specifics as to WHY the backend failed (400 bad
request, 500 internal server error, 403 permission denied, 410 too late
to refund, money already transferred...). You probably should at least
pass the "hint" from the JSON body (if present) or the HTTP status code
into the exception (and/or log it?) so that if something goes wrong, the
user/admin has a chance to diagnose the problem.
The same issue appears to happen on order creation and payment status
checking -- if you don't get a 200, no details seem to be reported or
logged (but maybe I'm missing something the Drupal framework does
inherently?).
I'm also surprised that
$this->mailHandler->sendMail($to, $subject, $body, $params);
cannot go wrong!?
Active
1.0
Code