private function submitPurchaseBACS( DirectDebit\Purchase $purchase )
    {
        $fields = array(
            'merchantRefNum',
            'amount',
            'bacs'
        );

        if (!isset($purchase->bacs->paymentToken))
        {
            $fields[] = 'profile';
            $fields[] = 'billingDetails';
			$fields2 = array("firstName","lastName");
            $purchase->profile->setRequiredFields($fields2);
            $purchase->profile->checkRequiredFields($fields2);
        }

        $purchase->setRequiredFields($fields);
        $purchase->checkRequiredFields();
        $purchase->setOptionalFields(array(
            'customerIp',
            'dupCheck'
        ));

        $request = new Request(array(
            'method' => Request::POST,
            'uri' => $this->prepareURI($this->purchasePath),
            'body' => $purchase
        ));

        $response = $this->client->processRequest($request);
        return new DirectDebit\Purchase($response);
    }
private function submitPurchaseBACS( DirectDebit\Purchase $purchase )
    {
        $fields = array(
            'merchantRefNum',
            'amount',
            'bacs'
        );

        if (!isset($purchase->bacs->paymentToken))
        {
            $fields[] = 'profile';
            $fields[] = 'billingDetails';
			$fields2 = array("firstName","lastName");
            $purchase->profile->setRequiredFields($fields2);
            $purchase->profile->checkRequiredFields($fields2);
        }

        $purchase->setRequiredFields($fields);
        $purchase->checkRequiredFields();
        $purchase->setOptionalFields(array(
            'customerIp',
            'dupCheck'
        ));

        $request = new Request(array(
            'method' => Request::POST,
            'uri' => $this->prepareURI($this->purchasePath),
            'body' => $purchase
        ));

        $response = $this->client->processRequest($request);
        return new DirectDebit\Purchase($response);
    }
private function submitPurchaseBACS ( DirectDebit \ Purchase $ purchase ) { $ fields = array ( 'merchantRefNum' , 'amount' , 'bacs' ) ; if ( ! isset ( $ purchase -> bacs -> paymentToken ) ) { $ fields [ ] = 'profile' ; $ fields [ ] = 'billingDetails' ; $ fields2 = array ( "firstName" , "lastName" ) ; $ purchase -> profile -> setRequiredFields ( $ fields2 ) ; $ purchase -> profile -> checkRequiredFields ( $ fields2 ) ; } $ purchase -> setRequiredFields ( $ fields ) ; $ purchase -> checkRequiredFields ( ) ; $ purchase -> setOptionalFields ( array ( 'customerIp' , 'dupCheck' ) ) ; $ request = new Request ( array ( 'method' => Request :: POST , 'uri' => $ this -> prepareURI ( $ this -> purchasePath ) , 'body' => $ purchase ) ) ; $ response = $ this -> client -> processRequest ( $ request ) ; return new DirectDebit \ Purchase ( $ response ) ; }
Process Purchase using BACS without payment token.

@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException
Process Purchase using BACS without payment token .