original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Process Purchase using BACS without payment token.
  
  @param \Paysafe\DirectDebit\Purchase $purchase
  @return \Paysafe\DirectDebit\Purchase
  @throws PaysafeException
docstring_tokens: Process Purchase using BACS without payment token .