Payment Form for PayPal Pro - Version 1.1.33

Version Description

  • Changed process to async calls with loading indicator

=

Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Payment Form for PayPal Pro
Version 1.1.33
Comparing to
See all releases

Code changes from version 1.1.32 to 1.1.33

README.txt CHANGED
@@ -227,7 +227,10 @@ A: In all plugin versions you can turn off IP tracking to avoid saving that user
227
  = 1.1.32 =
228
  * Adjustments to make the form GDPR compliant
229
 
 
 
 
230
  == Upgrade Notice ==
231
 
232
- = 1.1.32 =
233
- * Adjustments to make the form GDPR compliant
227
  = 1.1.32 =
228
  * Adjustments to make the form GDPR compliant
229
 
230
+ = 1.1.33 =
231
+ * Changed process to async calls with loading indicator
232
+
233
  == Upgrade Notice ==
234
 
235
+ = 1.1.33 =
236
+ * Changed process to async calls with loading indicator
cp_ppp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Payment Form for PayPal Pro
4
  Plugin URI: https://wordpress.dwbooster.com/forms/paypal-payment-pro-form
5
  Description: Payment Form for PayPal Pro to accept credit cards directly into your website. Official PayPal Partner.
6
- Version: 1.1.32
7
  Author: CodePeople
8
  Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
  License: GPL
3
  Plugin Name: Payment Form for PayPal Pro
4
  Plugin URI: https://wordpress.dwbooster.com/forms/paypal-payment-pro-form
5
  Description: Payment Form for PayPal Pro to accept credit cards directly into your website. Official PayPal Partner.
6
+ Version: 1.1.33
7
  Author: CodePeople
8
  Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
  License: GPL
cp_ppp_paypal_pro_int.inc.php CHANGED
@@ -49,7 +49,7 @@
49
  <div class="fields" id="field-c0-ppp">
50
  <label>Card Type:</label>
51
  <div class="dfield">
52
- <select name="cfpp_customer_credit_card_type" id="cfpp_customer_credit_card_type"><option value="Visa">Visa</option><option value="MasterCard">MasterCard</option><option value="Discover">Discover</option><option value="Amex">Amex</option></select>
53
  </div>
54
  <div class="clearer"></div>
55
  </div>
@@ -59,21 +59,21 @@
59
  <label>Expiration:</label>
60
  <div class="dfield">
61
  <select name="cfpp_cc_expiration_month">
62
- <option value="01">January</option>
63
- <option value="02">February</option>
64
- <option value="03">March</option>
65
- <option value="04">April</option>
66
- <option value="05">May</option>
67
- <option value="06">June</option>
68
- <option value="07">July</option>
69
- <option value="08">August</option>
70
- <option value="09">September</option>
71
- <option value="10">October</option>
72
- <option value="11">November</option>
73
- <option value="12">December</option>
74
  </select> /
75
  <select name="cfpp_cc_expiration_year">
76
- <?php $d= intval(date("Y")); for($i=$d;$i<$d+10;$i++) echo '<option value="'.$i.'">'.$i.'</option>'; ?>
77
  </select>
78
  </div>
79
  <div class="clearer"></div>
49
  <div class="fields" id="field-c0-ppp">
50
  <label>Card Type:</label>
51
  <div class="dfield">
52
+ <select name="cfpp_customer_credit_card_type" id="cfpp_customer_credit_card_type"><option value="Visa" vt="Visa">Visa</option><option value="MasterCard" vt="MasterCard">>MasterCard</option><option value="Discover" vt="Discover">Discover</option><option value="Amex" vt="Amex">Amex</option></select>
53
  </div>
54
  <div class="clearer"></div>
55
  </div>
59
  <label>Expiration:</label>
60
  <div class="dfield">
61
  <select name="cfpp_cc_expiration_month">
