-
Notifications
You must be signed in to change notification settings - Fork 77
/
wc-gateway-paypal-pro-angelleye.php
2366 lines (2210 loc) · 133 KB
/
wc-gateway-paypal-pro-angelleye.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
/**
* WC_Gateway_PayPal_Pro class.
*
* @extends WC_Payment_Gateway
*/
class WC_Gateway_PayPal_Pro_AngellEYE extends WC_Payment_Gateway_CC {
/**
* Store client
*/
private $centinel_client = false;
public $customer_id;
public $PayPal;
public $gateway;
public $liveurl;
public $testurl;
public $liveurl_3ds;
public $testurl_3ds;
public $available_card_types;
public $iso4217;
public $send_items_value;
public $send_items;
public $api_username ;
public $api_password;
public $api_signature;
public $testmode;
public $invoice_id_prefix;
public $error_email_notify;
public $error_display_type;
public $enable_3dsecure;
public $liability_shift;
public $debug;
public $payment_action;
public $subtotal_mismatch_behavior;
public $enable_notifyurl;
public $is_encrypt;
public $softdescriptor;
public $avs_cvv2_result_admin_email;
public $fraud_management_filters;
public $notifyurl;
public $enable_cardholder_first_last_name;
public $enable_tokenized_payments;
public $Force_tls_one_point_two;
public $credit_card_month_field;
public $credit_card_year_field;
public $pending_authorization_order_status;
public $successwithwarning_payment_response;
public $enable_google_recaptcha;
public $recaptcha_site_key;
public $recaptcha_secret_key;
public $calculation_angelleye;
/**
* __construct function.
*
* @access public
* @return void
*/
function __construct() {
$this->id = 'paypal_pro';
$this->method_title = __('PayPal Website Payments Pro (DoDirectPayment)', 'paypal-for-woocommerce');
$this->method_description = __('PayPal Website Payments Pro allows you to accept credit cards directly on your site without any redirection through PayPal. You host the checkout form on your own web server, so you will need an SSL certificate to ensure your customer data is protected.', 'paypal-for-woocommerce');
$this->has_fields = true;
$this->liveurl = 'https://api-3t.paypal.com/nvp';
$this->testurl = 'https://api-3t.sandbox.paypal.com/nvp';
$this->liveurl_3ds = 'https://paypal.cardinalcommerce.com/maps/txns.asp';
$this->testurl_3ds = 'https://centineltest.cardinalcommerce.com/maps/txns.asp';
$this->available_card_types = apply_filters('woocommerce_paypal_pro_available_card_types', array(
'GB' => array(
'Visa' => 'Visa',
'MasterCard' => 'MasterCard',
'Maestro' => 'Maestro/Switch',
'Solo' => 'Solo'
),
'US' => array(
'Visa' => 'Visa',
'MasterCard' => 'MasterCard',
'Discover' => 'Discover',
'AmEx' => 'American Express'
),
'CA' => array(
'Visa' => 'Visa',
'MasterCard' => 'MasterCard'
),
'AU' => array(
'Visa' => 'Visa',
'MasterCard' => 'MasterCard',
'Discover' => 'Discover',
'AmEx' => 'American Express'
)
));
$this->iso4217 = apply_filters('woocommerce_paypal_pro_iso_currencies', array(
'AUD' => '036',
'CAD' => '124',
'CZK' => '203',
'DKK' => '208',
'EUR' => '978',
'HUF' => '348',
'JPY' => '392',
'NOK' => '578',
'NZD' => '554',
'PLN' => '985',
'GBP' => '826',
'SGD' => '702',
'SEK' => '752',
'CHF' => '756',
'USD' => '840'
));
// Load the form fields
$this->init_form_fields();
// Load the settings.
$this->init_settings();
// Get setting values
$this->send_items = 'yes' === $this->get_option('send_items', 'yes');
$this->title = $this->get_option('title');
$this->description = $this->get_option('description');
$this->enabled = $this->get_option('enabled');
$this->api_username = $this->get_option('api_username');
$this->api_password = $this->get_option('api_password');
$this->api_signature = $this->get_option('api_signature');
$this->testmode = 'yes' === $this->get_option('testmode', 'no');
if( $this->testmode == false ) {
if (!class_exists('AngellEYE_Utility')) {
require_once( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/angelleye-includes/angelleye-utility.php' );
}
$this->testmode = AngellEYE_Utility::angelleye_paypal_for_woocommerce_is_set_sandbox_product();
}
$this->invoice_id_prefix = $this->get_option('invoice_id_prefix');
$this->error_email_notify = $this->get_option('error_email_notify');
$this->error_display_type = $this->get_option('error_display_type');
$this->enable_3dsecure = 'yes' === $this->get_option('enable_3dsecure', 'no');
$this->liability_shift = 'yes' === $this->get_option('liability_shift', 'no');
$this->debug = 'yes' === $this->get_option('debug', 'no');
$this->payment_action = $this->get_option('payment_action', 'Sale');
if($this->send_items === false) {
$this->subtotal_mismatch_behavior = 'drop';
} else {
$this->subtotal_mismatch_behavior = $this->get_option('subtotal_mismatch_behavior', 'add');
}
$this->enable_notifyurl = $this->get_option('enable_notifyurl', 'no');
$this->is_encrypt = $this->get_option('is_encrypt', 'no');
$this->softdescriptor = $this->get_option('softdescriptor', '');
$this->avs_cvv2_result_admin_email = 'yes' === $this->get_option('avs_cvv2_result_admin_email', 'no');
$this->fraud_management_filters = $this->get_option('fraud_management_filters', 'place_order_on_hold_for_further_review');
$this->notifyurl = '';
if ($this->enable_notifyurl == 'yes') {
$this->notifyurl = $this->get_option('notifyurl');
if (isset($this->notifyurl) && !empty($this->notifyurl)) {
$this->notifyurl = str_replace('&', '&', $this->notifyurl);
}
}
$this->enable_cardholder_first_last_name = 'yes' === $this->get_option('enable_cardholder_first_last_name', 'no');
// 3DS
if ($this->enable_3dsecure) {
$this->centinel_pid = $this->get_option('centinel_pid');
$this->centinel_mid = $this->get_option('centinel_mid');
$this->centinel_pwd = $this->get_option('centinel_pwd');
if (empty($this->centinel_pid) || empty($this->centinel_mid) || empty($this->centinel_pwd))
$this->enable_3dsecure = false;
$this->centinel_url = $this->testmode == false ? $this->liveurl_3ds : $this->testurl_3ds;
}
//fix ssl for image icon
$this->icon = $this->get_option('card_icon', plugins_url('/assets/images/cards.png', plugin_basename(dirname(__FILE__))));
if ( is_ssl() || 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) ) {
$this->icon = preg_replace("/^http:/i", "https:", $this->icon);
}
$this->icon = apply_filters('woocommerce_paypal_pro_icon', $this->icon);
$this->supports = array(
'subscriptions',
'products',
'refunds',
'subscription_cancellation',
'subscription_reactivation',
'subscription_suspension',
'subscription_amount_changes',
'subscription_payment_method_change', // Subs 1.n compatibility.
'subscription_payment_method_change_customer',
'subscription_payment_method_change_admin',
'subscription_date_changes',
'multiple_subscriptions',
'add_payment_method',
);
$this->enable_tokenized_payments = $this->get_option('enable_tokenized_payments', 'no');
if($this->enable_tokenized_payments == 'yes') {
$this->supports = array_merge($this->supports, array('add_payment_method','tokenization'));
}
$this->Force_tls_one_point_two = get_option('Force_tls_one_point_two', 'no');
$this->credit_card_month_field = $this->get_option('credit_card_month_field', 'names');
$this->credit_card_year_field = $this->get_option('credit_card_year_field', 'four_digit');
$this->pending_authorization_order_status = $this->get_option('pending_authorization_order_status', 'On Hold');
$this->successwithwarning_payment_response = $this->get_option('successwithwarning_payment_response', 'ignore_warnings_and_proceed_as_usual');
if ($this->testmode == true) {
$this->api_username = $this->get_option('sandbox_api_username');
$this->api_password = $this->get_option('sandbox_api_password');
$this->api_signature = $this->get_option('sandbox_api_signature');
}
$this->enable_google_recaptcha = 'yes' === $this->get_option('enable_google_recaptcha', 'no');
$this->recaptcha_site_key = $this->get_option('recaptcha_site_key', '');
$this->recaptcha_secret_key = $this->get_option('recaptcha_secret_key', '');
if($this->enable_google_recaptcha) {
if(empty($this->recaptcha_site_key) || empty($this->recaptcha_secret_key)) {
$this->enable_google_recaptcha = false;
}
}
// Maestro
if (!$this->enable_3dsecure) {
unset($this->available_card_types['GB']['Maestro']);
}
// Hooks
add_action('woocommerce_api_wc_gateway_paypal_pro_angelleye', array($this, 'handle_3dsecure'));
/* 2.0.0 */
add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
add_filter('woocommerce_settings_api_sanitized_fields_' . $this->id, array($this, 'angelleye_paypal_pro_encrypt_gateway_api'), 10, 1);
if ($this->enable_cardholder_first_last_name) {
add_action('woocommerce_credit_card_form_start', array($this, 'angelleye_woocommerce_credit_card_form_start'), 10, 1);
}
add_filter('woocommerce_credit_card_form_fields', array($this, 'angelleye_paypal_pro_credit_card_form_fields'), 10, 2);
if( $this->avs_cvv2_result_admin_email ) {
add_action( 'woocommerce_email_before_order_table', array( $this, 'angelleye_paypal_pro_email_instructions' ), 10, 3 );
}
$this->customer_id;
if (class_exists('WC_Gateway_Calculation_AngellEYE')) {
$this->calculation_angelleye = new WC_Gateway_Calculation_AngellEYE();
} else {
require_once( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/classes/wc-gateway-calculations-angelleye.php' );
$this->calculation_angelleye = new WC_Gateway_Calculation_AngellEYE();
}
do_action( 'angelleye_paypal_for_woocommerce_multi_account_api_' . $this->id, $this, null, null );
if( $this->enable_google_recaptcha ) {
add_action('angelleye_pfw_add_google_recaptcha', array($this, 'own_angelleye_pfw_add_google_recaptcha'));
}
}
/**
* Initialise Gateway Settings Form Fields
*/
function init_form_fields() {
$this->send_items_value = ! empty( $this->settings['send_items'] ) && 'yes' === $this->settings['send_items'] ? 'yes' : 'no';
$this->send_items = 'yes' === $this->send_items_value;
$this->form_fields = array(
'enabled' => array(
'title' => __('Enable/Disable', 'paypal-for-woocommerce'),
'label' => __('Enable PayPal Pro', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => '',
'default' => 'no'
),
'title' => array(
'title' => __('Title', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('This controls the title which the user sees during checkout.', 'paypal-for-woocommerce'),
'default' => __('Credit card', 'paypal-for-woocommerce')
),
'description' => array(
'title' => __('Description', 'paypal-for-woocommerce'),
'type' => 'textarea',
'description' => __('This controls the description which the user sees during checkout.', 'paypal-for-woocommerce'),
'default' => __('Pay with your credit card', 'paypal-for-woocommerce')
),
'testmode' => array(
'title' => __('Test Mode', 'paypal-for-woocommerce'),
'label' => __('Enable PayPal Sandbox/Test Mode', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Place the payment gateway in development mode.', 'paypal-for-woocommerce'),
'default' => 'no'
),
'sandbox_api_username' => array(
'title' => __('Sandbox API Username', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Create sandbox accounts and obtain API credentials from within your
<a href="http://developer.paypal.com">PayPal developer account</a>.', 'paypal-for-woocommerce'),
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'sandbox_api_password' => array(
'title' => __('Sandbox API Password', 'paypal-for-woocommerce'),
'type' => 'password',
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'sandbox_api_signature' => array(
'title' => __('Sandbox API Signature', 'paypal-for-woocommerce'),
'type' => 'password',
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'api_username' => array(
'title' => __('Live API Username', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Get your live account API credentials from your PayPal account profile <br />or by using
<a target="_blank" href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run">this tool</a>.', 'paypal-for-woocommerce'),
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'api_password' => array(
'title' => __('Live API Password', 'paypal-for-woocommerce'),
'type' => 'password',
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'api_signature' => array(
'title' => __('Live API Signature', 'paypal-for-woocommerce'),
'type' => 'password',
'default' => '',
'custom_attributes' => array( 'autocomplete' => 'new-password'),
),
'payment_action' => array(
'title' => __('Payment Action', 'paypal-for-woocommerce'),
'label' => __('Whether to process as a Sale or Authorization.', 'paypal-for-woocommerce'),
'description' => __('Sale will capture the funds immediately when the order is placed. Authorization will authorize the payment but will not capture the funds.'),
'type' => 'select',
'css' => 'max-width:150px;',
'class' => 'wc-enhanced-select',
'options' => array(
'Sale' => 'Sale',
'Authorization' => 'Authorization',
),
'default' => 'Sale'
),
'3dsecure' => array(
'title' => __( '3DSecure Settings', 'paypal-for-woocommerce' ),
'type' => 'title',
'description' => '',
),
'enable_3dsecure' => array(
'title' => __('3DSecure', 'paypal-for-woocommerce'),
'label' => __('Enable 3DSecure', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Allows UK merchants to pass 3-D Secure authentication data to PayPal for debit and credit cards. Updating your site with 3-D Secure enables your participation in the Verified by Visa and MasterCard SecureCode programs. (Required to accept Maestro)', 'paypal-for-woocommerce'),
'default' => 'no'
),
'centinel_pid' => array(
'title' => __('Centinel PID', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('If enabling 3D Secure, enter your Cardinal Centinel Processor ID.', 'paypal-for-woocommerce'),
'default' => ''
),
'centinel_mid' => array(
'title' => __('Centinel MID', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('If enabling 3D Secure, enter your Cardinal Centinel Merchant ID.', 'paypal-for-woocommerce'),
'default' => ''
),
'centinel_pwd' => array(
'title' => __('Transaction Password', 'paypal-for-woocommerce'),
'type' => 'password',
'description' => __('If enabling 3D Secure, enter your Cardinal Centinel Transaction Password.', 'paypal-for-woocommerce'),
'default' => ''
),
'liability_shift' => array(
'title' => __('Liability Shift', 'paypal-for-woocommerce'),
'label' => __('Require liability shift', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Only accept payments when liability shift has occurred.', 'paypal-for-woocommerce'),
'default' => 'no'
),
'advanced_options' => array(
'title' => __( 'Advanced options', 'paypal-for-woocommerce' ),
'type' => 'title',
'description' => '',
),
'invoice_id_prefix' => array(
'title' => __('Invoice ID Prefix', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Add a prefix to the invoice ID sent to PayPal. This can resolve duplicate invoice problems when working with multiple websites on the same PayPal account.', 'paypal-for-woocommerce'),
),
'card_icon' => array(
'title' => __('Card Icon', 'paypal-for-woocommerce'),
'type' => 'text',
'default' => plugins_url('/assets/images/cards.png', plugin_basename(dirname(__FILE__))),
'class' => 'button_upload',
),
'send_items' => array(
'title' => __('Send Item Details', 'paypal-for-woocommerce'),
'label' => __('Send line item details to PayPal', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.', 'paypal-for-woocommerce'),
'default' => 'yes'
),
'subtotal_mismatch_behavior' => array(
'title' => __( 'Subtotal Mismatch Behavior', 'paypal-for-woocommerce' ),
'type' => 'select',
'class' => 'wc-enhanced-select',
'description' => __( 'Internally, WC calculates line item prices and taxes out to four decimal places; however, PayPal can only handle amounts out to two decimal places (or, depending on the currency, no decimal places at all). Occasionally, this can cause discrepancies between the way WooCommerce calculates prices versus the way PayPal calculates them. If a mismatch occurs, this option controls how the order is dealt with so payment can still be taken.', 'paypal-for-woocommerce' ),
'default' => ($this->send_items) ? 'add' : 'drop',
'desc_tip' => true,
'options' => array(
'add' => __( 'Add another line item', 'paypal-for-woocommerce' ),
'drop' => __( 'Do not send line items to PayPal', 'paypal-for-woocommerce' ),
),
),
'error_email_notify' => array(
'title' => __('Error Email Notifications', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'label' => __('Enable admin email notifications for errors.', 'paypal-for-woocommerce'),
'default' => 'yes',
'description' => __('This will send a detailed error email to the WordPress site administrator if a PayPal API error occurs.', 'paypal-for-woocommerce')
),
'error_display_type' => array(
'title' => __('Error Display Type', 'paypal-for-woocommerce'),
'type' => 'select',
'label' => __('Display detailed or generic errors', 'paypal-for-woocommerce'),
'css' => 'max-width:150px;',
'class' => 'error_display_type_option, wc-enhanced-select',
'options' => array(
'detailed' => __('Detailed', 'paypal-for-woocommerce'),
'generic' => __('Generic', 'paypal-for-woocommerce')
),
'description' => __('Detailed displays actual errors returned from PayPal. Generic displays general errors that do not reveal details
and helps to prevent fraudulant activity on your site.', 'paypal-for-woocommerce')
),
'pending_authorization_order_status' => array(
'title' => __('Pending Authorization Order Status', 'paypal-for-woocommerce'),
'label' => __('Pending Authorization Order Status.', 'paypal-for-woocommerce'),
'description' => __('Pending Authorization Order Status.'),
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array(
'On Hold' => 'On Hold',
'Processing' => 'Processing'
),
'default' => 'On Hold',
'desc_tip' => true,
),
'successwithwarning_payment_response' => array(
'title' => __('SuccessWithWarning Payment Response', 'paypal-for-woocommerce'),
'label' => '',
'description' => __('Choose how you would like to handle orders when Payment Response is SuccessWithWarning.', 'paypal-for-woocommerce'),
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array(
'ignore_warnings_and_proceed_as_usual' => __('Ignore warnings and proceed as usual.', 'paypal-for-woocommerce'),
'place_order_on_hold_for_further_review' => __('Place order On Hold for further review.', 'paypal-for-woocommerce'),
),
'default' => 'ignore_warnings_and_proceed_as_usual',
'desc_tip' => true,
),
'enable_notifyurl' => array(
'title' => __('Enable PayPal IPN', 'paypal-for-woocommerce'),
'label' => __('Enable Instant Payment Notification.', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('', 'paypal-for-woocommerce'),
'default' => 'no',
'class' => 'angelleye_enable_notifyurl'
),
'notifyurl' => array(
'title' => __('PayPal IPN URL', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Your URL for receiving Instant Payment Notification (IPN) about transactions.', 'paypal-for-woocommerce'),
'class' => 'angelleye_notifyurl'
),
'enable_tokenized_payments' => array(
'title' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'),
'label' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Allow buyers to securely save payment details to their account for quick checkout / auto-ship orders in the future.', 'paypal-for-woocommerce'),
'default' => 'no',
'class' => 'enable_tokenized_payments'
),
'fraud_management_filters' => array(
'title' => __('Fraud Management Filters ', 'paypal-for-woocommerce'),
'label' => '',
'description' => __('Choose how you would like to handle orders when Fraud Management Filters are flagged.', 'paypal-for-woocommerce'),
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array(
'ignore_warnings_and_proceed_as_usual' => __('Ignore warnings and proceed as usual.', 'paypal-for-woocommerce'),
'place_order_on_hold_for_further_review' => __('Place order On Hold for further review.', 'paypal-for-woocommerce'),
),
'default' => 'place_order_on_hold_for_further_review',
'desc_tip' => true,
),
'enable_cardholder_first_last_name' => array(
'title' => __('Enable Cardholder Name', 'paypal-for-woocommerce'),
'label' => __('Adds fields for "card holder name" to checkout in addition to the "billing name" fields.', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Display card holder first and last name in credit card form.', 'paypal-for-woocommerce'),
'default' => 'no',
'desc_tip' => true,
),
'avs_cvv2_result_admin_email' => array(
'title' => __('AVS / CVV2 Results in Admin Order Email', 'paypal-for-woocommerce'),
'label' => __('Adds the AVS / CVV2 results to the admin order email notification.', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => __('Display Address Verification Result (AVS) and Card Security Code Result (CVV2) Results in Admin Order Email.', 'paypal-for-woocommerce'),
'default' => 'no',
'desc_tip' => true,
),
'softdescriptor' => array(
'title' => __('Credit Card Statement Name', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('The value entered here will be displayed on the buyer\'s credit card statement.', 'paypal-for-woocommerce'),
'default' => '',
'desc_tip' => true,
),
'credit_card_month_field' => array(
'title' => __('Credit Card Month Format', 'paypal-for-woocommerce'),
'label' => __('Credit Card Month Display Format.', 'paypal-for-woocommerce'),
'description' => __('Choose whether you wish to display Name format or Number format of Month field in the credit card form.'),
'type' => 'select',
'css' => 'max-width:200px;',
'class' => 'wc-enhanced-select',
'options' => array(
'numbers' => 'Numbers',
'names' => 'Names',
),
'default' => 'names'
),
'credit_card_year_field' => array(
'title' => __('Credit Card Year Format', 'paypal-for-woocommerce'),
'label' => __('Credit Card Year Display Format.', 'paypal-for-woocommerce'),
'description' => __('Choose whether you wish to display two digit format or four digit of Year field in the credit card form.'),
'type' => 'select',
'css' => 'max-width:200px;',
'class' => 'wc-enhanced-select',
'options' => array(
'two_digit' => 'Show Two Digit Years',
'four_digit' => 'Show Four Digit Years',
),
'default' => 'four_digit'
),
'enable_google_recaptcha' => array(
'title' => __('Enable/Disable', 'paypal-for-woocommerce'),
'label' => __('Enable Google reCAPTCHA v3', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'description' => 'Sign up and get your keys : <a target="_blank" href="https://www.google.com/recaptcha/admin/create" target="_blank">https://www.google.com/recaptcha/admin/create</a> (you will get a SITE key and a SECRET key)',
'default' => 'no'
),
'recaptcha_site_key' => array(
'title' => __('reCAPTCHA V3 - Site Key', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Please enter only Google reCAPTCHA V3 Credentials, V2 Credentials are not supported', 'paypal-for-woocommerce'),
'default' => ''
),
'recaptcha_secret_key' => array(
'title' => __('reCAPTCHA V3 - Secret Key', 'paypal-for-woocommerce'),
'type' => 'text',
'description' => __('Please enter only Google reCAPTCHA V3 Credentials, V2 Credentials are not supported', 'paypal-for-woocommerce'),
'default' => ''
),
'debug' => array(
'title' => __('Debug Log', 'paypal-for-woocommerce'),
'type' => 'checkbox',
'label' => __('Enable logging', 'paypal-for-woocommerce'),
'default' => 'no',
'description' => sprintf( __( 'Log PayPal events, inside <code>%s</code>', 'paypal-for-woocommerce' ), angelleye_get_log_path( 'paypal-pro' ) )
),
'is_encrypt' => array(
'title' => __('', 'paypal-for-woocommerce'),
'label' => __('', 'paypal-for-woocommerce'),
'type' => 'hidden',
'default' => 'yes',
'class' => ''
)
);
$this->form_fields = apply_filters('angelleye_pc_form_fields', $this->form_fields);
}
public function admin_options() {
do_action('angelleye_classic_gateway_sub_menu');
do_action('angelleye_ppcp_upgrade_notice', 'paypal_pro');
$GLOBALS['hide_save_button'] = true;
echo '<h2>' . esc_html( $this->get_method_title() ) . '</h2>';
echo wp_kses_post( wpautop( $this->get_method_description() ) );
?>
<div id="angelleye_paypal_marketing_table">
<table class="form-table">
<?php
if(version_compare(WC_VERSION,'2.6','<')) {
AngellEYE_Utility::woo_compatibility_notice();
} else {
$this->generate_settings_html();
}
?>
</table>
<p class="submit">
<button name="save" class="button-primary woocommerce-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'paypal-for-woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'paypal-for-woocommerce' ); ?></button>
<?php wp_nonce_field( 'woocommerce-settings' ); ?>
</p>
</div>
<?php AngellEYE_Utility::angelleye_display_marketing_sidebar($this->id); ?>
<script type="text/javascript">
jQuery('#woocommerce_paypal_pro_payment_action').change(function () {
if ( this.value === 'Authorization' ) {
jQuery('#woocommerce_paypal_pro_pending_authorization_order_status').closest('tr').show();
} else {
jQuery('#woocommerce_paypal_pro_pending_authorization_order_status').closest('tr').hide();
}
}).change();
jQuery('#woocommerce_paypal_pro_testmode').change(function () {
var sandbox = jQuery('#woocommerce_paypal_pro_sandbox_api_username, #woocommerce_paypal_pro_sandbox_api_password, #woocommerce_paypal_pro_sandbox_api_signature').closest('tr'),
production = jQuery('#woocommerce_paypal_pro_api_username, #woocommerce_paypal_pro_api_password, #woocommerce_paypal_pro_api_signature').closest('tr');
if (jQuery(this).is(':checked')) {
sandbox.show();
production.hide();
} else {
sandbox.hide();
production.show();
}
}).change();
jQuery('#woocommerce_paypal_pro_enable_google_recaptcha').change(function () {
var google_recaptcha_fields = jQuery('#woocommerce_paypal_pro_recaptcha_site_key, #woocommerce_paypal_pro_recaptcha_secret_key').closest('tr');
if (jQuery(this).is(':checked')) {
google_recaptcha_fields.show();
} else {
google_recaptcha_fields.hide();
}
}).change();
jQuery('#woocommerce_paypal_pro_send_items').change(function () {
var paypal_pro_subtotal_mismatch_behavior = jQuery('#woocommerce_paypal_pro_subtotal_mismatch_behavior').closest('tr');
if (jQuery(this).is(':checked')) {
paypal_pro_subtotal_mismatch_behavior.show();
} else {
paypal_pro_subtotal_mismatch_behavior.hide();
}
}).change();
</script>
<?php
}
/**
* Check if this gateway is enabled and available in the user's country
*
* This method no is used anywhere??? put above but need a fix below
*/
function is_available() {
if ($this->enabled == "yes") :
if ($this->testmode == false && !is_ssl()) return false;
// Currency check
if (!in_array(get_woocommerce_currency(), apply_filters('woocommerce_paypal_pro_supported_currencies', array('AUD', 'CAD', 'CZK', 'DKK', 'EUR', 'HUF', 'JPY', 'NOK', 'NZD', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'USD')))) return false;
// Required fields check
if (!$this->api_username || !$this->api_password || !$this->api_signature) return false;
return isset($this->available_card_types[WC()->countries->get_base_country()]);
endif;
return false;
}
/**
* Add a log entry
*/
public function log($message, $level = 'info') {
if ($this->debug) {
if (empty($this->log)) {
$this->log = wc_get_logger();
}
$this->log->log($level, $message, array('source' => 'paypal-pro'));
}
}
/**
* Payment form on checkout page
*/
public function payment_fields() {
wp_enqueue_style('angelleye-cc-ui');
do_action('before_angelleye_pc_payment_fields', $this);
$description = $this->get_description();
if ( $description ) {
echo wpautop( wp_kses_post( $description ) );
}
if ($this->testmode == true) {
echo '<p>';
_e('NOTICE: SANDBOX (TEST) MODE ENABLED.', 'paypal-for-woocommerce');
echo '<br />';
if($this->enable_3dsecure) {
echo sprintf( __( 'For testing purposes you can use the card number 4000000000000002 with any CVC and a valid expiration date or check the <a href="%s" target="_blank">Cardinal Centinel documentation</a> for more card numbers.', 'paypal-for-woocommerce' ), 'https://cardinaldocs.atlassian.net/wiki/spaces/CCen/pages/400654355/3DS+1.0+Test+Cases' );
} else {
_e('For testing purposes you can use the card number 4916311462114485 with any CVC and a valid expiration date.', 'paypal-for-woocommerce');
}
echo '</p>';
}
if ( $this->supports( 'tokenization' ) && is_checkout() ) {
$this->tokenization_script();
if( count( $this->get_tokens() ) > 0 ) {
$this->saved_payment_methods();
}
$this->form();
if( AngellEYE_Utility::is_cart_contains_subscription() == false && AngellEYE_Utility::is_subs_change_payment() == false) {
$this->save_payment_method_checkbox();
}
} else {
$this->form();
}
do_action('payment_fields_saved_payment_methods', $this);
do_action('angelleye_pfw_add_google_recaptcha');
}
public function save_payment_method_checkbox() {
printf(
'<p class="form-row woocommerce-SavedPaymentMethods-saveNew">
<input id="wc-%1$s-new-payment-method" name="wc-%1$s-new-payment-method" type="checkbox" value="true" style="width:auto;" />
<label for="wc-%1$s-new-payment-method" style="display:inline;">%2$s</label>
</p>',
esc_attr( $this->id ),
apply_filters( 'cc_form_label_save_to_account', __( 'Save payment method to my account.', 'paypal-for-woocommerce' ), $this->id)
);
}
public function paypal_for_woocommerce_paypal_pro_credit_card_form_expiration_date_selectbox($class) {
$form_html = "";
$form_html .= '<p class="' . $class . '">';
$form_html .= '<label for="cc-expire-month">' . apply_filters( 'cc_form_label_expiry', __("Expiration Date", 'paypal-for-woocommerce'), $this->id ) . '<span class="required">*</span></label>';
$form_html .= '<select ' . $this->field_name('card_expiration_month') . ' class="woocommerce-select woocommerce-cc-month mr5 wc-credit-card-form-card-cvc">';
$form_html .= '<option value="">' . __('Month', 'paypal-for-woocommerce') . '</option>';
$months = array();
for ($i = 1; $i <= 12; $i++) :
$timestamp = mktime(0, 0, 0, $i, 1);
$months[date('n', $timestamp)] = date_i18n(_x('F', 'Month Names', 'paypal-for-woocommerce'), $timestamp);
endfor;
foreach ($months as $num => $name) {
if($this->credit_card_month_field == 'names') {
$form_html .= '<option value=' . $num . '>' . $name . '</option>';
} else {
$month_value = ($num < 10) ? '0'.$num : $num;
$form_html .= '<option value=' . $num . '>' . $month_value . '</option>';
}
}
$form_html .= '</select>';
$form_html .= '<select ' . $this->field_name('card_expiration_year') . ' class="woocommerce-select woocommerce-cc-year ml5 wc-credit-card-form-card-cvc">';
$form_html .= '<option value="">' . __('Year', 'paypal-for-woocommerce') . '</option>';
for ($i = date('y'); $i <= date('y') + 15; $i++) {
if($this->credit_card_year_field == 'four_digit') {
$form_html .= '<option value=' . $i . '>20' . $i . '</option>';
} else {
$form_html .= '<option value=' . $i . '>' . $i . '</option>';
}
}
$form_html .= '</select>';
$form_html .= '</p>';
return $form_html;
}
/**
* Format and get posted details
* @return object
*/
public function get_posted_card() {
$card_number = isset($_POST['paypal_pro-card-number']) ? wc_clean($_POST['paypal_pro-card-number']) : '';
$card_cvc = isset($_POST['paypal_pro-card-cvc']) ? wc_clean($_POST['paypal_pro-card-cvc']) : '';
$card_exp_month = isset($_POST['paypal_pro-card_expiration_month']) ? wc_clean($_POST['paypal_pro-card_expiration_month']) : '';
$card_exp_year = isset($_POST['paypal_pro-card_expiration_year']) ? wc_clean($_POST['paypal_pro-card_expiration_year']) : '';
// Format values
$card_number = str_replace(array(' ', '-'), '', $card_number);
$firstname = isset($_POST['paypal_pro-card-cardholder-first']) ? wc_clean($_POST['paypal_pro-card-cardholder-first']) : '';
$lastname = isset($_POST['paypal_pro-card-cardholder-last']) ? wc_clean($_POST['paypal_pro-card-cardholder-last']) : '';
if (isset($_POST['paypal_pro-card-startdate'])) {
$card_start = wc_clean($_POST['paypal_pro-card-startdate']);
$card_start = array_map('trim', explode('/', $card_start));
$card_start_month = str_pad($card_start[0], 2, "0", STR_PAD_LEFT);
$card_start_year = $card_start[1];
} else {
$card_start_month = '';
$card_start_year = '';
}
$card_exp_month = (int) $card_exp_month;
if ($card_exp_month < 10) {
$card_exp_month = '0' . $card_exp_month;
}
if (strlen($card_exp_year) == 2) {
$card_exp_year += 2000;
}
if (strlen($card_start_year) == 2) {
$card_start_year += 2000;
}
$card_type = AngellEYE_Utility::card_type_from_account_number($card_number);
return (object) array(
'number' => $card_number,
'type' => $card_type,
'cvc' => $card_cvc,
'exp_month' => $card_exp_month,
'exp_year' => $card_exp_year,
'start_month' => $card_start_month,
'start_year' => $card_start_year,
'firstname' => $firstname,
'lastname' => $lastname
);
}
public function validate_fields() {
try {
$this->angelleye_pfw_validate_google_recaptcha();
if (isset($_POST['wc-paypal_pro-payment-token']) && 'new' !== $_POST['wc-paypal_pro-payment-token']) {
$token_id = wc_clean($_POST['wc-paypal_pro-payment-token']);
$token = WC_Payment_Tokens::get($token_id);
if ($token->get_user_id() !== get_current_user_id()) {
throw new Exception(__('Error processing checkout. Please try again.', 'paypal-for-woocommerce'));
} else {
return true;
}
}
$card = $this->get_posted_card();
do_action('before_angelleye_pro_checkout_validate_fields', $card->type, $card->number, $card->cvc, $card->exp_month, $card->exp_year);
if (empty($card->number) || !ctype_digit((string) $card->number)) {
throw new Exception(__('Card number is invalid', 'paypal-for-woocommerce'));
}
if (empty($card->exp_month) || empty($card->exp_year)) {
throw new Exception(__('Card expiration date is invalid', 'paypal-for-woocommerce'));
}
// Validate values
if (!ctype_digit((string) $card->cvc)) {
throw new Exception(__('Card security code is invalid (only digits are allowed)', 'paypal-for-woocommerce'));
}
if (
!ctype_digit((string) $card->exp_month) ||
!ctype_digit((string) $card->exp_year) ||
$card->exp_month > 12 ||
$card->exp_month < 1 ||
$card->exp_year < date('y')
) {
throw new Exception(__('Card expiration date is invalid', 'paypal-for-woocommerce'));
}
$card_type = AngellEYE_Utility::card_type_from_account_number($card->number);
if ($card_type == 'amex' && (get_woocommerce_currency() != 'USD' && get_woocommerce_currency() != 'AUD')) {
throw new Exception(__('Your processor is unable to process the Card Type in the currency requested. Please try another card type', 'paypal-for-woocommerce'));
}
do_action('after_angelleye_pro_checkout_validate_fields', $card->type, $card->number, $card->cvc, $card->exp_month, $card->exp_year);
return true;
} catch (Exception $e) {
wc_add_notice($e->getMessage(), 'error');
return false;
}
}
/**
* Process the payment
*/
public function process_payment($order_id) {
$order = wc_get_order($order_id);
$this->log('Processing order #' . $order_id);
$card = $this->get_posted_card();
/**
* 3D Secure Handling
*/
if (!empty($_POST['wc-paypal_pro-payment-token']) && $_POST['wc-paypal_pro-payment-token'] != 'new') {
$this->enable_3dsecure = false;
}
if ($this->enable_3dsecure) {
if (!class_exists('CentinelClient')) include_once('lib/CentinelClient.php');
$this->clear_centinel_session();
$this->centinel_client = new CentinelClient;
$this->centinel_client->add("MsgType", "cmpi_lookup");
$this->centinel_client->add("Version", "1.7");
$this->centinel_client->add("ProcessorId", $this->centinel_pid);
$this->centinel_client->add("MerchantId", $this->centinel_mid);
$this->centinel_client->add("TransactionPwd", $this->centinel_pwd);
$this->centinel_client->add("TransactionType", 'CC');
$this->centinel_client->add('OrderNumber', $order_id);
$this->centinel_client->add('Amount', $order->get_total() * 100);
$this->centinel_client->add('CurrencyCode', $this->iso4217[$order->get_currency()]);
$this->centinel_client->add('TransactionMode', 'S');
$this->centinel_client->add('ProductCode', 'PHY');
$this->centinel_client->add('CardNumber', $card->number);
angelleye_set_session('CardNumber', $card->number);
$this->centinel_client->add('CardExpMonth', $card->exp_month);
angelleye_set_session('CardExpMonth', $card->exp_month);
$this->centinel_client->add('CardExpYear', $card->exp_year);
angelleye_set_session('CardExpYear', $card->exp_year);
$this->centinel_client->add('CardCode', $card->cvc);
angelleye_set_session('CardCode', $card->cvc);
if(!empty($card->firstname) && !empty($card->lastname)) {
$billing_first_name = $card->firstname;
$billing_last_name = $card->lastname;
} else {
$billing_first_name = $order->get_billing_first_name();
$billing_last_name = $order->get_billing_last_name();
}
$this->centinel_client->add('BillingFirstName', $billing_first_name);
$this->centinel_client->add('BillingLastName', $billing_last_name);
$this->centinel_client->add('BillingAddress1', $order->get_billing_address_1());
$this->centinel_client->add('BillingAddress2', $order->get_billing_address_2());
$this->centinel_client->add('BillingCity', $order->get_billing_city());
$this->centinel_client->add('BillingState', $order->get_billing_state());
$this->centinel_client->add('BillingPostalCode', $order->get_billing_postcode());
$this->centinel_client->add('BillingCountryCode', $order->get_billing_country());
$this->centinel_client->add('BillingPhone', $order->get_billing_phone());
$this->centinel_client->add('ShippingFirstName', $order->get_shipping_first_name());
$this->centinel_client->add('ShippingLastName', $order->get_shipping_last_name());
$this->centinel_client->add('ShippingAddress1', $order->get_shipping_address_1());
$this->centinel_client->add('ShippingAddress2', $order->get_shipping_address_2());
$this->centinel_client->add('ShippingCity', $order->get_shipping_city());
$this->centinel_client->add('ShippingState', $order->get_shipping_state());
$this->centinel_client->add('ShippingPostalCode', $order->get_shipping_postcode());
$this->centinel_client->add('ShippingCountryCode', $order->get_shipping_country());
// Items
$item_loop = 0;
if (sizeof($order->get_items()) > 0) {
foreach ($order->get_items() as $item) {
$item_loop++;
$this->centinel_client->add('Item_Name_' . $item_loop, $item['name']);
$this->centinel_client->add('Item_Price_' . $item_loop, number_format($order->get_item_total($item, true, true) * 100), 2, '.', '');
$this->centinel_client->add('Item_Quantity_' . $item_loop, $item['qty']);
$this->centinel_client->add('Item_Desc_' . $item_loop, $item['name']);
}
}
// Send request
$this->centinel_client->sendHttp($this->centinel_url, "5000", "15000");
$this->log('Centinal client request: ' . print_r($this->centinel_client->request, true));
$this->log('Centinal client response: ' . print_r($this->centinel_client->response, true));
// Save response in session
angelleye_set_session('Centinel_ErrorNo', $this->get_centinel_value("ErrorNo"));
angelleye_set_session('Centinel_ErrorDesc', $this->get_centinel_value("ErrorDesc"));
angelleye_set_session('Centinel_TransactionId', $this->get_centinel_value("TransactionId"));
angelleye_set_session('Centinel_OrderId', $this->get_centinel_value("OrderId"));
angelleye_set_session('Centinel_Enrolled', $this->get_centinel_value("Enrolled"));
angelleye_set_session('Centinel_ACSUrl', $this->get_centinel_value("ACSUrl"));
angelleye_set_session('Centinel_Payload', $this->get_centinel_value("Payload"));
angelleye_set_session('Centinel_EciFlag', $this->get_centinel_value("EciFlag"));
angelleye_set_session('Centinel_card_start_month', $card->start_month);
angelleye_set_session('Centinel_card_start_year', $card->start_year);
if ($this->get_centinel_value("ErrorNo")) {
wc_add_notice(apply_filters('angelleye_pc_process_payment_authentication', __('Error in 3D secure authentication: ', 'paypal-for-woocommerce') . $this->get_centinel_value("ErrorDesc")), 'error');
return;
}
if ('Y' === $this->get_centinel_value("Enrolled")) {
$this->log('Doing 3dsecure payment authorization');
$this->log('ASCUrl: ' . $this->get_centinel_value("ACSUrl"));
$this->log('PaReq: ' . $this->get_centinel_value("Payload"));
return array(
'result' => 'success',
'redirect' => add_query_arg(array('acs' => $order_id), untrailingslashit(WC()->api_request_url('WC_Gateway_PayPal_Pro_AngellEYE', is_ssl())))
);
} elseif ($this->liability_shift && 'N' !== $this->get_centinel_value("Enrolled")) {
wc_add_notice(apply_filters('angelleye_pc_process_payment_authentication_unavailable', __('Authentication unavailable. Please try a different payment method or card.', 'paypal-for-woocommerce')), 'error');
return;
}
}
// Do payment with paypal
return $this->do_payment($order, $card->number, $card->type, $card->exp_month, $card->exp_year, $card->cvc, '', '', '', '', '', $card->start_month, $card->start_year);
}
/**
* Auth 3dsecure
*/
public function handle_3dsecure() {
if (!empty($_GET['acs'])) {
$order_id = wc_clean($_GET['acs']);
$acsurl = angelleye_get_session('Centinel_ACSUrl');
$payload = angelleye_get_session('Centinel_Payload');
?>
<html>
<head>
<title>3DSecure Payment Authorisation</title>
</head>
<body>
<form name="frmLaunchACS" id="3ds_submit_form" method="POST" action="<?php echo esc_url($acsurl); ?>">
<input type="hidden" name="PaReq" value="<?php echo esc_attr($payload); ?>">
<input type="hidden" name="TermUrl"
value="<?php echo esc_attr(WC()->api_request_url('WC_Gateway_PayPal_Pro_AngellEYE', is_ssl())); ?>">
<input type="hidden" name="MD" value="<?php echo absint($order_id); ?>">
<noscript>
<input type="submit" class="button" id="3ds_submit" value="Submit"/>
</noscript>
</form>
<script>
document.frmLaunchACS.submit();
</script>
</body>
</html>
<?php
exit;
} else {