Advertisement
Guest User

Onebip Module.xml

a guest
Jun 13th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.15 KB | None | 0 0
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <product productid="onebip" active="1">
  4.     <title>Onebip Payment Module [LITE]</title>
  5.     <description>This product adds a onebip module for the payment APIs</description>
  6.     <version>1.0.1</version>
  7.     <url><![CDATA[]]></url>
  8.     <versioncheckurl><![CDATA[]]></versioncheckurl>
  9.     <dependencies>
  10.         <dependency dependencytype="vbulletin" minversion="3.8.0" maxversion="" />
  11.     </dependencies>
  12.  
  13.     <codes>
  14.         <code version="1.0">
  15.             <installcode><![CDATA[
  16. function toggle_subs()
  17. {
  18.     global $vbulletin;
  19.  
  20.     $setting = 0;
  21.     if ($check = $vbulletin->db->query_first("
  22.         SELECT paymentapiid
  23.         FROM " . TABLE_PREFIX . "paymentapi
  24.         WHERE active = 1
  25.     "))
  26.     {
  27.         if ($check = $vbulletin->db->query_first("
  28.             SELECT subscriptionid
  29.             FROM " . TABLE_PREFIX . "subscription
  30.             WHERE active = 1
  31.         "))
  32.         {
  33.             $setting = 1;
  34.         }
  35.     }
  36.  
  37.     if ($setting != $vbulletin->options['subscriptionmethods'])
  38.     {
  39.         // update $vboptions
  40.         $vbulletin->db->query_write("
  41.             UPDATE " . TABLE_PREFIX . "setting
  42.             SET value = '$setting'
  43.             WHERE varname = 'subscriptionmethods'
  44.         ");
  45.         build_options();
  46.     }
  47. }
  48.  
  49. $db->hide_errors();
  50. $apisettings = array(
  51.     "obaccount"      => array("type" => "text", "value" => "your_onebip_account", "validate" => "string")
  52. );
  53.  
  54. $api = array(
  55.     "title" => "OneBip",
  56.     "active" => 1,
  57.     "classname" => "onebip",
  58.     "currency" => "usd,gbp,eur,aud,cad",
  59.     "recurring" => 0,
  60.     "settings" => serialize($apisettings),
  61. );
  62.  
  63. $db->query_write(fetch_query_sql($api, 'paymentapi'));
  64. toggle_subs();
  65. $db->show_errors();]]></installcode>
  66.             <uninstallcode><![CDATA[
  67. function toggle_subs()
  68. {
  69.     global $vbulletin;
  70.  
  71.  
  72.     $setting = 0;
  73.     if ($check = $vbulletin->db->query_first("
  74.         SELECT paymentapiid
  75.         FROM " . TABLE_PREFIX . "paymentapi
  76.         WHERE active = 1
  77.     "))
  78.     {
  79.         if ($check = $vbulletin->db->query_first("
  80.             SELECT subscriptionid
  81.             FROM " . TABLE_PREFIX . "subscription
  82.             WHERE active = 1
  83.         "))
  84.         {
  85.             $setting = 1;
  86.         }
  87.     }
  88.  
  89.     if ($setting != $vbulletin->options['subscriptionmethods'])
  90.     {
  91.         // update $vboptions
  92.         $vbulletin->db->query_write("
  93.             UPDATE " . TABLE_PREFIX . "setting
  94.             SET value = '$setting'
  95.             WHERE varname = 'subscriptionmethods'
  96.         ");
  97.         build_options();
  98.     }
  99. }
  100.  
  101. $db->hide_errors();
  102. $db->query_write("DELETE FROM " . TABLE_PREFIX . "paymentapi WHERE classname = 'onebip'");
  103. toggle_subs();
  104. $db->show_errors();]]></uninstallcode>
  105.         </code>
  106.     </codes>
  107.     <templates>
  108.     <template name="subscription_payment_onebip" templatetype="template" date="1294078080" username="R3tr0s" version="1.0"><![CDATA[
  109.     <input type="hidden" name="command" value="standard_pay" />
  110. <input type="hidden" name="username" value="{vb:raw account}" />
  111. <input type="hidden" name="description" value="{vb:rawphrase x_subscription, {vb:raw subinfo.title}}" />
  112. <input type="hidden" name="item_code" value="{vb:raw item}" />
  113. <input type="hidden" name="price" value="{vb:raw cost}" />
  114. <input type="hidden" name="currency" value="{vb:raw currency}" />
  115. <input type="hidden" name="return_url" value="{vb:raw vboptions.bburl}" />
  116. <input type="hidden" name="cancel_url" value="{vb:raw vboptions.bburl}" />
  117.     ]]></template>
  118.     </templates>
  119.     <plugins>
  120.     </plugins>
  121.     <phrases>
  122.         <phrasetype name="Subscription Tools" fieldname="subscription">
  123.             <phrase name="onebip" date="1294078080" username="R3tr0s" version="1.0"><![CDATA[Onebip]]></phrase>
  124.             <phrase name="onebip_order_instructions" date="1294078080" username="R3tr0s" version="1.00"><![CDATA[To pay for your subscription using <a href="http://www.onebip.com" target="_blank">Onebip</a> click the button below and follow the onscreen instructions. <b>Onebip Module powered by <a href="http://www.sciax2.it/forum/" target="_blank">R3tr0s</a></b> ]]></phrase>
  125.             <phrase name="setting_onebip_obaccount_desc" date="1294078080" username="R3tr0s" version="1.00"><![CDATA[Please enter your Onebip email]]></phrase>
  126.             <phrase name="setting_onebip_obaccount_title" date="1294078080" username="R3tr0s" version="1.00"><![CDATA[Onebip Email]]></phrase>
  127.  
  128.         </phrasetype>
  129.     </phrases>
  130.     <options>
  131.     </options>
  132.     <helptopics>
  133.     </helptopics>
  134.     <cronentries>
  135.     </cronentries>
  136.     <faqentries>
  137.     </faqentries>
  138. </product>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement