/** * Redirect user to gateway payment form, using HTTP 'Location:' header or UI::RedirectPOST($host, $values); * * @param float $amount Purchase amount * @param Order $order Order object * @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm() * @return void */ public function RedirectToGateway(Order $order, $post_values = array()) { $host = "https://merchant.webmoney.ru/lmi/payment.asp"; $params = array('LMI_PAYMENT_NO' => $order->ID, 'LMI_PAYEE_PURSE' => $this->Config->GetFieldByName('Purse')->Value, 'LMI_PAYMENT_AMOUNT' => number_format($order->GetBillingTotal(), 2, '.', ''), 'LMI_PAYMENT_DESC' => $order->Description, 'LMI_SIM_MODE' => $this->Config->GetFieldByName('TestPaymentSuccess')->Value ? '0' : '1', 'LMI_RESULT_URL' => CONFIG::$IPNURL); if ($post_values['return_url']) { $params['LMI_SUCCESS_URL'] = $post_values['return_url']; } UI::RedirectPOST($host, $params); exit; }
/** * Redirect user to gateway payment form, using HTTP 'Location:' header or UI::RedirectPOST($host, $values); * * @param float $amount Purchase amount * @param int $orderid Order ID. Can be used as an unique identifier. * @param string $payment_for Human-readable description of the payment * @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm() * @return void */ public final function RedirectToGateway(Order $order, $post_values = array()) { $host = "https://www.monsterpay.com/secure/"; $data = array( "ButtonAction" => "buynow", "MerchantIdentifier" => $this->Config->GetFieldByName("MerchantIdentifier")->Value, "CurrencyAlphaCode" => $this->Config->GetFieldByName("CurrencyAlphaCode")->Value, "MerchCustom" => $order->ID, "TemplateID" => "", "BuyerInformation" => "", "Title" => "", "FirstName" => "", "LastName" => "", "Address1" => "", "Address2" => "", "City" => "", "State" => "", "PostalCode" => "", "Country" => "", "Email" => "", "LIDSKU" => $order->ID, "LIDDesc" => $order->Description, "LIDPrice" => number_format($order->GetBillingTotal(), 2, '.', ''), "LIDQty" => 1, "ShippingRequired" => 0, "Option1name" => "ORDERID", "Option1value" => $order->ID ); //if ($post_values["return_url"]) $data["x_receipt_link_url"] = $post_values["return_url"]; //if ($post_values["product_id"]) $data["product_id"] = $post_values["product_id"]; //if ($this->Config->GetFieldByName("isdemo")->value == 1) $data["demo"] = "Y"; UI::RedirectPOST($host, $data); exit(); }
/** * Redirect user to gateway payment form, using HTTP 'Location:' header or UI::RedirectPOST($host, $values); * * @param float $amount Purchase amount * @param int $orderid Order ID. Can be used as an unique identifier. * @param string $payment_for Human-readable description of the payment * @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm() * @return void */ public final function RedirectToGateway(Order $order, $post_values = array()) { $host = ($this->Config->GetFieldByName("isdemo")->Value == 1) ? "www.ips.net.cn/ipay/test_ipayment.asp" : "www.ips.com.cn/ipay/ipayment.asp"; $data = array( "mer_code" => $this->Config->GetFieldByName("merch_code")->Value, "billno" => $this->Config->GetFieldByName("merch_code")->Value.substr(time(), -6), "amount" => number_format($order->GetBillingTotal(), 2, '.', ''), "date" => date("Ymd"), "currency" => $post_values["Currency"], "merchanturl" => CONFIG::$IPNURL, "lang" => $post_values["Lang"], "attach" => $order->ID, "retencodetype" => 2, "orderencodetype" => 1, "rettype" => 0 ); $data["signmd5"] = md5($data["billno"].$data["amount"].$data["date"].$this->Config->GetFieldByName("password")->Value); UI::RedirectPOST("http://{$host}", $data); exit(); }