-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct-nextpay_api.xml
134 lines (124 loc) · 4.04 KB
/
product-nextpay_api.xml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="nextpay_api" active="1">
<title>Nextpay Payment Module</title>
<description>Payment Gateway For VIP users</description>
<version>4.X.X</version>
<url><![CDATA[http://www.nextpay.ir]]></url>
<versioncheckurl><![CDATA[http://www.nextpay.ir]]></versioncheckurl>
<dependencies>
</dependencies>
<codes>
<code version="1.0">
<installcode><![CDATA[
function toggle_subs()
{
global $vbulletin;
$setting = 0;
if ($check = $vbulletin->db->query_first("
SELECT paymentapiid
FROM " . TABLE_PREFIX . "paymentapi
WHERE active = 1
"))
{
if ($check = $vbulletin->db->query_first("
SELECT subscriptionid
FROM " . TABLE_PREFIX . "subscription
WHERE active = 1
"))
{
$setting = 1;
}
}
if ($setting != $vbulletin->options['subscriptionmethods'])
{
// update $vboptions
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "setting
SET value = '$setting'
WHERE varname = 'subscriptionmethods'
");
build_options();
}
}
$db->hide_errors();
$apisettings = array(
"nxapi_key" => array("type" => "text", "value" => "", "validate" => "string"),
"d2t" => array("type" => "text", "value" => "", "validate" => "string")
);
$api = array(
"title" => "Nextpay",
"active" => 1,
"classname" => "nextpay",
"currency" => "usd",
"recurring" => 0,
"settings" => serialize($apisettings),
);
$db->query_write(fetch_query_sql($api, 'paymentapi'));
toggle_subs();
$db->show_errors();]]></installcode>
<uninstallcode><![CDATA[
function toggle_subs()
{
global $vbulletin;
$setting = 0;
if ($check = $vbulletin->db->query_first("
SELECT paymentapiid
FROM " . TABLE_PREFIX . "paymentapi
WHERE active = 1
"))
{
if ($check = $vbulletin->db->query_first("
SELECT subscriptionid
FROM " . TABLE_PREFIX . "subscription
WHERE active = 1
"))
{
$setting = 1;
}
}
if ($setting != $vbulletin->options['subscriptionmethods'])
{
// update $vboptions
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "setting
SET value = '$setting'
WHERE varname = 'subscriptionmethods'
");
build_options();
}
}
$db->hide_errors();
$db->query_write("DELETE FROM " . TABLE_PREFIX . "paymentapi WHERE classname = 'nextpay'");
toggle_subs();
$db->show_errors();]]></uninstallcode>
</code>
</codes>
<templates>
<template name="subscription_payment_nextpay" templatetype="template" date="1294078080" username="admin" version="1.0"><![CDATA[
<input type="hidden" name="nx_api_key" value="{vb:raw Api_Key}" />
<input type="hidden" name="nx_comments" value="{vb:rawphrase x_subscription, {vb:raw subinfo.title}} by {vb:raw userinfo.username}" />
<input type="hidden" name="nx_callback_url" value="{vb:raw vboptions.bburl}/payment_gateway.php?method=nextpay&item={vb:raw item}" />
<input type="hidden" name="nx_amount" value="{vb:raw cost}" />
]]></template>
</templates>
<plugins>
</plugins>
<phrases>
<phrasetype name="Subscription Tools" fieldname="subscription">
<phrase name="nextpay" date="1294078080" username="OM!DTAK" version="1.0"><![CDATA[nextpay]]></phrase>
<phrase name="nextpay_order_instructions" date="1294078080" username="admin" version="1.00"><![CDATA[To pay for your subscription using <a href="http://www.nextpay.ir" target="_blank">nextpay</a> click the button below and follow the onscreen instructions.]]></phrase>
<phrase name="setting_nextpay_nxapi_key_desc" date="1294078080" username="admin" version="1.00"><![CDATA[Please enter your Nextpay Api Key]]></phrase>
<phrase name="setting_nextpay_nxapi_key_title" date="1294078080" username="admin" version="1.00"><![CDATA[Nextpay Api Key]]></phrase>
<phrase name="setting_nextpay_d2t_desc" date="1294078080" username="admin" version="1.00"><![CDATA[Please enter Currency conversion rate to Toman]]></phrase>
<phrase name="setting_nextpay_d2t_title" date="1294078080" username="admin" version="1.00"><![CDATA[Currency exchange rate]]></phrase>
</phrasetype>
</phrases>
<options>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>