Changeset 2162618
- Timestamp:
- 09/25/2019 02:59:51 AM (7 years ago)
- Location:
- pay-advantage/trunk
- Files:
-
- 8 edited
-
README.txt (modified) (2 diffs)
-
admin/options-ajax.php (modified) (1 diff)
-
includes/class-payadvantage-activator.php (modified) (2 diffs)
-
payadvantage.php (modified) (2 diffs)
-
public/payadvantage-creditcard-ajax.php (modified) (1 diff)
-
public/payadvantage-creditcard.php (modified) (5 diffs)
-
public/payadvantage-json-converter.php (modified) (3 diffs)
-
shared/payadvantage-auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pay-advantage/trunk/README.txt
r2094189 r2162618 3 3 Tags: payment, online payments, credit cards, bpay 4 4 Requires at least: 4.6 5 Tested up to: 5. 16 Stable tag: 2. 0.05 Tested up to: 5.2.3 6 Stable tag: 2.1.0 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later … … 47 47 48 48 = 1.1.0 = 49 * Multiple updates, bug fixes and general improvements. Please ensure you update to this version.49 * Multiple updates, bug fixes and general improvements. 50 50 51 51 = 2.0.0 = 52 * Multiple updates, settings page improvements. Please ensure you update to this version. 52 * Multiple updates, settings page improvements. 53 54 = 2.1.0 = 55 * Fix validation of international phone numbers in Woo Commerce plug-in. 56 * Minor bug fixes. 57 * Please ensure you update to this version. -
pay-advantage/trunk/admin/options-ajax.php
r2094189 r2162618 83 83 $auth = new Pay_Advantage_Auth(); 84 84 85 // TODO: Sanitize86 85 $env = sanitize_user($_POST['payadvantageenv']); 87 86 $username = sanitize_user($_POST['payadvantageusername']); -
pay-advantage/trunk/includes/class-payadvantage-activator.php
r1946429 r2162618 1 1 <?php 2 2 /** 3 * This is meant to activate the plugin but having issues getting it working. on the todo list.3 * Code that runs upon activation of the Pay Advantage plugin. 4 4 */ 5 5 … … 7 7 8 8 /** 9 * Short Description. (use period)10 *11 * Long Description.12 *13 9 * @since 1.0.0 14 10 */ -
pay-advantage/trunk/payadvantage.php
r2094189 r2162618 15 15 * Plugin Name: Pay Advantage 16 16 * Plugin URI: https://www.payadvantage.com.au/ 17 * Description: This plugin adds a payment gateway to woo commerce as well as a widget for credit card and BPay donations.18 * Version: 2. 0.017 * Description: This plugin adds a payment gateway to Woo Commerce as well as a widget for credit card and BPay payments. 18 * Version: 2.1.0 19 19 * Author: Pay Advantage 20 20 * Author URI: ben.m@payadvantage.com … … 26 26 27 27 /** 28 * Currently plugin version. 29 * Start at version 1.0.0 and use SemVer - https://semver.org 30 * Rename this for your plugin and update it as you release new versions. 28 * Current plugin version. 31 29 */ 32 define( 'PayAdvantage', '2. 0.0' );30 define( 'PayAdvantage', '2.1.0' ); 33 31 34 32 include( plugin_dir_path( __FILE__ ) . '/includes/payadvantage-files.php'); -
pay-advantage/trunk/public/payadvantage-creditcard-ajax.php
r2094189 r2162618 27 27 $validation_message = $validator->validate_credit_card_payment(); 28 28 29 $billing_data = array(30 'first_name' => sanitize_text_field( $_POST['payadvantagefirstname'] ),31 'last_name' => sanitize_text_field( $_POST['payadvantagelastname'] ),32 'email' => sanitize_text_field( $_POST['payadvantageemail'] )33 );34 35 29 if ( strlen( $validation_message ) > PAYADV_DEFAULT_ERROR_LENGTH ) { 36 30 echo $validation_message . ']}'; 37 31 wp_die(); 38 32 } 39 33 34 $billing_data = array( 35 'first_name' => sanitize_text_field( $_POST['payadvantagefirstname'] ), 36 'last_name' => sanitize_text_field( $_POST['payadvantagelastname'] ), 37 'email' => sanitize_text_field( $_POST['payadvantageemail'] ), 38 'mobile' => sanitize_text_field( $_POST['payadvantagemobile'] ) 39 ); 40 40 41 $payment_result = $credit_card_payment->process_credit_card_payment( 41 42 $billing_data, -
pay-advantage/trunk/public/payadvantage-creditcard.php
r2094189 r2162618 78 78 79 79 /** 80 * Queries the customer to see if the irexisting.80 * Queries the customer to see if they're existing. 81 81 */ 82 82 private function customer_query_api_call($email, $first_name, $last_name) … … 88 88 'Content-Type' => 'application/json', 89 89 'Authorization' => "Bearer $this->access_token" 90 ) 90 ), 91 'timeout' => 30 91 92 ); 92 93 … … 109 110 'Authorization' => "Bearer $this->access_token" 110 111 ), 111 'body' => $json_customer 112 'body' => $json_customer, 113 'timeout' => 30 112 114 ); 113 115 … … 130 132 'Authorization' => "Bearer $this->access_token" 131 133 ), 132 'body' => $json_card_info 134 'body' => $json_card_info, 135 'timeout' => 30 133 136 ); 134 137 … … 151 154 'Authorization' => "Bearer $this->access_token" 152 155 ), 153 'body' => $charges_json 156 'body' => $charges_json, 157 'timeout' => 30 154 158 ); 155 159 -
pay-advantage/trunk/public/payadvantage-json-converter.php
r2040227 r2162618 37 37 'FirstName' => sanitize_text_field($_POST['payadvantagefirstname']), 38 38 'LastName' => sanitize_text_field($_POST['payadvantagelastname']), 39 'Mobile' => sanitize_text_field($_POST['payadvantagemobile']),39 'Mobile' => $this->extract_phone_number( sanitize_text_field($_POST['payadvantagemobile']) ), 40 40 'Street' => $street, 41 41 'Suburb' => $suburb, … … 53 53 */ 54 54 public function create_customer_json( $data ) { 55 $mobile = null; 56 $street = null; 57 $city = null; 58 $state = null; 59 $post_code = null; 55 $country_iso = null; 60 56 61 if ( isset( $data['phone'] ) ) { 62 $mobile = sanitize_text_field( $data['phone'] ); 63 } 64 65 if( isset( $data['address_1'] ) ) { 66 $street = sanitize_text_field( $data['address_1'] ); 67 } 68 69 if( isset( $data['city'] ) ) { 70 $city = sanitize_text_field( $data['city'] ); 71 } 72 73 if( isset( $data['state'] ) ) { 74 $state = sanitize_text_field( $data['state'] ); 75 } 76 77 if( isset( $data['postcode'] ) ) { 78 $post_code = sanitize_text_field( $data['postcode'] ); 57 if( !empty( $data['country'] ) ) { 58 $country_iso = sanitize_text_field( $data['country'] ); 79 59 } 80 60 … … 85 65 'FirstName' => sanitize_text_field( $data['first_name'] ), 86 66 'LastName' => sanitize_text_field( $data['last_name'] ), 87 'Mobile' => $mobile, 88 'Suburb' => $city, 89 'Street' => $street, 90 'State' => $state, 91 'Postcode' => $post_code 67 'CountryISO3316' => $country_iso 92 68 ); 93 69 70 if( !empty( $data['address_1'] ) ) { 71 $query['Street1'] = sanitize_text_field( $data['address_1'] ); 72 } 73 74 if( !empty( $data['city'] ) ) { 75 $query['Suburb'] = sanitize_text_field( $data['city'] ); 76 } 77 78 if( !empty( $data['postcode'] ) ) { 79 $query['Postcode'] = sanitize_text_field( $data['postcode'] ); 80 } 81 82 if( !empty( $data['state'] ) ) { 83 $query['State'] = sanitize_text_field( $data['state'] ); 84 } 85 86 if ( !empty( $data['phone'] ) ) { 87 $query['Phone'] = $this->extract_phone_number( sanitize_text_field( $data['phone'] ) ); 88 $query['PhoneCountryISO3316'] = $country_iso; 89 } 90 91 if ( !empty( $data['mobile'] ) ) { 92 $query['Mobile'] = $this->extract_phone_number( sanitize_text_field( $data['mobile'] ) ); 93 $query['MobileCountryISO3316'] = $country_iso; 94 } 95 94 96 return json_encode( $query ); 97 } 98 99 private function extract_phone_number ( $text_value ) { 100 return preg_replace( '/[^0-9]/', '', $text_value ); 95 101 } 96 102 -
pay-advantage/trunk/shared/payadvantage-auth.php
r2094189 r2162618 41 41 'Expect' => '' 42 42 ), 43 'body' => json_encode($auth) 43 'body' => json_encode($auth), 44 'timeout' => 30 44 45 ); 45 46 $response = wp_remote_post( $url, $data );
Note: See TracChangeset
for help on using the changeset viewer.