File: main.php

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (42 lines) | stat: -rw-r--r-- 1,343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

// Should return a decimal with added gateway fees.
function webmoney_calculate_fee($amount){
	$total = $amount + ($amount*0.008);
	return $total;
}

// Display the payment link option
function webmoney_display_icon($product_id,$amount,$item_name,$return_url,$use_recurring = "no"){
	global $paypal_account;
	global $conf_administrative_site;

	global $secpayconf_use_webmoney;
	global $secpayconf_webmoney_wmz;
	global $secpayconf_webmoney_license_key;
	global $conf_use_ssl;

	$amount = round(floatval(str_replace(",",".",$amount)), 2);

	$out = <<<HTML
<form method="POST" action="https://merchant.webmoney.ru/lmi/payment.asp" target="_blank">
<input type="hidden" name="LMI_PAYMENT_AMOUNT" value="{$amount}">
<input type="hidden" name="LMI_PAYMENT_DESC" value="Payment hosting">
<input type="hidden" name="LMI_PAYMENT_NO" value="{$product_id}">
<input type="hidden" name="LMI_PAYEE_PURSE" value="{$secpayconf_webmoney_wmz}">
<input type="hidden" name="LMI_SIM_MODE" value="0">
<input type="image" src="https://merchant.webmoney.ru/conf/img/logo2_3.gif" border="0" name="submit" alt="Payment WebMoney">
</form>
HTML;

	return $out;
}

$secpay_modules[] = array(
	"display_icon" => "webmoney_display_icon",
	"use_module" => $secpayconf_use_webmoney,
	"calculate_fee" => "webmoney_calculate_fee",
	"instant_account" => _("Yes")
);

?>