62
+ <option value="01" vt="01">January</option>
63
+ <option value="02" vt="02">February</option>
64
+ <option value="03" vt="03">March</option>
65
+ <option value="04" vt="04">April</option>
66
+ <option value="05" vt="05">May</option>
67
+ <option value="06" vt="06">June</option>
68
+ <option value="07" vt="07">July</option>
69
+ <option value="08" vt="08">August</option>
70
+ <option value="09" vt="09">September</option>
71
+ <option value="10" vt="10">October</option>
72
+ <option value="11" vt="11">November</option>
73
+ <option value="12" vt="12">December</option>
74
  </select> /
75
  <select name="cfpp_cc_expiration_year">
76
+ <?php $d= intval(date("Y")); for($i=$d;$i<$d+10;$i++) echo '<option value="'.$i.'" vt="'.$i.'">'.$i.'</option>'; ?>
77
  </select>
78
  </div>
79
  <div class="clearer"></div>
cp_ppp_public_int.inc.php CHANGED
@@ -39,9 +39,11 @@ if( !is_null( $form_data ) )
39
  $raw_form_str = str_replace('"','&quot;',esc_attr($raw_form_str));
40
  ?>
41
  <script type="text/javascript">
 
42
  function cp_ppp_cerror(id){$dexQuery = jQuery.noConflict();$dexQuery("#hdcaptcha_error"+id).css('top',$dexQuery("#hdcaptcha"+id).outerHeight());$dexQuery("#hdcaptcha_error"+id).css("display","inline");}
43
  function doValidate<?php echo $CP_CPP_global_form_count; ?>(form)
44
  {
 
45
  $dexQuery = jQuery.noConflict();
46
  document.cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>.cp_ref_page.value = document.location;
47
  <?php if (cp_ppp_get_option('cv_enable_captcha', CP_PPP_DEFAULT_cv_enable_captcha,$id) != 'false') { ?> if ($dexQuery("#hdcaptcha_cp_ppp_post<?php echo $CP_CPP_global_form_count; ?>").val() == '')
@@ -63,51 +65,59 @@ $raw_form_str = str_replace('"','&quot;',esc_attr($raw_form_str));
63
  return false;
64
  }
65
  else <?php } ?>
66
- {
67
- <?php if (cp_ppp_get_option('enable_paypal',CP_PPP_DEFAULT_ENABLE_PAYPAL) == "3") { ?>
68
- if (document.getElementById("cp_ppp_paymentspro<?php echo $CP_CPP_global_form_count; ?>").value != "")
69
- $dexQuery.ajax({
70
- type: "POST",
71
- async: false,
72
- url: '<?php echo cp_ppp_get_site_url(); ?>/',
73
- data: $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").serialize(), // serializes the form's elements.
74
- success: function(data)
75
- {
76
- if (data != 'OK')
77
- alert(data);
78
- else
79
- document.getElementById("cp_ppp_paymentspro<?php echo $CP_CPP_global_form_count; ?>").value = "";
80
- }
81
- });
82
- if (document.getElementById("cp_ppp_paymentspro<?php echo $CP_CPP_global_form_count; ?>").value == "")
83
- {
84
- <?php } ?>
85
- var cpefb_error = 0;
86
  $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find(".cpefb_error").each(function(index){
87
  if ($dexQuery(this).css("display")!="none")
88
  cpefb_error++;
89
  });
90
- if (cpefb_error==0)
 
 
 
 
91
  {
92
- $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find("select").children().each(function(){
93
- $dexQuery(this).val($dexQuery(this).attr("vt"));
94
- });
95
- $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find("input:checkbox,input:radio").each(function(){
96
- $dexQuery(this).val($dexQuery(this).attr("vt"));
97
- });
98
- $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find( '.ignore' ).parents( '.fields' ).remove();
99
- }
100
- document.getElementById("form_structure<?php echo $CP_CPP_global_form_count; ?>").value = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  return true;
102
- <?php if (cp_ppp_get_option('enable_paypal',CP_PPP_DEFAULT_ENABLE_PAYPAL) == "3") { ?>
103
- }
104
- else
105
- {
106
- return false;
107
- }
108
- <?php } ?>
109
  }
