Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFW-300 #1240

Merged
merged 5 commits into from Nov 6, 2018

Add hook(s) for easily adding custom order notes through our plugin, …

…PFW-300
  • Loading branch information...
kcppdevelopers committed Nov 6, 2018
commit 6aad1b69a6627e1daf02cbe763c275f257bb8a0f
@@ -601,10 +601,12 @@ private function get_posted_card() {
if (strlen($card_start_year) == 2) {
$card_start_year += 2000;
}
$card_type = AngellEYE_Utility::card_type_from_account_number($card_number);
return (object) array(
'number' => $card_number,
'type' => '',
'type' => $card_type,
'cvc' => $card_cvc,
'exp_month' => $card_exp_month,
'exp_year' => $card_exp_year,
@@ -935,7 +937,7 @@ function do_payment($order, $card_number, $card_type, $card_exp_month, $card_exp
$pc_session_expired_error = apply_filters('angelleye_pc_session_expired_error', sprintf(__('Sorry, your session has expired. <a href=%s>Return to homepage &rarr;</a>', 'paypal-for-woocommerce'), '"' . home_url() . '"'));
wc_add_notice($pc_session_expired_error, "error");
}
$card = $this->get_posted_card();
$order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id();
$this->angelleye_load_paypal_pro_class($this->gateway, $this, $order_id);
@@ -1141,6 +1143,7 @@ function do_payment($order, $card_number, $card_type, $card_exp_month, $card_exp
$PayPalResult = $this->PayPal->DoReferenceTransaction(apply_filters('angelleye_woocommerce_paypal_pro_do_reference_transaction_request_args', $PayPalRequestData));
} else {
$PayPalResult = $this->PayPal->DoDirectPayment(apply_filters('angelleye_woocommerce_paypal_pro_do_direct_payment_request_args', $PayPalRequestData));
$token = '';
}
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
@@ -1216,6 +1219,7 @@ function do_payment($order, $card_number, $card_type, $card_exp_month, $card_exp
update_post_meta($order->get_id(), '_CVV2MATCH', $cvv2_response_code);
update_post_meta($order->get_id(), 'is_sandbox', $this->testmode);
}
do_action('ae_add_custom_order_note', $order, $card, $token, $PayPalResult);
do_action('before_save_payment_token', $order_id);
if(AngellEYE_Utility::angelleye_is_save_payment_token($this, $order_id)) {
if( !empty($_POST['wc-paypal_pro-payment-token']) && $_POST['wc-paypal_pro-payment-token'] != 'new' ) {
@@ -1722,6 +1726,7 @@ public function process_subscription_payment($order) {
$this->angelleye_reload_gateway_credentials_for_woo_subscription_renewal_order($order);
$order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id();
$this->angelleye_load_paypal_pro_class($this->gateway, $this, $order_id);
$card = $this->get_posted_card();
if (!class_exists('WC_Gateway_Calculation_AngellEYE')) {
require_once( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/classes/wc-gateway-calculations-angelleye.php' );
}
@@ -1880,6 +1885,7 @@ public function process_subscription_payment($order) {
$cvv2_response_order_note .= $cvv2_response_code;
$cvv2_response_order_note .= $cvv2_response_message != '' ? ' - ' . $cvv2_response_message : '';
$order->add_order_note($cvv2_response_order_note);
do_action('ae_add_custom_order_note', $order, $card, $token = null, $PayPalResult);
$is_sandbox = $this->testmode;
update_post_meta($order_id, 'is_sandbox', $is_sandbox);
if ($this->payment_action == "Sale") {
@@ -734,7 +734,7 @@ function do_payment($order, $card_number, $card_exp, $card_csc) {
update_post_meta($order->get_id(), '_CVV2MATCH', $cvv2_response_code);
}
$order->add_order_note($cvv2_response_order_note);
do_action('ae_pppf_custom_order_note', $order, $card, $token, $PayPalResult);
do_action('ae_add_custom_order_note', $order, $card, $token, $PayPalResult);
do_action('before_save_payment_token', $order_id);
if (AngellEYE_Utility::angelleye_is_save_payment_token($this, $order_id)) {
$TRANSACTIONID = $PayPalResult['PNREF'];
@@ -1391,7 +1391,7 @@ public function process_subscription_payment($order, $amount, $payment_token = n
$cvv2_response_order_note .= "\n";
$cvv2_response_order_note .= sprintf(__('CVV2 Match: %s', 'paypal-for-woocommerce'), $cvv2_response_code);
$order->add_order_note($cvv2_response_order_note);
do_action('ae_pppf_custom_order_note', $order, $card, $token, $PayPalResult);
do_action('ae_add_custom_order_note', $order, $card, $token, $PayPalResult);
if ($this->fraud_management_filters == 'place_order_on_hold_for_further_review' && in_array($PayPalResult['RESULT'], $this->fraud_warning_codes)) {
$order->update_status('on-hold', $PayPalResult['RESPMSG']);
$old_wc = version_compare(WC_VERSION, '3.0', '<');
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.