public function displayPaysiteButton(GWF_Module $module, GWF_Order $order, GWF_Orderable $gdo, GWF_User $user) { $lang_iso = GWF_Language::getCurrentISO(); $action = self::RECEIVE_MONEY_URL; $hidden = GWF_Form::hidden('ap_purchasetype', 'item') . GWF_Form::hidden('ap_merchant', $this->cfgSeller()) . GWF_Form::hidden('ap_itemname', $gdo->getOrderItemName($module, $lang_iso)) . GWF_Form::hidden('ap_currency', $order->getOrderCurrency()) . GWF_Form::hidden('ap_returnurl', Common::getAbsoluteURL($gdo->getOrderSuccessURL($user), false)) . GWF_Form::hidden('ap_itemcode', $order->getOrderToken()) . GWF_Form::hidden('ap_quantity', $order->getOrderAmount()) . GWF_Form::hidden('ap_description', $gdo->getOrderDescr($module, $lang_iso)) . GWF_Form::hidden('ap_amount', $order->getOrderPriceTotal()) . GWF_Form::hidden('ap_cancelurl', Common::getAbsoluteURL($gdo->getOrderCancelURL($user), false)); // echo GWF_HTML::display($hidden); return Module_Payment::tinyform('pay_ap', 'img/' . GWF_ICON_SET . 'buy_ap.png', $action, $hidden); }
/** * Returns error message or false. * @param GWF_Order $order * @param GWF_User $user * @return string | false */ public function canAffordB(GWF_Order $order, $user) { if ($user === false) { return false; } if ($user->isAdmin()) { return false; } $money = $user->getMoney(); $price = $order->getOrderPriceTotal(); $left = $money - $price; if ($left >= 0) { return false; } $lang = $this->loadLangGWF(); return GWF_HTML::error('Buy with GWF', $lang->lang('err_funds', array(Module_Payment::displayPrice($money), Module_Payment::displayPrice($price), Module_Payment::displayPrice(-$left)))); }
public function displayOrder3(GWF_Module $module, GWF_Order $order, GDO $gdo, GWF_User $user, $sitename, $buttons) { if (false === ($paysite = GWF_PaymentModule::getPaymentModule($sitename))) { return $this->error('err_paysite'); } $paysite->onLoadLanguage(); $this->onLoadLanguage(); $fee = $order->getOrderFee(); $fee_perc = $order->getOrderFeePercent(); $tVars = array('order' => $gdo->displayOrder($module), 'price' => self::displayPrice($order->getOrderPrice()), 'fee' => self::displayPrice($fee), 'has_fee' => $fee > 0, 'fee_percent' => sprintf('%.02f%%', $fee_perc), 'price_total' => self::displayPrice($order->getOrderPriceTotal()), 'no_info' => true, 'buttons' => $buttons, 'paymodule_info' => $paysite->lang('paymodule_info3')); return $this->templatePHP('order.php', $tVars); }