function startPaymentProcess() { if (!$this->TxnId) { $this->TxnId = uniqid("ID"); } $request = new PxPayRequest(); #Set PxPay properties if ($this->MerchantReference) { $request->setMerchantReference($this->MerchantReference); } else { user_error("error in DpsPxPayComs::startPaymentProcess, MerchantReference not set. ", E_USER_WARNING); } if ($this->AmountInput) { $request->setAmountInput($this->AmountInput); } else { user_error("error in DpsPxPayComs::startPaymentProcess, AmountInput not set. ", E_USER_WARNING); } if ($this->TxnData1) { $request->setTxnData1($this->TxnData1); } if ($this->TxnData2) { $request->setTxnData2($this->TxnData2); } if ($this->TxnData3) { $request->setTxnData3($this->TxnData3); } if ($this->TxnType) { $request->setTxnType($this->TxnType); } else { user_error("error in DpsPxPayComs::startPaymentProcess, TxnType not set. ", E_USER_WARNING); } if ($this->CurrencyInput) { $request->setCurrencyInput($this->CurrencyInput); } else { user_error("error in DpsPxPayComs::startPaymentProcess, CurrencyInput not set. ", E_USER_WARNING); } if ($this->EmailAddress) { $request->setEmailAddress($this->EmailAddress); } if ($this->UrlFail) { $request->setUrlFail($this->UrlFail); } else { user_error("error in DpsPxPayComs::startPaymentProcess, UrlFail not set. ", E_USER_WARNING); } if ($this->UrlSuccess) { $request->setUrlSuccess($this->UrlSuccess); } else { user_error("error in DpsPxPayComs::startPaymentProcess, UrlSuccess not set. ", E_USER_WARNING); } if ($this->TxnId) { $request->setTxnId($this->TxnId); } if ($this->EnableAddBillCard) { $request->setEnableAddBillCard($this->EnableAddBillCard); } if ($this->BillingId) { $request->setBillingId($this->BillingId); } /* TODO: $request->setEnableAddBillCard($EnableAddBillCard); $request->setBillingId($BillingId); $request->setOpt($Opt); */ #Call makeRequest function to obtain input XML $request_string = $this->PxPayObject->makeRequest($request); #Obtain output XML $this->response = new MifMessage($request_string); #Parse output XML $url = $this->response->get_element_text("URI"); //$valid = $this->response->get_attribute("valid"); #Redirect to payment page return $url; }