Non-Merchant Gateways must extend the NonmerchantGateway class.
NonmerchantGateway
The NonmerchantGateway class is an abstract class that defines methods that all non-merchant gateways must implement. In addition, it implements a method to handle common errors, and extends the Gateway class which can be found in /installpath/components/gateways/lib/gateway.php.
The NonmerchantGateway class can be found in /installpath/components/gateways/lib/nonmerchant_gateway.php.
Common Errors
When implementing nonmerchant gateways a number of errors may occur either with validation or with processing. The NonmerchantGateway class provides a method called getCommonError(), which converts common error types into error response values suitable for error message passing (i.e. can be set into Input::setErrors()). You are encouraged, whenever possible, to use these common error types.
Type | Usage |
---|---|
invalid | Use whenever the gateway processor submits an invalid request. |
transaction_not_found | Use whenever the gateway processor does not recognize the transaction. |
unsupported | Use whenever the gateway does not support the requested action (e.g. refund()) |
general | Use for all other cases. |
Setting Errors
$this->Input->setErrors($this->getCommonError("unsupported"));