Skip to content

Commit

Permalink
Resolves merge conflict, ref PFW-167
Browse files Browse the repository at this point in the history
  • Loading branch information
angelleye committed Jul 16, 2018
2 parents 363bd0e + 3c36f5b commit 0164cd0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion angelleye-includes/angelleye-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ public function angelleye_paypal_for_woocommerce_order_status_handler($order) {
if ($order->get_total() - $order->get_total_refunded() <= $this->total_Completed_DoAuthorization && $this->total_Pending_DoAuthorization == 0) {
do_action('woocommerce_order_status_pending_to_processing', $order_id);
$order->payment_complete($_first_transaction_id);
do_action('woocommerce_checkout_order_processed', $order_id, $posted = array());
do_action('woocommerce_checkout_order_processed', $order_id, $posted = array(), $order);
}
}
}
Expand Down
15 changes: 9 additions & 6 deletions classes/wc-gateway-braintree-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,27 +504,30 @@ function is_angelleye_braintree_selected() {
}
if(is_angelleye_braintree_selected()) {
checkout_form.addEventListener('submit', function (event) {
if(is_angelleye_braintree_selected()) {
dropinInstance.requestPaymentMethod(function (err, payload) {
if(err) {
unique_form_for_validation.append('<input type="hidden" class="is_submit" name="is_submit" value="yes"/>');
$('.woocommerce-error').remove();
$('.braintree-device-data', ccForm).remove();
$('.braintree-token', ccForm).remove();
$('.woocommerce-error').remove();
$('.is_submit').remove();
unique_form_for_validation.prepend('<ul class="woocommerce-error"><li>' + err + '</li></ul>');
$form.unblock();
var scrollElement = $( '.woocommerce-error' );
if ( ! scrollElement.length ) {
scrollElement = $( '.form.checkout' );
}
$.scroll_to_notices( scrollElement );
return false;
}
if (payload) {
unique_form_for_validation.append('<input type="hidden" class="is_submit" name="is_submit" value="yes"/>');
$('.braintree-token', ccForm).remove();
unique_form_for_validation.append('<input type="hidden" class="braintree-token" name="braintree_token" value="' + payload.nonce + '"/>');
unique_form_for_validation.append("<input type='hidden' class='braintree-device-data' id='device_data' name='device_data' value=" + payload.deviceData + ">");
$form.submit();
}
});
} else {
return true;
}
});
}
});
Expand Down Expand Up @@ -1924,7 +1927,7 @@ public function angelleye_display_mid_ui() {
$button_text = sprintf(__('Add merchant account ID for %s', 'paypal-for-woocommerce'), $base_currency);
?>
<tr valign="top">
<th scope="row" class="titledesc">
<th scope="row" class="titledesc" style="width: 400px;">
<select id="wc_braintree_merchant_account_id_currency" class="wc-enhanced-select">
<?php foreach (get_woocommerce_currencies() as $code => $name) : ?>
<option <?php selected($code, $base_currency); ?> value="<?php echo esc_attr($code); ?>">
Expand Down
17 changes: 14 additions & 3 deletions classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -1461,13 +1461,18 @@ public function handle_wc_api() {
}
$this->angelleye_check_cart_items();
$order_id = WC()->checkout()->create_order($this->posted);

if (is_wp_error($order_id)) {
throw new Exception($order_id->get_error_message());
}

/** Creating Order Object for fresh created order */
$order = wc_get_order($order_id);

if ( ! is_user_logged_in() && WC()->checkout->is_registration_required($order_id) ) {
$paypal_express_request->angelleye_process_customer($order_id);
}
do_action('woocommerce_checkout_order_processed', $order_id, $this->posted);
do_action('woocommerce_checkout_order_processed', $order_id, $this->posted, $order);
} else {
$_POST = WC()->session->get( 'post_data' );
$this->posted = WC()->session->get( 'post_data' );
Expand Down Expand Up @@ -1511,12 +1516,18 @@ public function handle_wc_api() {
if (is_wp_error($order_id)) {
throw new Exception($order_id->get_error_message());
}

/** Creating Order Object for fresh created order */
$order = wc_get_order($order_id);

if ( ! is_user_logged_in() && WC()->checkout->is_registration_required() ) {
$paypal_express_request->angelleye_process_customer($order_id);
}
do_action('woocommerce_checkout_order_processed', $order_id, $this->posted);
do_action('woocommerce_checkout_order_processed', $order_id, $this->posted, $order);
}
if(!$order instanceof WC_Order) {
$order = wc_get_order($order_id);
}
$order = wc_get_order($order_id);
$post_data = WC()->session->get('post_data');
if ($this->billing_address && empty($post_data)) {
$paypal_express_checkout = WC()->session->get( 'paypal_express_checkout' );
Expand Down
6 changes: 3 additions & 3 deletions paypal-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: PayPal for WooCommerce
* Plugin URI: http://www.angelleye.com/product/paypal-for-woocommerce-plugin/
* Description: Easily enable PayPal Express Checkout, PayPal Pro, PayPal Advanced, PayPal REST, and PayPal Braintree. Each option is available separately so you can enable them individually.
* Version: 1.4.11
* Version: 1.4.12
* Author: Angell EYE
* Author URI: http://www.angelleye.com/
* License: GNU General Public License v3.0
Expand All @@ -13,7 +13,7 @@
* Domain Path: /i18n/languages/
* GitHub Plugin URI: https://github.com/angelleye/paypal-woocommerce
* Requires at least: 3.8
* Tested up to: 4.9.6
* Tested up to: 4.9.7
* WC requires at least: 3.0.0
* WC tested up to: 3.4.3
*
Expand All @@ -39,7 +39,7 @@
define('PAYPAL_FOR_WOOCOMMERCE_ASSET_URL', plugin_dir_url(__FILE__));
}
if (!defined('VERSION_PFW')) {
define('VERSION_PFW', '1.4.11');
define('VERSION_PFW', '1.4.12');
}
if ( ! defined( 'PAYPAL_FOR_WOOCOMMERCE_PLUGIN_FILE' ) ) {
define( 'PAYPAL_FOR_WOOCOMMERCE_PLUGIN_FILE', __FILE__ );
Expand Down
18 changes: 12 additions & 6 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: angelleye, angelleyesupport, Umangvaghela
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SG9SQU2GBXJNA
Tags: woocommerce, paypal, express checkout, payments pro, angelleye, payflow, dodirectpayment, braintree, payments advanced, rest, credit cards, credit card payments, payments, payment
Requires at least: 3.8
Tested up to: 4.9.6
Stable tag: 1.4.11
Tested up to: 4.9.7
Stable tag: 1.4.12
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -127,11 +127,17 @@ Automatic updates should work great for you. As always, though, we recommend ba

== Changelog ==

= 1.4.12 - xx.xx.2018 =
= 1.4.13 - 07.16.2018 =
* [[PFW-189](https://github.com/angelleye/paypal-woocommerce/pull/1169)] - Feature - WooCommerce One Click Upsell Compatibility.
* [[PFW-190](https://github.com/angelleye/paypal-woocommerce/pull/1173)] - Tweak - Resolves a CSS conflict in Braintree settings panel.
* [[PFW-200](https://github.com/angelleye/paypal-woocommerce/pull/1174)] - Tweak - Adjustments to JS related to Braintree data validation.

= 1.4.12 - 07.16.2018 =
* Feature - Adds ability to hide individual credit card types from Express Checkout Smart Payment Buttons. ([PFW-179](https://github.com/angelleye/paypal-woocommerce/pull/1159))
* Feature - Adds option to override the Proceed to Checkout button text on the Woo cart page. ([PFW-183](https://github.com/angelleye/paypal-woocommerce/pull/1168))
* Tweak - Adjustments to JS around Express Checkout Smart Buttons to improve performance. ([PFW-135](https://github.com/angelleye/paypal-woocommerce/pull/1157))
* Feature - Adds option to override the Proceed to Checkout button text on the Woo cart page. ([PFW-183](https://github.com/angelleye/paypal-woocommerce/pull/1168)) ([PFW-193](https://github.com/angelleye/paypal-woocommerce/pull/1167))
* Tweak - Adjustments to JS around Express Checkout Smart Buttons to improve performance. ([PFW-135](https://github.com/angelleye/paypal-woocommerce/pull/1157)) ([PFW-178](https://github.com/angelleye/paypal-woocommerce/pull/1162))
* Tweak - Removes unnecessary admin notices to avoid clutter. ([PFW-164](https://github.com/angelleye/paypal-woocommerce/pull/1156)) ([PFW-174](https://github.com/angelleye/paypal-woocommerce/pull/1160)) ([PFW-175](https://github.com/angelleye/paypal-woocommerce/pull/1161))
* Fix - Resolves some PHP notices. ([PFW-136](https://github.com/angelleye/paypal-woocommerce/pull/1152))
* Fix - Resolves an issue where Smart Buttons would not display on Checkout page when Page Setup options were changed from default. ([PFW-147](https://github.com/angelleye/paypal-woocommerce/pull/1151))
* Fix - Resolves some PHP notices. ([PFW-135](https://github.com/angelleye/paypal-woocommerce/pull/1152))
* Fix - Adjusts the check for SSL to coincide with changes made in recent updates to WooCommerce. ([PFW-168](https://github.com/angelleye/paypal-woocommerce/pull/1155))
Expand Down Expand Up @@ -867,5 +873,5 @@ Automatic updates should work great for you. As always, though, we recommend ba

== Upgrade Notice ==

= 1.4.9 =
= 1.4.12 =
After updating, make sure to clear any caching / CDN plugins you may be using. Also, go into the plugin's gateway settings, review everything, and click Save even if you do not make any changes.

0 comments on commit 0164cd0

Please sign in to comment.