110
  }
 
 
 
 
 
 
 
 
 
 
 
111
  </script>
112
  <?php
113
  $custom_styles = base64_decode(get_option('CP_PPPRO_CSS', ''));
39
  $raw_form_str = str_replace('"','&quot;',esc_attr($raw_form_str));
40
  ?>
41
  <script type="text/javascript">
42
+ var cp_contactformpppro_ready_to_go = false;
43
  function cp_ppp_cerror(id){$dexQuery = jQuery.noConflict();$dexQuery("#hdcaptcha_error"+id).css('top',$dexQuery("#hdcaptcha"+id).outerHeight());$dexQuery("#hdcaptcha_error"+id).css("display","inline");}
44
  function doValidate<?php echo $CP_CPP_global_form_count; ?>(form)
45
  {
46
+ if (cp_contactformpppro_ready_to_go) return;
47
  $dexQuery = jQuery.noConflict();
48
  document.cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>.cp_ref_page.value = document.location;
49
  <?php if (cp_ppp_get_option('cv_enable_captcha', CP_PPP_DEFAULT_cv_enable_captcha,$id) != 'false') { ?> if ($dexQuery("#hdcaptcha_cp_ppp_post<?php echo $CP_CPP_global_form_count; ?>").val() == '')
65
  return false;
66
  }
67
  else <?php } ?>
68
+ {
69
+ var cpefb_error = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find(".cpefb_error").each(function(index){
71
  if ($dexQuery(this).css("display")!="none")
72
  cpefb_error++;
73
  });
74
+ if (cpefb_error)
75
+ return false;
76
+ cp_contactformpppro_ready_to_go = true;
77
+ cfwpppro_blink(".pbSubmit");
78
+ if (document.getElementById("cp_ppp_paymentspro<?php echo $CP_CPP_global_form_count; ?>").value != "")
79
  {
80
+ $dexQuery.ajax({
81
+ type: "POST",
82
+ async: true,
83
+ url: '<?php echo cp_ppp_get_site_url(); ?>/',
84
+ data: $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").serialize(), // serializes the form's elements.
85
+ success: function(data)
86
+ {
87
+ cp_contactformpppro_ready_to_go = false;
88
+ if (data != 'OK')
89
+ alert(data);
90
+ else
91
+ {
92
+ document.getElementById("cp_ppp_paymentspro<?php echo $CP_CPP_global_form_count; ?>").value = "";
93
+ $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find("select").children().each(function(){
94
+ $dexQuery(this).val($dexQuery(this).attr("vt"));
95
+ });
96
+ $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find("input:checkbox,input:radio").each(function(){
97
+ $dexQuery(this).val($dexQuery(this).attr("vt"));
98
+ });
99
+ $dexQuery("#cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").find( '.ignore' ).parents( '.fields' ).remove();
100
+ document.getElementById("form_structure<?php echo $CP_CPP_global_form_count; ?>").value = '';
101
+ document.getElementById("cp_ppp_pform<?php echo $CP_CPP_global_form_count; ?>").submit();
102
+ }
103
+ }
104
+ });
105
+ return false;
106
+ }
107
  return true;
 
 
 
 
 
 
 
108
  }
109
  }
110
+ function cfwpppro_blink(selector){
111
+ $dexQuery = jQuery.noConflict();
112
+ $dexQuery(selector).fadeOut(1000, function(){
113
+ $dexQuery(this).fadeIn(1000, function(){
114
+ try {
115
+ if (cp_contactformpppro_ready_to_go)
116
+ cfwpppro_blink(this);
117
+ } catch (e) {}
118
+ });
119
+ });
120
+ }
121
  </script>
122
  <?php
123
  $custom_styles = base64_decode(get_option('CP_PPPRO_CSS', ''));