-
Notifications
You must be signed in to change notification settings - Fork 2
/
pagsegurotransparente.php
2290 lines (2136 loc) · 102 KB
/
pagsegurotransparente.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
if (!defined('_VALID_MOS') && !defined('_JEXEC')) {
die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');
}
/**
* @version $Id: pagsegurotransparente.php,v 1.6 2012/08/31 11:00:57 ei
*
* a special type of 'pagseguro transparente':
* @author Max Milbers, Valérie Isaksen, Luiz Weber
* @version $Id: pagsegurotransparente.php 5122 2012-02-07 12:00:00Z luizwbr $
* @package VirtueMart
* @subpackage payment
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
if (!class_exists('vmPSPlugin')) {
require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php');
}
class plgVmPaymentPagsegurotransparente extends vmPSPlugin {
// instance of class
public static $_this = false;
function __construct(& $subject, $config) {
//if (self::$_this)
// return self::$_this;
parent::__construct($subject, $config);
$this->_loggable = true;
$this->tableFields = array_keys($this->getTableSQLFields());
$this->_tablepkey = 'id';
$this->_tableId = 'id';
$varsToPush = $this->getVarsToPush ();
$this->setConfigParameterable($this->_configTableFieldName, $varsToPush);
$this->domdocument = false;
if (!class_exists('VirtueMartModelOrders'))
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
// Set the language code
$lang = JFactory::getLanguage();
$lang->load('plg_vmpayment_' . $this->_name, JPATH_ADMINISTRATOR);
// self::$_this = $this;
if (!class_exists('CurrencyDisplay'))
require( JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php' );
}
/**
* Create the table for this plugin if it does not yet exist.
* @author Valérie Isaksen
*/
protected function getVmPluginCreateTableSQL() {
return $this->createTableSQL('Payment Pagsegurotransparente Table');
}
/**
* Fields to create the payment table
* @return string SQL Fileds
*/
function getTableSQLFields() {
// tabela com as configurações de cada transação
$SQLfields = array(
'id' => 'bigint(10) unsigned NOT NULL AUTO_INCREMENT',
'transactionCode' => ' varchar(50) NOT NULL',
'virtuemart_order_id' => 'bigint(11) UNSIGNED DEFAULT NULL',
'order_number' => 'char(50) DEFAULT NULL',
'virtuemart_paymentmethod_id' => 'mediumint(1) UNSIGNED DEFAULT NULL',
'payment_name' => 'char(255) NOT NULL DEFAULT \'\' ',
'payment_order_total' => 'decimal(15,5) NOT NULL DEFAULT \'0.00000\' ',
'payment_currency' => 'char(3) ',
'type_transaction' => 'varchar(200) DEFAULT NULL ',
'log' => ' varchar(200) DEFAULT NULL',
'status' => ' char(1) not null default \'P\'',
'msg_status' => ' varchar(255) NOT NULL',
'url_redirecionar' => ' varchar(255) NOT NULL',
'tax_id' => 'smallint(11) DEFAULT NULL',
);
return $SQLfields;
}
/**
* @param $name
* @param $id
* @param $data
* @return bool
*/
function plgVmDeclarePluginParamsPaymentVM3( &$data) {
return $this->declarePluginParams('payment', $data);
}
function getPluginParams(){
$db = JFactory::getDbo();
$sql = "select virtuemart_paymentmethod_id from #__virtuemart_paymentmethods where payment_element = 'pagsegurotransparente'";
$db->setQuery($sql);
$id = (int)$db->loadResult();
return $this->getVmPluginMethod($id);
}
/**
*
*
* @author Valérie Isaksen
*/
function plgVmConfirmedOrder($cart, $order) {
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return null; // Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return false;
}
vmJsApi::js('facebox');
vmJsApi::css('facebox');
$this->order_id = $order['details']['BT']->order_number;
$url = JURI::root();
// carrega os js e css
$doc = & JFactory::getDocument();
$url_lib = $url. '/' .'plugins'. '/' .'vmpayment'. '/' .'pagsegurotransparente'.'/';
$url_assets = $url_lib . 'assets'. '/';
$url_js = $url_assets . 'js'. '/';
$url_css = $url_assets . 'css'. '/';
$this->url_imagens = $url_lib . 'imagens'. '/';
// redirecionar dentro do componente para validar
$url_redireciona_pagsegurotransparente = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&task2=redirecionarPagseguroAPI&tmpl=component&pm='.$order['details']['BT']->virtuemart_paymentmethod_id."&order_number=".$this->order_id);
$url_pedidos = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=orders');
if ($method->url_redirecionamento) {
$url_recibo_pagsegurotransparente = JROUTE::_($method->url_redirecionamento);
} else {
$url_recibo_pagsegurotransparente = JROUTE::_(JURI::root() .'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on='.$this->order_id.'&pm='.$order['details']['BT']->virtuemart_paymentmethod_id);
}
$session_id_pagseguro = $this->getSessionIdPagseguro($method);
if (!$session_id_pagseguro) {
JFactory::getApplication()->enqueueMessage( 'Erro ao configurar e-mail e token do PagSeguro', 'error' );
return false;
}
$url_js_directpayment = $this->getUrlJsPagseguro($method);
$doc->addCustomTag('
<script type="text/javascript" src="'.$url_js_directpayment.'/pagseguro/api/v2/checkout/pagseguro.directpayment.js"></script>
<script type="text/javascript">
PagSeguroDirectPayment.setSessionId(\''.$session_id_pagseguro.'\');
jQuery.noConflict();
var redireciona_pagseguro = "'.$url_redireciona_pagsegurotransparente.'";
var url_pedidos = "'.$url_pedidos.'";
var url_recibo_pagseguro = "'.$url_recibo_pagsegurotransparente.'";
var url_assets_pagseguro = "'.$url_assets.'";
var order_total = '.round($order['details']['BT']->order_total,2).';
var max_parcela_sem_juros = '.$method->max_parcela_sem_juros.';
</script>
<script type="text/javascript" language="javascript" src="'.$url_js.'jquery.mask.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="'.$url_js.'pagsegurotransparente.js"></script>
<script type="text/javascript" language="javascript" src="'.$url_js.'jquery.card.js"></script>
<script type="text/javascript" language="javascript" src="'.$url_js.'validar_cartao.js"></script>
'.($load_squeezebox!=0?$sq_js:'').'
<link href="'.$url_css.'css_pagamento.css" rel="stylesheet" type="text/css"/>
<link href="'.$url_css.'style.css" rel="stylesheet" type="text/css"/>
'.($load_squeezebox!=0?$sq_css:'').'
');
$lang = JFactory::getLanguage();
$filename = 'com_virtuemart';
$lang->load($filename, JPATH_ADMINISTRATOR);
$vendorId = 0;
$this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
$html = "";
if (!class_exists('VirtueMartModelOrders')) {
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
}
$this->getPaymentCurrency($method);
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db = &JFactory::getDBO();
$db->setQuery($q);
$currency_code_3 = $db->loadResult();
$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, false), 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
// pega o nome do método de pagamento
$dbValues['payment_name'] = $this->renderPluginName($method);
$html = '<table>' . "\n";
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_PAYMENT_NAME', $dbValues['payment_name']);
if (!empty($payment_info)) {
$lang = & JFactory::getLanguage();
if ($lang->hasKey($method->payment_info)) {
$payment_info = JText::_($method->payment_info);
} else {
$payment_info = $method->payment_info;
}
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_INFO', $payment_info);
}
if (!class_exists('VirtueMartModelCurrency')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php');
}
$currency = CurrencyDisplay::getInstance('', $order['details']['BT']->virtuemart_vendor_id);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_ORDER_NUMBER', $order['details']['BT']->order_number);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_AMOUNT', $currency->priceDisplay($order['details']['BT']->order_total));
$html .= '
<input type="hidden" name="order_number" id="order_number" value="'. $order['details']['BT']->order_number .'"/>
</table>' . "\n";
$this->_virtuemart_paymentmethod_id = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $this->_virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $currency_code_3;
$dbValues['payment_order_total'] = $totalInPaymentCurrency;
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
// grava os dados do pagamento
//$this->gravaDados($method,0,$arr_pagamento['status']);
//$retorno = $this->createTransaction($method,$order);
$html .= $this->Pagsegurotransparente_mostraParcelamento($method, $order);
$cart->_confirmDone = FALSE;
$cart->_dataValidated = FALSE;
$cart->setCartIntoSession ();
JRequest::setVar ('html', $html);
}
public function Pagsegurotransparente_mostraParcelamento($method, $order) {
$doc = JFactory::getDocument();
//$doc->addScript($this->url_js);
if ($method->ativar_cartao ) {
$lt_cartao = '<li class="active" id="litabcartao"><a href="javascript:void(0)" data-id="#tabcartao">Cartão de Crédito</a></li>';
}
if ($method->ativar_debito ) {
$lt_cartaod = '<li id="litabdebito"><a href="javascript:void(0)" data-id="#tabdebito">Débito Bancário</a></li>';
if ( !$method->ativar_cartao ) {
$lt_cartaod = '<li class="active" id="litabdebito"><a href="javascript:void(0)" data-id="#tabdebito">Débito Bancário</a></li>';
}
}
if ($method->ativar_boleto) {
$lt_boleto = ' <li id="#litabboleto"><a href="javascript:void(0)" data-id="#tabboleto">Boleto</a></li>';
if ( !$method->ativar_cartao && !$method->ativar_debito ) {
$lt_boleto = ' <li id="#litabboleto" class="active" ><a href="javascript:void(0)" data-id="#tabboleto">Boleto</a></li>';
}
}
$conteudo = '
<div id="PagsegurotransparenteWidget"></div>
<div align="left">
<h3>'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_TITLE').'</h3>
</div>
<dl id="system-message-cartao" class="system-message-cartao">
<dd class="message error" id="div_erro" style="display:none">
<ul>
<li id="div_erro_conteudo"></li>
</ul>
</dd>
</dl>
<div class="mainpagseguro">
<!-- pg_top -->
<div class="pg_top">
<div class="pg_topleft"></div>
<div class="pg_dados">
<span>
Pague com
</span>
</div>
<ul class="pg_nav">
'.$lt_cartao .'
'.$lt_cartaod.'
'.$lt_boleto .'
</ul>
<div class="pg_topright"></div>
</div>
<!-- end pg_top -->
<input type="hidden" value="" name="forma_pagamento" id="forma_pagamento"/>
<input type="hidden" value="" name="tipo_pagamento" id="tipo_pagamento"/>
<input type="hidden" value="" name="parcela_selecionada" id="parcela_selecionada"/>
<div id="container_pagseguro" >
<div class="pg_main">
';
if ($method->ativar_cartao) {
$conteudo .= $this->getPagamentoCartao($method, $order);
}
if ($method->ativar_debito) {
$conteudo .= $this->getPagamentoDebito($method, $order);
}
if ($method->ativar_boleto) {
$conteudo .= $this->getPagamentoBoleto($method, $order);
}
$conteudo .= "
</div> <!-- pg_main -->
</div>
</div>
<br style='clear:both'/>
";
return $conteudo;
}
public function getRadioTermosPagseguro(){
/*
return "<input type='checkbox' name='radio_contract' value='1' class='radio_terms'/>
Por favor, leia e aceite os termos de <a href='https://www.pagseguro.com.br/checkout/pay/contrato' class='modal' rel=\"{handler: 'iframe', size: {x: 750, y: 450}}\">gestão de pagamentos do Pagseguro.</a>";
*/
return;
}
public function getPagamentoCartao($method, $order) {
$order_total = round($order['details']['BT']->order_total,2);
$cartoes_aceitos = array();
$method->cartao_visa?$cartoes_aceitos[] = 'visa':'';
$method->cartao_master==1?$cartoes_aceitos[] = 'master':'';
$method->cartao_elo==1?$cartoes_aceitos[] = 'elo':'';
$method->cartao_diners==1?$cartoes_aceitos[] = 'diners':'';
$method->cartao_amex==1?$cartoes_aceitos[] = 'amex':'';
$method->cartao_hipercard==1?$cartoes_aceitos[] = 'hipercard':'';
$method->cartao_aura==1?$cartoes_aceitos[] = 'aura':'';
$html_radio_termos_pagseguro = $this->getRadioTermosPagseguro();
// campo telefone
$bt_comprador = $order['details']['BT'];
$phone = $bt_comprador->phone_1;
// cpf, data de nascimento
$campo_cpf = $method->campo_cpf;
$campo_cep = $method->campo_cep;
$campo_cnpj = $method->campo_cnpj;
$campo_data_nascimento = $method->campo_data_nascimento;
// campo data de nascimento
$birthdate = $this->formataData((isset($bt_comprador->$campo_data_nascimento) and !empty($bt_comprador->$campo_data_nascimento))?$bt_comprador->$campo_data_nascimento:'');
$cpf = $this->formataCPF((isset($bt_comprador->$campo_cpf) and !empty($bt_comprador->$campo_cpf))?$bt_comprador->$campo_cpf:'');
$campo_nome = $method->campo_nome;
$campo_sobrenome = $method->campo_sobrenome;
$nome = $bt_comprador->$campo_nome.' '.$bt_comprador->$campo_sobrenome;
$html = '<!-- tabcontent cartao -->
<div class="tabcontent tab_cc" id="tabcartao">
<div id="div_cartao" class="div_pgtos">
<div>
<h4 class="titulo_toggle">
<input type="radio" name="toggle_pagamentos" value="cartao" id="toggle_cartao" onclick="efeito_divs(\'div_cartao\')" style="float:left" class="radiofield"/>
<label for="toggle_cartao">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_CREDIT_CARD').'</label>
</h4>
</div>
<form name="pagamento_cartao" onsubmit="return submeter_cartao(this)" id="pagamento_cartao" target="iframepagseguro">
<ul>
<!-- cartões -->
<li class="titulo_toggle"><ul class="cards cartoes">';
foreach($cartoes_aceitos as $v) {
$html .= "<li><label for=\"tipo_".$v."\"><input type=\"radio\" class=\"radiofield\" name=\"tipo_pgto\" style=\"width:15px\" id=\"tipo_".$v."\" value=\"".$v."\" onclick=\"show_parcelas(this.value)\" /><img src=\"".$this->url_imagens.$v."_cartao.jpg\" border=\"0\" align=\"absmiddle\" onclick=\"marcar_radio('tipo_".$v."');show_parcelas('".$v."');\" /></label></li>";
}
$html .= '
</ul>
<div class="conteudo_pagseguro" style="display:none">
<div class="subtitle">
Escolha em quantas vezes quer pagar
</div>
<!-- select parcelas -->
<div class="pg_row">
<div class="pgc1-2">
<ul>';
$html .= ($method->cartao_visa==1)?$this->calculaParcelasCredito($method, $order_total,'div_visa'):'';
$html .= ($method->cartao_master==1)?$this->calculaParcelasCredito($method, $order_total,'div_master'):'';
$html .= ($method->cartao_elo==1)?$this->calculaParcelasCredito($method, $order_total,'div_elo'):'';
$html .= ($method->cartao_diners==1)?$this->calculaParcelasCredito($method, $order_total,'div_diners',1):'';
$html .= ($method->cartao_amex==1)?$this->calculaParcelasCredito($method, $order_total,'div_amex'):'';
$html .= ($method->cartao_hipercard==1)?$this->calculaParcelasCredito($method, $order_total,'div_hipercard'):'';
$html .= ($method->cartao_aura==1)?$this->calculaParcelasCredito($method, $order_total,'div_aura'):'';
$html .= "</ul>";
$html .=' </div>
</div>
<!-- end select parcelas de credito -->
';
$html .= ' <!-- pg_row -->
<div class="pg_row">
<div class="pgc1-2">
<div class="bgcartao">';
$html .= '<div class="pgi_cartao">
<label for="card_number">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_CARD_NUMBER').'</label>
<input name="card_number" id="card_number" type="text" maxlength="19" />
</div>';
$html .= '<div class="pgi_datavalidade">
<label for="expiry_date">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_EXPIRY_DATE').'</label>
<input name="expiry_date" id="expiry_date" maxlength="5" type="text" size="5" />
</div>
<div class="pgi_cvv">
<label for="cvv">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_VERIFY_NUMBER2').'</label>
<input name="cvv" id="cvv" maxlength="4" type="text" size="3" />
<a class="info_cvv icquestion" href="#creditCardCvvInfo" rel="tooltip-0" title="código de segurança"></a>
</div>
<br class="clear" />
</div>
<!-- end bgcartao -->
</div>
<!-- end pgc1-2 -->';
$html .= ' <!-- end pgc2-1 -->
<div class="pgc2-1">
<div class="pg_dadosp">
<div class="pgi_titular">
<label for="name_on_card">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_CARD_OWNER').'</label>
<input name="name_on_card" id="name_on_card" type="text" value="'.$nome.'" />
</div>
<div class="pgi_cpf">
<label for="cpf">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_CPF').'</label>
<input name="cpf" id="cpf_titular" type="text" value="'.$cpf.'" />
</div>
<div class="pgi_datanasc">
<label for="birthdate">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_BIRTHDATE').'</label>
<input name="birthdate" id="birthdate" maxlength="11" type="text" size="8" value="'.$birthdate.'" />
</div>
<div class="pgi_telefone">
<label for="phone">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_PHONE').'</label>
<input name="phone" id="phone" maxlength="15" type="text" size="8" value="'.$phone.'" />
</div>
</div>
<!-- end pg_dadosp -->
</div>
<!-- end pgc2-1 -->';
$html .='
</div>
<!-- end pg_row -->
<div class="pg_row">
<div class="pgcenter">
'.$html_radio_termos_pagseguro.'
<input type="submit" class="buttonPagsegurotransparente btn-pagar" value="'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_BUTTON').'" />
</div>
</div>
</div><!-- end conteudo_pagseguro -->
</form>
</div>
</div><!-- end tabcontent tab_cc -->
';
return $html;
}
public function getPagamentoBoleto($method, $order) {
$order_total = round($order['details']['BT']->order_total,2);
$html_radio_termos_pagseguro = $this->getRadioTermosPagseguro();
$html = '
<div class="tabcontent tab_cc" id="tabboleto">
<div id="div_boleto" class="div_pgtos">
<div>
<h4 class="titulo_toggle ">
<input type="radio" name="toggle_pagamentos" id="toggle_boleto" value="boleto" onclick="efeito_divs(\'div_boleto\')" style="float:left" class="radiofield"/>
<label for="toggle_boleto">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_CREDIT_BOLETO').'</label>
</h4>
</div>
<form name="pagamento_boleto" onsubmit="return submeter_boleto(this)" id="pagamento_boleto" target="iframepagseguro">
<ul>
<li>
<ul class="cards cartoes">
<li>
<label for="tipo_boletobancario">
<input type="radio" name="tipo_pgto_boleto" style="width:15px" id="tipo_boletobancario" value="1" class="radiofield"/>
<img src="'.$this->url_imagens.'boleto_bancario.jpg" border="0" align="absmiddle" onclick="marcar_radio(\'tipo_boletobancario\');" />
</label>
</li>
</ul>
</li>
</ul>
<br style="clear:both"/>
<div class="conteudo_pagseguro" style="display:none">
<!-- parcelas debito -->
<ul>';
$html .= $this->calculaParcelasDebitoBoleto($method, $order_total,'div_boletobancario');
$html .= '
</ul>
';
$html .= '<div class="pg_row">
<div class="pgcenter">
'.$html_radio_termos_pagseguro.'
<input type="submit" class="buttonPagsegurotransparente btn-pagar" value="'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_BUTTON_BOLETO').'" />
</div>
</div>';
$html .= '
</div>
</form>
</div>
</div>';
return $html;
}
public function getPagamentoDebito($method, $order) {
$order_total = round($order['details']['BT']->order_total,2);
$debitos_aceitos = array();
$method->debito_bb?$debitos_aceitos[] = 'bb':'';
$method->debito_bradesco==1?$debitos_aceitos[] = 'bradesco':'';
$method->debito_banrisul==1?$debitos_aceitos[] = 'banrisul':'';
$method->debito_itau==1?$debitos_aceitos[] = 'itau':'';
$method->debito_hsbc==1?$debitos_aceitos[] = 'hsbc':'';
$html_radio_termos_pagseguro = $this->getRadioTermosPagseguro();
$html ='
<div class="tabcontent tab_cc" id="tabdebito">
<div id="div_debito" class="div_pgtos">
<div>
<h4 class="titulo_toggle">
<input type="radio" name="toggle_pagamentos" id="toggle_debito" value="debito" onclick="efeito_divs(\'div_debito\')" style="float:left" class="radiofield"/>
<label for="toggle_debito">'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_DEBIT').'</label>
</h4>
</div>
<form name="pagamento_debito" onsubmit="return submeter_debito(this)" id="pagamento_debito" target="iframepagseguro">
<ul>
<li>
<ul class="cards cartoes">';
foreach($debitos_aceitos as $v) {
$html .= "<li><label for=\"tipo_".$v."\"><input type=\"radio\" class=\"radiofield\" name=\"tipo_pgto_debito\" style=\"width:15px\" id=\"tipo_".$v."\" value=\"".$v."\" /><img src=\"".$this->url_imagens.$v."_debito.jpg\" border=\"0\" align=\"absmiddle\" /></label></li>";
}
$html .= "
</ul>
</li>
</ul>
<br style='clear:both'/>
<div class='conteudo_pagseguro' style='display:none'>
<li>
<!-- parcelas debito -->
<ul>";
$html .= $this->calculaParcelasDebitoBoleto($method, $order_total,'div_debitobancario');
$html .= "
</ul>
</li>
";
$html .= '<div class="pg_row">
<div class="pgcenter">
'.$html_radio_termos_pagseguro.'
<input type="submit" class="buttonPagsegurotransparente btn-pagar" value="'.JText::_('VMPAYMENT_PAGSEGUROTRANSPARENTE_TRANSACTION_BUTTON').'" />
</div>
</div>';
$html .= "
</div>
</form>
</div>
</div>
";
return $html;
}
public function getSessionIdPagseguro($method) {
$codigo = $this->getSessionidPagSeguro_request($method);
return $codigo;
/*
for ($i=0; $i < 2; $i++) {
$codigo = $this->getSessionidPagSeguro_request($method);
if (!empty($codigo)) {
return $codigo;
}
}
return false;
*/
}
public function getSessionidPagSeguro_request($method) {
$email_pagseguro = $this->getSellerEmail($method);
$token_pagseguro = $this->getToken($method);
$url_ws_pagseguro = $this->getUrlWsPagseguro($method);
# /v2/sessions?email={email}&token={token}
// $url_completa = $url_ws_pagseguro.'/v2/sessions?email='.$email_pagseguro.'&token='.$token_pagseguro;
if ($method->modo_debug) {
echo $url_ws_pagseguro.'/v2/sessions?email='.$email_pagseguro.'&token='.$token_pagseguro;
}
$params = array();
$params['email'] = $email_pagseguro;
$params['token'] = $token_pagseguro;
if(function_exists('curl_exec')) {
ob_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url_ws_pagseguro.'/v2/sessions');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params, '', '&'));
// curl_setopt($ch, CURLOPT_HTTPHEADER, $oAuth);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_exec($ch);
$resposta = ob_get_contents();
ob_end_clean();
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
} else if(ini_get('allow_url_fopen') == '1') {
$postdata = http_build_query(
array(
'email' => $email_pagseguro,
'token' => $token_pagseguro
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$resposta = file_get_contents($url_ws_pagseguro.'/v2/sessions', false, $context);
} else {
die('Para o funcionamento do módulo, é necessário CURL ou file_get_contents ativo');
}
if ($method->modo_debug) {
print_r($resposta);
}
$xml = new DomDocument();
$dom = $xml->loadXML($resposta);
$codigo = $xml->getElementsByTagName('id')->item(0)->nodeValue;
return $codigo;
}
// grava os dados do retorno da Transação
public function gravaDadosRetorno($method, $status="", $msg_status="", $url_redirecionar='', $tipo_pagamento="", $forma_pagamento="", $parcela_selecionada="") {
$timestamp = date('Y-m-d').'T'.date('H:i:s');
// recupera as informações do pagamento
$db = JFactory::getDBO();
$query = 'SELECT payment_name, payment_order_total, payment_currency, virtuemart_paymentmethod_id
FROM `' . $this->_tablename . '`
WHERE order_number = "'.$this->order_number.'"';
$db->setQuery($query);
$pagamento = $db->loadObjectList();
$type_transaction = $tipo_pagamento.' - '.$forma_pagamento.($parcela_selecionada!=''?' - '.$parcela_selecionada.'x ':'');
// $log = $this->timestamp.'|'.$this->transactionCode.'|'.$msg_status.'|'.$tipo_pagamento.'|'.$forma_pagamento.'|'.$pagamento[0]->payment_order_total;
$log = $timestamp.'|'.$this->transactionCode.'|'.$msg_status.'|'.$tipo_pagamento.'|'.$forma_pagamento.'|'.$pagamento[0]->payment_order_total;
if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber ($this->order_number))) {
return NULL;
}
$response_fields = array();
$response_fields['virtuemart_order_id'] = $virtuemart_order_id;
$response_fields['transactionCode'] = $this->transactionCode;
$response_fields['type_transaction'] = $type_transaction;
$response_fields['log'] = $log;
$response_fields['status'] = $status;
$response_fields['msg_status'] = $msg_status;
$response_fields['order_number'] = $this->order_number;
if ($url_redirecionar != '') {
$response_fields['url_redirecionar'] = $url_redirecionar;
}
$response_fields['payment_name'] = $pagamento[0]->payment_name;
$response_fields['payment_currency'] = $pagamento[0]->payment_currency;
$response_fields['payment_order_total'] = $pagamento[0]->payment_order_total;
$response_fields['virtuemart_paymentmethod_id'] = $pagamento[0]->virtuemart_paymentmethod_id;
$this->storePSPluginInternalData($response_fields, 'virtuemart_order_id', true);
}
function plgVmgetPaymentCurrency($virtuemart_paymentmethod_id, &$paymentCurrencyId) {
if (!($method = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
return null; // Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return false;
}
$this->getPaymentCurrency($method);
$paymentCurrencyId = $method->payment_currency;
}
/**
* Display stored payment data for an order
*
*/
function plgVmOnShowOrderBEPayment($virtuemart_order_id, $virtuemart_payment_id) {
if (!$this->selectedThisByMethodId($virtuemart_payment_id)) {
return null; // Another method was selected, do nothing
}
$db = JFactory::getDBO();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;
$db->setQuery($q);
if (!($paymentTable = $db->loadObject())) {
vmWarn(500, $q . " " . $db->getErrorMsg());
return '';
}
$this->getPaymentCurrency($paymentTable);
$html = '<table class="adminlist">' . "\n";
$html .=$this->getHtmlHeaderBE();
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_PAYMENT_NAME', 'Pagseguro API Transparente');
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_PAYMENT_DATE', $paymentTable->modified_on);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_CODIGO_PAGSEGUROTRANSPARENTE', $paymentTable->transactionCode);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_STATUS', $paymentTable->status . ' - ' . $paymentTable->msg_status);
if (!empty($paymentTable->cofre))
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_COFRE', $paymentTable->cofre);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_TOTAL_CURRENCY', $paymentTable->payment_order_total . ' ' . $paymentTable->payment_currency);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_TYPE_TRANSACTION', $paymentTable->type_transaction);
if (!empty($paymentTable->nome_titular_cartao))
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_NOME_TITULAR_CARTAO', $paymentTable->nome_titular_cartao);
if (!empty($paymentTable->nascimento_titular_cartao))
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_NASCIMENTO_TITULAR_CARTAO', $paymentTable->nascimento_titular_cartao);
if (!empty($paymentTable->telefone_titular_cartao))
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_TELEFONE_TITULAR_CARTAO', $paymentTable->telefone_titular_cartao);
if (!empty($paymentTable->cpf_titular_cartao))
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_CPF_TITULAR_CARTAO', $paymentTable->cpf_titular_cartao);
$html .= $this->getHtmlRowBE('PAGSEGUROTRANSPARENTE_LOG', $paymentTable->log);
$html .= '</table>' . "\n";
return $html;
}
function getCosts(VirtueMartCart $cart, $method, $cart_prices) {
if (preg_match('/%$/', $method->cost_percent_total)) {
$cost_percent_total = substr($method->cost_percent_total, 0, -1);
} else {
$cost_percent_total = $method->cost_percent_total;
}
return ($method->cost_per_transaction + ($cart_prices['salesPrice'] * $cost_percent_total * 0.01));
}
/**
* Check if the payment conditions are fulfilled for this payment method
* @author: Valerie Isaksen
*
* @param $cart_prices: cart prices
* @param $payment
* @return true: if the conditions are fulfilled, false otherwise
*
*/
protected function checkConditions($cart, $method, $cart_prices) {
// $params = new JParameter($payment->payment_params);
$address = (($cart->ST == 0) ? $cart->BT : $cart->ST);
$amount = $cart_prices['salesPrice'];
$amount_cond = ($amount >= $method->min_amount AND $amount <= $method->max_amount
OR
($method->min_amount <= $amount AND ($method->max_amount == 0) ));
if (!$amount_cond) {
return false;
}
$countries = array();
if (!empty($method->countries)) {
if (!is_array($method->countries)) {
$countries[0] = $method->countries;
} else {
$countries = $method->countries;
}
}
// probably did not gave his BT:ST address
if (!is_array($address)) {
$address = array();
$address['virtuemart_country_id'] = 0;
}
if (!isset($address['virtuemart_country_id']))
$address['virtuemart_country_id'] = 0;
if (count($countries) == 0 || in_array($address['virtuemart_country_id'], $countries) || count($countries) == 0) {
return true;
}
return false;
}
/*
* We must reimplement this triggers for joomla 1.7
*/
/**
* Create the table for this plugin if it does not yet exist.
* This functions checks if the called plugin is active one.
* When yes it is calling the pagsegurotransparente method to create the tables
* @author Valérie Isaksen
*
*/
function plgVmOnStoreInstallPaymentPluginTable($jplugin_id) {
return $this->onStoreInstallPluginTable($jplugin_id);
}
/**
* This event is fired after the payment method has been selected. It can be used to store
* additional payment info in the cart.
*
* @author Max Milbers
* @author Valérie isaksen
*
* @param VirtueMartCart $cart: the actual cart
* @return null if the payment was not selected, true if the data is valid, error message if the data is not vlaid
*
*/
public function plgVmOnSelectCheckPayment(VirtueMartCart $cart) {
return $this->OnSelectCheck($cart);
}
/**
* plgVmDisplayListFEPayment
* This event is fired to display the pluginmethods in the cart (edit shipment/payment) for exampel
*
* @param object $cart Cart object
* @param integer $selected ID of the method selected
* @return boolean True on succes, false on failures, null when this plugin was not selected.
* On errors, JError::raiseWarning (or JError::raiseError) must be used to set a message.
*
* @author Valerie Isaksen
* @author Max Milbers
*/
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) {
return $this->displayListFE($cart, $selected, $htmlIn);
}
/*
* plgVmonSelectedCalculatePricePayment
* Calculate the price (value, tax_id) of the selected method
* It is called by the calculator
* This function does NOT to be reimplemented. If not reimplemented, then the default values from this function are taken.
* @author Valerie Isaksen
* @cart: VirtueMartCart the current cart
* @cart_prices: array the new cart prices
* @return null if the method was not selected, false if the shiiping rate is not valid any more, true otherwise
*
*
*/
public function plgVmonSelectedCalculatePricePayment(VirtueMartCart $cart, array &$cart_prices, &$cart_prices_name) {
return $this->onSelectedCalculatePrice($cart, $cart_prices, $cart_prices_name);
}
/**
* plgVmOnCheckAutomaticSelectedPayment
* Checks how many plugins are available. If only one, the user will not have the choice. Enter edit_xxx page
* The plugin must check first if it is the correct type
* @author Valerie Isaksen
* @param VirtueMartCart cart: the cart object
* @return null if no plugin was found, 0 if more then one plugin was found, virtuemart_xxx_id if only one plugin is found
*
*/
function plgVmOnCheckAutomaticSelectedPayment(VirtueMartCart $cart, array $cart_prices = array()) {
return $this->onCheckAutomaticSelected($cart, $cart_prices);
}
/**
* This method is fired when showing the order details in the frontend.
* It displays the method-specific data.
*
* @param integer $order_id The order ID
* @return mixed Null for methods that aren't active, text (HTML) otherwise
* @author Max Milbers
* @author Valerie Isaksen
*/
public function plgVmOnShowOrderFEPayment($virtuemart_order_id, $virtuemart_paymentmethod_id, &$payment_name) {
$orderModel = VmModel::getModel('orders');
$orderDetails = $orderModel->getOrder($virtuemart_order_id);
if (!($method = $this->getVmPluginMethod($orderDetails['details']['BT']->virtuemart_paymentmethod_id))) {
return false;
}
if (!$this->selectedThisByMethodId ($virtuemart_paymentmethod_id)) {
return NULL;
} // Another method was selected, do nothing
$view = JRequest::getVar('view');
if ($view == 'orders' and $orderDetails['details']['BT']->virtuemart_paymentmethod_id == $virtuemart_paymentmethod_id) {
$orderModel = VmModel::getModel('orders');
$orderDetails = $orderModel->getOrder($virtuemart_order_id);
$order_id = $orderDetails['details']['BT']->order_number;
$virtuemart_paymentmethod_id = $orderDetails['details']['BT']->virtuemart_paymentmethod_id;
// consulta se há código de transação no pedido
$db = JFactory::getDBO();
$query = 'SELECT transactionCode
FROM `' . $this->_tablename . '`
WHERE order_number = "'.$order_id.'"';
$db->setQuery($query);
$dados_pagseguro = $db->loadObjectList();
if ($method->transacao_em_andamento == $orderDetails['details']['BT']->order_status) {
JHTML::_('behavior.modal');
$url_recibo = JRoute::_('index.php?option=com_virtuemart&view=pluginresponse&tmpl=component&task=pluginresponsereceived&on='.$order_id.'&pm='.$virtuemart_paymentmethod_id);
$html = '<br /><b><a href="'.$url_recibo.'" class="modal" rel="{size: {x: 700, y: 500}, handler:\'iframe\'}" >Clique aqui para visualizar o status detalhado da transação no Pagseguro</a></b> <br /><br />';
JFactory::getApplication()->enqueueMessage(
$html, 'Prazos para aprovação do Pagamento via pagseguro: Cartão e Boleto 24h úteis Débito Online 2h.'
);
} else if (
($method->transacao_cancelada == $orderDetails['details']['BT']->order_status)
or
($method->transacao_em_andamento == $orderDetails['details']['BT']->order_status and isset($dados_pagseguro[0]->transactionCode) and $dados_pagseguro[0]->transactionCode == "")
) {
vmJsApi::js('facebox');
vmJsApi::css('facebox');
$this->order_id = $orderDetails['details']['BT']->order_number;
$url = JURI::root();
// carrega os js e css
$doc = JFactory::getDocument();
$url_lib = $url. '/' .'plugins'. '/' .'vmpayment'. '/' .'pagsegurotransparente'.'/';
$url_assets = $url_lib . 'assets'. '/';
$url_js = $url_assets . 'js'. '/';
$url_css = $url_assets . 'css'. '/';
$this->url_imagens = $url_lib . 'imagens'. '/';
// redirecionar dentro do componente para validar
$url_redireciona_pagsegurotransparente = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&task2=redirecionarPagseguroAPI&tmpl=component&pm='.$orderDetails['details']['BT']->virtuemart_paymentmethod_id."&order_number=".$this->order_id);
$url_pedidos = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=orders');
if ($method->url_redirecionamento) {
$url_recibo_pagsegurotransparente = JROUTE::_($method->url_redirecionamento);
} else {
$url_recibo_pagsegurotransparente = JROUTE::_(JURI::root() .'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on='.$this->order_id.'&pm='.$orderDetails['details']['BT']->virtuemart_paymentmethod_id);
}
$session_id_pagseguro = $this->getSessionIdPagseguro($method);
if (!$session_id_pagseguro) {
JFactory::getApplication()->enqueueMessage( 'Erro ao configurar e-mail e token do PagSeguro', 'error' );
return false;
}
$url_js_directpayment = $this->getUrlJsPagseguro($method);
$doc->addCustomTag('
<script type="text/javascript" src="'.$url_js_directpayment.'/pagseguro/api/v2/checkout/pagseguro.directpayment.js"></script>
<script type="text/javascript">
PagSeguroDirectPayment.setSessionId(\''.$session_id_pagseguro.'\');
jQuery.noConflict();
var redireciona_pagseguro = "'.$url_redireciona_pagsegurotransparente.'";
var url_pedidos = "'.$url_pedidos.'";
var url_recibo_pagseguro = "'.$url_recibo_pagsegurotransparente.'";
var url_assets_pagseguro = "'.$url_assets.'";
var order_total = '.round($orderDetails['details']['BT']->order_total,2).';
var max_parcela_sem_juros = '.$method->max_parcela_sem_juros.';
</script>
<script type="text/javascript" language="javascript" src="'.$url_js.'jquery.mask.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="'.$url_js.'pagsegurotransparente.js"></script>
<script type="text/javascript" language="javascript" src="'.$url_js.'jquery.card.js"></script>
<script type="text/javascript" language="javascript" src="'.$url_js.'validar_cartao.js"></script>
'.($load_squeezebox!=0?$sq_js:'').'
<link href="'.$url_css.'css_pagamento.css" rel="stylesheet" type="text/css"/>
<link href="'.$url_css.'style.css" rel="stylesheet" type="text/css"/>
'.($load_squeezebox!=0?$sq_css:'').'
');
$html .= $this->Pagsegurotransparente_mostraParcelamento($method, $orderDetails);
echo $html;
}
}
$this->onShowOrderFE($virtuemart_order_id, $virtuemart_paymentmethod_id, $payment_name);
}
/**
* This event is fired during the checkout process. It can be used to validate the
* method data as entered by the user.
*
* @return boolean True when the data was valid, false otherwise. If the plugin is not activated, it should return null.
* @author Max Milbers
*
* public function plgVmOnCheckoutCheckDataPayment( VirtueMartCart $cart) {
* return null;
* }
*/
/**
* This method is fired when showing when priting an Order
* It displays the the payment method-specific data.
*
* @param integer $_virtuemart_order_id The order ID
* @param integer $method_id method used for this order
* @return mixed Null when for payment methods that were not selected, text (HTML) otherwise
* @author Valerie Isaksen
*/
function plgVmonShowOrderPrintPayment($order_number, $method_id) {
return $this->onShowOrderPrint($order_number, $method_id);
}
function plgVmDeclarePluginParamsPayment($name, $id, &$data) {
return $this->declarePluginParams('payment', $name, $id, $data);
}
function plgVmSetOnTablePluginParamsPayment($name, $id, &$table) {
return $this->setOnTablePluginParams($name, $id, $table);
}
//Notice: We only need to add the events, which should work for the specific plugin, when an event is doing nothing, it should not be added
/**