class ErrorHelper in Commerce Mollie 8
Translates Mollie exceptions and errors into Commerce exceptions.
Hierarchy
- class \Drupal\commerce_mollie\ErrorHelper
Expanded class hierarchy of ErrorHelper
1 file declares its use of ErrorHelper
- Mollie.php in src/
Plugin/ Commerce/ PaymentGateway/ Mollie.php
File
- src/
ErrorHelper.php, line 12
Namespace
Drupal\commerce_mollieView source
class ErrorHelper {
/**
* Translates Mollie exceptions into Commerce exceptions.
*
* @param \Mollie\Api\Exceptions\ApiException $exception
* The Mollie exception.
*
* @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
* The Commerce exception.
*/
public static function handleException(MollieApiException $exception) {
if ('Invalid API key' === substr($exception
->getMessage(), 0, 15)) {
throw new AuthenticationException($exception
->getMessage());
}
else {
throw new InvalidResponseException($exception
->getMessage());
}
}
/**
* Translates Mollie errors into Commerce exceptions.
*
* @param object $result
* The Mollie result object.
*
* @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
* The Commerce exception.
*/
public static function handleErrors($result) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ErrorHelper:: |
public static | function | Translates Mollie errors into Commerce exceptions. | |
ErrorHelper:: |
public static | function | Translates Mollie exceptions into Commerce exceptions. |