public function createPayment($gateway)
    {
        if (!GatewayInfo::isSupported($gateway)) {
            user_error(_t(
                "PaymentProcessor.INVALID_GATEWAY",
                "`{gateway}` is not supported.",
                null,
                array('gateway' => (string)$gateway)
            ), E_USER_ERROR);
        }

        // Create a payment
        $this->payment = Payment::create()->init(
            $gateway,
            $this->reservation->Total,
            self::config()->get('currency')
        );

        // Set a reference to the reservation
        $this->payment->ReservationID = $this->reservation->ID;

        return $this->payment;
    }
public function createPayment($gateway)
    {
        if (!GatewayInfo::isSupported($gateway)) {
            user_error(_t(
                "PaymentProcessor.INVALID_GATEWAY",
                "`{gateway}` is not supported.",
                null,
                array('gateway' => (string)$gateway)
            ), E_USER_ERROR);
        }

        // Create a payment
        $this->payment = Payment::create()->init(
            $gateway,
            $this->reservation->Total,
            self::config()->get('currency')
        );

        // Set a reference to the reservation
        $this->payment->ReservationID = $this->reservation->ID;

        return $this->payment;
    }
public function createPayment ( $ gateway ) { if ( ! GatewayInfo :: isSupported ( $ gateway ) ) { user_error ( _t ( "PaymentProcessor.INVALID_GATEWAY" , "`{gateway}` is not supported." , null , array ( 'gateway' => ( string ) $ gateway ) ) , E_USER_ERROR ) ; } // Create a payment $ this -> payment = Payment :: create ( ) -> init ( $ gateway , $ this -> reservation -> Total , self :: config ( ) -> get ( 'currency' ) ) ; // Set a reference to the reservation $ this -> payment -> ReservationID = $ this -> reservation -> ID ; return $ this -> payment ; }
Create a payment trough the given payment gateway

@param string $gateway

@return Payment
Create a payment trough the given payment gateway