<?php
namespace SabaiApps\Directories\Component\PaymentGateway\Controller;

use SabaiApps\Directories\Context;
use SabaiApps\Directories\Controller;
use SabaiApps\Directories\Response;

class Webhook extends Controller {

	protected function _doExecute( Context $context ) {
		try {
			$this->_application->PaymentGateway_Util_gateway( $context->gateway )->paymentGatewayOnWebhook( $context );
			Response::sendStatusHeader( 200 );
		} catch ( \Exception $e ) {
			$this->logError( $e );
			Response::sendStatusHeader( 400 );
		}
		exit;
	}
}
