public function simpleCreatePayment($args) { // Formats the `commonRequest` part $commonRequest = $this->buildCommonRequest(); // Formats the `paymentRequest` part $paymentRequest = $this->buildPaymentRequest($args['amount'], $args['currency']); // Formats the `cardRequest` part $cardRequest = $this->buildCardRequest($args['cardNumber'], $args['expiryMonth'], $args['expiryYear'], $args['csc'], $args['scheme']); // Formats the `orderRequest` part $orderRequest = $this->buildOrderRequest($args['orderId']); // Builds SOAP headers $soapHeaders = $this->buildSoapHeaders(); // Builds the SOAP request body $createPaymentWorkload = array('commonRequest' => $commonRequest, 'paymentRequest' => $paymentRequest, 'orderRequest' => $orderRequest, 'cardRequest' => $cardRequest, 'customerRequest' => array(), 'techRequest' => array()); // Sets-up the whole SOAP request $soapClient = new SoapClient($this->payzenAccount['wsdl'], $this->soapClientOptions); $soapClient->__setSoapHeaders($soapHeaders); // Sends the `createPayment` request $res = $soapClient->createPayment($createPaymentWorkload); $code = $res->createPaymentResult->commonResponse->responseCode; if ($code === 0) { //Response received, request was successful: code is 0 } else { //Response received, request wasn't successful: code is $code } // Validates the response's SOAP header $this->checkResponseHeaders($soapClient->__getLastResponse()); return $res; }