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

use SabaiApps\Directories\Component\Entity\Type\IEntity;
use SabaiApps\Directories\Component\Payment\IPlan;
use SabaiApps\Directories\Component\Payment\IOrder;
use SabaiApps\Directories\Context;

interface IGateway {

	public function paymentGatewayInfo( $key = null );
	public function paymentGatewaySettingsForm( array $settings, array $parents );

	/**
	 * @param Context      $context
	 * @param IPlan|IOrder $planOrOrder
	 * @param IEntity|null $entity
	 * @param string|null  $action
	 * @param array        $parents
	 * @return mixed
	 */
	public function paymentGatewayCheckoutForm( Context $context, $planOrOrder, ?IEntity $entity = null, $action = null, array $parents = array(), $discountCodesFormFieldName = null );

	/**
	 * @param Context      $context
	 * @param string       $checkoutAction
	 * @param IPlan|IOrder $planOrOrder
	 * @param IEntity|null $entity
	 * @param string|null  $action
	 * @return mixed
	 */
	public function paymentGatewayOnCheckoutAction( Context $context, $checkoutAction, $planOrOrder = null, ?IEntity $entity = null, $action = null, array $discountCodes = array() );
	public function paymentGatewayOnOrderRefunded( IEntity $order );
	public function paymentGatewayOrderNotices( IEntity $order );
	public function paymentGatewayOrderUrl( IEntity $order );
	public function paymentGatewayOnWebhook( Context $context );
	public function paymentGatewaySubscriptionUrl( IEntity $subscription );
	public function paymentGatewayCancelSubscription( IEntity $subscription );
	public function paymentGatewayOnLoadAssets();
}
