public function directAliPayProcess($customerToken, $request) {
    if ($customerToken !== null && $request !== null) {
      $url = $this->url . str_replace(":customerToken", $customerToken, Connect2PayClient::$API_ROUTES['ALIPAY_DIRECT_PROCESS']);

      $request->setApiVersion($this->getApiVersion());

      $result = $this->doPost($url, json_encode($request), false);

      if ($result != null && is_object($result)) {
        $apiResponse = AliPayDirectProcessResponse::getFromJson($result);

        return $apiResponse;
      } else {
        $this->clientErrorMessage = 'No result received from direct AliPay processing call: ' . $this->clientErrorMessage;
      }
    } else {
      $this->clientErrorMessage = '"customerToken" and "request" must not be null';
    }

    return null;
  }
public function directAliPayProcess($customerToken, $request) {
    if ($customerToken !== null && $request !== null) {
      $url = $this->url . str_replace(":customerToken", $customerToken, Connect2PayClient::$API_ROUTES['ALIPAY_DIRECT_PROCESS']);

      $request->setApiVersion($this->getApiVersion());

      $result = $this->doPost($url, json_encode($request), false);

      if ($result != null && is_object($result)) {
        $apiResponse = AliPayDirectProcessResponse::getFromJson($result);

        return $apiResponse;
      } else {
        $this->clientErrorMessage = 'No result received from direct AliPay processing call: ' . $this->clientErrorMessage;
      }
    } else {
      $this->clientErrorMessage = '"customerToken" and "request" must not be null';
    }

    return null;
  }
public function directAliPayProcess ( $ customerToken , $ request ) { if ( $ customerToken !== null && $ request !== null ) { $ url = $ this -> url . str_replace ( ":customerToken" , $ customerToken , Connect2PayClient :: $ API_ROUTES [ 'ALIPAY_DIRECT_PROCESS' ] ) ; $ request -> setApiVersion ( $ this -> getApiVersion ( ) ) ; $ result = $ this -> doPost ( $ url , json_encode ( $ request ) , false ) ; if ( $ result != null && is_object ( $ result ) ) { $ apiResponse = AliPayDirectProcessResponse :: getFromJson ( $ result ) ; return $ apiResponse ; } else { $ this -> clientErrorMessage = 'No result received from direct AliPay processing call: ' . $ this -> clientErrorMessage ; } } else { $ this -> clientErrorMessage = '"customerToken" and "request" must not be null' ; } return null ; }
Direct AliPay transaction process.
Must be preceded by a payment prepare call.

@param string $customerToken
Customer token of the payment returned by the previous prepare
call
@param AliPayDirectProcessRequest $request
The AliPayDirectProcessRequest object with call parameters
@return AliPayDirectProcessResponse The AliPayDirectProcessResponse filled
with values returned from the
operation or null on failure (in that case call
getClientErrorMessage())
Direct AliPay transaction process . Must be preceded by a payment prepare call .