Svea/WebService/Payment/WebServicePayment.php
/**
     * Rebuild $order with svea_soap package to be in right format for SveaWebPay Europe Web service API
     * @return prepared SveaRequest
     * @throws \Svea\ValidationException
     */
Rebuild $order with svea_soap package to be in right format for SveaWebPay Europe Web service API
@return prepared SveaRequest
@throws \Svea\ValidationException
Rebuild $order with svea_soap package to be in right format for SveaWebPay Europe Web service API @return prepared SveaRequest @throws \ Svea \ ValidationException
public function prepareRequest() {
        $errors = $this->validateOrder();
        if (count($errors) > 0) {
            $exceptionString = "";
            foreach ($errors as $key => $value) {
                $exceptionString .="-". $key. " : ".$value."\n";
            }
            throw new \Svea\ValidationException($exceptionString);
        }
        $sveaOrder = new WebServiceSoap\SveaOrder;
        $sveaOrder->Auth = $this->getPasswordBasedAuthorization();
        $orderinformation = $this->formatOrderInformationWithOrderRows($this->order->orderRows);
        if (isset($this->order->customerIdentity)) {
            $orderinformation->CustomerIdentity = $this->formatCustomerDetails();
        } else {
            $orderinformation->CustomerIdentity = $this->formatCustomerIdentity();
        }
        $orderinformation->ClientOrderNumber = $this->order->clientOrderNumber;
        $orderinformation->OrderDate = $this->order->orderDate;
        $orderinformation->CustomerReference = $this->order->customerReference;
        $sveaOrder->CreateOrderInformation = $this->setOrderType($orderinformation);
        $object = new WebServiceSoap\SveaRequest();
        $object->request = $sveaOrder;
        $this->requestObject = $object;
        return $object;
    }
public function prepareRequest ( ) { $ errors = $ this -> validateOrder ( ) ; if ( count ( $ errors ) > 0 ) { $ exceptionString = " " ; foreach ( $ errors as $ key => $ value ) { $ exceptionString .= " - " . $ key . "  :  " . $ value . " \n " ; } throw new \ Svea \ ValidationException ( $ exceptionString ) ; } $ sveaOrder = new WebServiceSoap \ SveaOrder ; $ sveaOrder -> Auth = $ this -> getPasswordBasedAuthorization ( ) ; $ orderinformation = $ this -> formatOrderInformationWithOrderRows ( $ this -> order -> orderRows ) ; if ( isset ( $ this -> order -> customerIdentity ) ) { $ orderinformation -> CustomerIdentity = $ this -> formatCustomerDetails ( ) ; } else { $ orderinformation -> CustomerIdentity = $ this -> formatCustomerIdentity ( ) ; } $ orderinformation -> ClientOrderNumber = $ this -> order -> clientOrderNumber ; $ orderinformation -> OrderDate = $ this -> order -> orderDate ; $ orderinformation -> CustomerReference = $ this -> order -> customerReference ; $ sveaOrder -> CreateOrderInformation = $ this -> setOrderType ( $ orderinformation ) ; $ object = new WebServiceSoap \ SveaRequest ( ) ; $ object -> request = $ sveaOrder ; $ this -> requestObject = $ object ; return $ object ; }
Rebuild $order with svea_soap package to be in right format for SveaWebPay Europe Web service API
 @return prepared SveaRequest
 @throws \Svea\ValidationException
Rebuild $order with svea_soap package to be in right format for SveaWebPay Europe Web service API @return prepared SveaRequest @throws \ Svea \ ValidationException
// validate order, throw exception on validation failure // create soap order object, set authorization //make orderrows and put in CreateOrderInfromation //parallel ways of creating customer //do request