示例#1
0
 public function form_payment_frame($order_id, $value, $curr_code, $modules = null)
 {
     $this->back_button();
     $this->payments_data_button();
     $payment_url = Base_EssClientCommon::get_payments_url();
     $description = $modules ? "Payment for: {$modules}" : "Order id: {$order_id}";
     $data = array('action_url' => $payment_url, 'record_id' => $order_id, 'record_type' => 'ess_orders', 'amount' => $value, 'currency' => $curr_code, 'description' => $description, 'auto_process' => '1', 'lang' => Base_LangCommon::get_lang_code(), 'hide_page_banner' => '1');
     $credentials = Base_EpesiStoreCommon::get_payment_credentials();
     foreach (array('first_name', 'last_name', 'address_1', 'address_2', 'city', 'postal_code', 'country', 'email', 'phone') as $key) {
         if (isset($credentials[$key])) {
             $data[$key] = $credentials[$key];
         }
     }
     print '<iframe name="payments" width="800px" style="border: none;" height="600px"></iframe>';
     $html = create_html_form($form_name, $payment_url, $data, 'payments');
     print $html;
     $open_js = "document.{$form_name}.submit()";
     eval_js($open_js);
 }