Skip to content

Commit

Permalink
Express Checkout - Still not working from a saved/pending invoice, ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Nov 6, 2017
1 parent 801220d commit c2278fa
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ public function angelleye_get_express_checkout_details() {
WC()->customer->set_calculated_shipping(true);
}
if ($this->angelleye_ec_force_to_display_checkout_page()) {
wp_safe_redirect( wc_get_checkout_url() );
exit;
if ($this->angelleye_ec_force_to_display_checkout_page()) {
if( !empty($_GET['pay_for_order']) && $_GET['pay_for_order'] == true && !empty($_GET['key'])) {
WC()->session->set( 'order_awaiting_payment', $_GET['order_id'] );
} else {
wp_safe_redirect( wc_get_checkout_url() );
exit;
}
}
}

} else {
Expand Down Expand Up @@ -471,7 +477,7 @@ public function angelleye_set_express_checkout_request() {
'key' => $_GET['key'],
'order_id' => $order_id,
), WC()->api_request_url('WC_Gateway_PayPal_Express_AngellEYE') ) );

WC()->session->set( 'order_awaiting_payment', $order_id );
} else {
$this->cart_param = $this->gateway_calculation->cart_calculation();
$order_total = WC()->cart->total;
Expand Down Expand Up @@ -537,6 +543,7 @@ public function angelleye_set_express_checkout_request() {
);

if( empty($_GET['pay_for_order']) ) {

$post_data = WC()->session->get('post_data');
if (!empty($post_data)) {
$SECFields['addroverride'] = WC()->cart->needs_shipping() ? 1 : 0;
Expand Down

0 comments on commit c2278fa

Please sign in to comment.