Skip to content

Commit

Permalink
Express Checkout User Not Created, ref #974
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Jan 2, 2018
1 parent 608f542 commit 42e8721
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1321,20 +1321,19 @@ public function angelleye_process_refund($order_id, $amount = null, $reason = ''

public function angelleye_process_customer($order_id) {
$post_data = WC()->session->get( 'post_data' );
$paypal_express_checkout = WC()->session->get('paypal_express_checkout');
if( !empty($post_data) && !empty($post_data['billing_first_name']) && !empty($post_data['billing_last_name']) && !empty($post_data['billing_email']) ) {
$first_name = $post_data['billing_first_name'];
$last_name = $post_data['billing_last_name'];
$email = $post_data['billing_email'];
$first_name = !empty($post_data['billing_first_name']) ? $post_data['billing_first_name'] : '';
$last_name = !empty($post_data['billing_last_name']) ? $post_data['billing_last_name'] : '';
$email = !empty($post_data['billing_email']) ? $post_data['billing_email'] : '';
} else {
$paypal_express_checkout = WC()->session->get('paypal_express_checkout');
if( !empty($paypal_express_checkout) ) {
if( !empty ($paypal_express_checkout) ) {
$first_name = !empty($paypal_express_checkout['ExpresscheckoutDetails']['FIRSTNAME']) ? $paypal_express_checkout['ExpresscheckoutDetails']['FIRSTNAME'] : '';
$last_name = !empty($paypal_express_checkout['ExpresscheckoutDetails']['LASTNAME']) ? $paypal_express_checkout['ExpresscheckoutDetails']['LASTNAME'] : '';
$email = !empty($paypal_express_checkout['ExpresscheckoutDetails']['EMAIL']) ? $paypal_express_checkout['ExpresscheckoutDetails']['EMAIL'] : '';

}
}
}
if( empty($first_name) || empty($last_name) || empty($email)) {
if( !empty($email)) {
if (email_exists($email)) {
$customer_id = email_exists($email);
} else {
Expand Down

0 comments on commit 42e8721

Please sign in to comment.