Advertisement
Guest User

class_onebip.php

a guest
Jun 13th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.13 KB | None | 0 0
  1. <?php
  2. /*======================================================================*\
  3. || #################################################################### ||
  4. || # Onebip Module 1.0.1 [LITE] for vBulletin
  5. || #################################################################### ||
  6. \*======================================================================*/
  7.  
  8. if (!isset($GLOBALS['vbulletin']->db))
  9. {
  10.     exit;
  11. }
  12.  
  13. /**
  14. * Class that provides payment verification and form generation functions
  15. *
  16. * @package  Onebip Module
  17. */
  18. class vB_PaidSubscriptionMethod_onebip extends vB_PaidSubscriptionMethod
  19. {
  20.     /**
  21.     * The variable indicating if this payment provider supports recurring transactions
  22.     *
  23.     * @var  bool
  24.     */
  25.     var $supports_recurring = false;
  26.  
  27.     /**
  28.     * Perform verification of the payment, this is called from the payment gateway
  29.     *
  30.     * @return   bool    Whether the payment is valid
  31.     */
  32.     function verify_payment()
  33.     {
  34.        
  35.     // ONLY ON PRO VERSION             
  36.  
  37.  
  38.     }
  39.  
  40.     /**
  41.     * Test that required settings are available, and if we can communicate with the server (if required)
  42.     *
  43.     * @return   bool    If the vBulletin has all the information required to accept payments
  44.     */
  45.     function test()
  46.     {
  47.         return (!empty($this->settings['obaccount']));
  48.  
  49.        
  50.     }
  51.  
  52.     /**
  53.     * Generates HTML for the subscription form page
  54.     *
  55.     * @param    string      Hash used to indicate the transaction within vBulletin
  56.     * @param    string      The cost of this payment
  57.     * @param    string      The currency of this payment
  58.     * @param    array       Information regarding the subscription that is being purchased
  59.     * @param    array       Information about the user who is purchasing this subscription
  60.     * @param    array       Array containing specific data about the cost and time for the specific subscription period
  61.     *
  62.     * @return   array       Compiled form information
  63.     */
  64.     function generate_form_html($hash, $cost, $currency, $subinfo, $userinfo, $timeinfo)
  65.     {
  66.         global $vbphrase, $vbulletin, $show;
  67.        
  68.         $item = $hash;
  69.         $currency = strtoupper($currency);
  70.         $cost = str_replace(".","",$cost);
  71.         $form['action'] = 'https://www.onebip.com/otms/';
  72.         $form['method'] = 'post';
  73.         $account = $this->settings['obaccount'];
  74.         // load settings into array so the template system can access them
  75.         $settings =& $this->settings;
  76.  
  77.         $templater = vB_Template::create('subscription_payment_onebip');
  78.             $templater->register('account', $account);
  79.             $templater->register('cost', $cost);
  80.             $templater->register('currency', $currency);
  81.             $templater->register('item', $item);
  82.             $templater->register('settings', $settings);
  83.             $templater->register('subinfo', $subinfo);
  84.             $templater->register('timeinfo', $timeinfo);
  85.             $templater->register('userinfo', $userinfo);
  86.         $form['hiddenfields'] .= $templater->render();
  87.         return $form;
  88.     }
  89. }
  90.  
  91. /*======================================================================*\
  92. || ####################################################################
  93. || # Downloaded: 03:18, Wed Dec 1st 2010
  94. || # CVS: $RCSfile$ - $Revision: 37230 $
  95. || ####################################################################
  96. \*======================================================================*/
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement