/** * Method render * @access public * @return mixed * @since 1.2.10 */ public function render() { $paypal_obj = new Object(); $this->form->setAction($this->is_sandbox ? PaypalBuyButton::PAYPAL_SANDBOX_URL : PaypalBuyButton::PAYPAL_PROD_URL); $this->form->onSubmitJs(""); $amount = new Hidden($this->form); $amount->setNotWspObjectName("amount")->setValue($this->amount); // HT amount $currency_code = new Hidden($this->form); $currency_code->setNotWspObjectName("currency_code")->setValue($this->currency_code); // Currency $shipping = new Hidden($this->form); $shipping->setNotWspObjectName("shipping")->setValue($this->shipping); // frais de transport $tax = new Hidden($this->form); if ($this->vat_amount > 0) { $tax->setNotWspObjectName("tax")->setValue($this->vat_amount); } $return = new Hidden($this->form); $return->setNotWspObjectName("return")->setValue($this->return_url); $cancel_return = new Hidden($this->form); $cancel_return->setNotWspObjectName("cancel_return")->setValue($this->cancel_url); $notify_url = new Hidden($this->form); $notify_url->setNotWspObjectName("notify_url")->setValue($this->notify_url); $cmd = new Hidden($this->form); $cmd->setNotWspObjectName("cmd")->setValue("_xclick"); $business = new Hidden($this->form); $business->setNotWspObjectName("business")->setValue($this->business_paypal_account); $item_name = new Hidden($this->form); $item_name->setNotWspObjectName("item_name")->setValue($this->item_name); $no_note = new Hidden($this->form); $no_note->setNotWspObjectName("no_note")->setValue(1); $lc = new Hidden($this->form); $lc->setNotWspObjectName("lc")->setValue($this->getPage()->getLanguage()); $bn = new Hidden($this->form); $bn->setNotWspObjectName("bn")->setValue("PP-BuyNowBF"); $charset = new Hidden($this->form); $charset->setNotWspObjectName("charset")->setValue("utf-8"); $custom = new Hidden($this->form); $custom->setNotWspObjectName("custom")->setValue($this->command_number); $paypal_obj->add($this->buy_btn); $paypal_obj->add($amount, $currency_code, $shipping, $tax, $return, $cancel_return, $notify_url, $cmd, $business, $item_name, $no_note, $lc, $bn, $charset, $custom); $this->form->setContent($paypal_obj); return $this->form->render(); }