Exemplo n.º 1
0
 public static function displayPaymentButton(GWF_PaymentModule $module, $mode = '2', $order_token = false)
 {
     $i = ' style="display:inline;" ';
     $token = $module->getSiteNameToken();
     $action = GWF_HTML::display($_SERVER['REQUEST_URI']);
     $hidden = GWF_Form::hidden('paysite', $token);
     $hidden .= $order_token === false ? '' : GWF_Form::hidden('gwf_order', $order_token);
     $button = GWF_Form::buttonImage('on_order_' . $mode, sprintf('img/' . GWF_ICON_SET . '/buy_%s.png', $token));
     return sprintf('<div%s><form%saction="%s" method="post"><div%s>%s%s</div></form></div>', $i, $i, $action, $i, $hidden, $button);
 }
Exemplo n.º 2
0
 public static function insertOrder(GWF_Module $module, GWF_Orderable $gdo, GWF_PaymentModule $paysite, GWF_User $user, $price_total, $cartid = 0)
 {
     $token = self::generateToken();
     $order = new self(array('order_cartid' => $cartid, 'order_uid' => $user->getID(), 'order_token' => $token, 'order_xtoken' => '', 'order_date_paid' => '00000000000000', 'order_date_ordered' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'order_price' => $gdo->getOrderPrice($user), 'order_price_total' => $price_total, 'order_currency' => Module_Payment::getShopCurrencyS(), 'order_amount' => 1, 'order_email' => '', 'order_site' => $paysite->getSiteNameToken(), 'order_title' => $gdo->getOrderItemName($module, GWF_Language::getCurrentISO()), 'order_title_admin' => $gdo->getOrderItemName($module, GWF_LANG_ADMIN), 'order_descr' => $gdo->getOrderDescr($module, GWF_Language::getCurrentISO()), 'order_descr_admin' => $gdo->getOrderDescr($module, GWF_LANG_ADMIN), 'order_status' => self::CREATED, 'order_data' => serialize($gdo), 'order_module' => $gdo->getOrderModuleName()));
     if (false === $order->insert()) {
         return false;
     }
     return $order;
 }