diff --git a/angelleye-includes/angelleye-utility.php b/angelleye-includes/angelleye-utility.php index e61d01a4e..5dbdd8ff9 100644 --- a/angelleye-includes/angelleye-utility.php +++ b/angelleye-includes/angelleye-utility.php @@ -1769,12 +1769,13 @@ public function call_paypal_pro_payflow_docapture($order, $transaction_id, $capt } else { $AMT = $capture_total; } - $AMT = self::round($AMT - $order->get_total_refunded()); + $payment_action_authorization = get_post_meta($order_id, 'payment_action_authorization', true); + if (isset($transaction_id) && !empty($transaction_id)) { $PayPalRequestData = array( 'TENDER' => 'C', // C = credit card, P = PayPal - 'TRXTYPE' => 'D', // S=Sale, A= Auth, C=Credit, D=Delayed Capture, V=Void + 'TRXTYPE' => (isset($payment_action_authorization) && $payment_action_authorization == 'Card Verification') ? 'S' : 'D', // S=Sale, A= Auth, C=Credit, D=Delayed Capture, V=Void 'ORIGID' => $transaction_id, 'AMT' => $AMT, 'CAPTURECOMPLETE' => 'N' diff --git a/classes/wc-gateway-paypal-pro-payflow-angelleye.php b/classes/wc-gateway-paypal-pro-payflow-angelleye.php index 2c3151e11..1aaa94f9d 100644 --- a/classes/wc-gateway-paypal-pro-payflow-angelleye.php +++ b/classes/wc-gateway-paypal-pro-payflow-angelleye.php @@ -47,6 +47,7 @@ function __construct() { $this->error_display_type = $this->get_option('error_display_type', 'no'); $this->send_items = 'yes' === $this->get_option('send_items', 'yes'); $this->payment_action = $this->get_option('payment_action', 'Sale'); + $this->payment_action_authorization = $this->get_option('payment_action_authorization', 'Full Authorization'); //fix ssl for image icon $this->icon = $this->get_option('card_icon', plugins_url('/assets/images/payflow-cards.png', plugin_basename(dirname(__FILE__)))); @@ -285,6 +286,17 @@ function init_form_fields() { ), 'default' => 'Sale' ), + 'payment_action_authorization' => array( + 'title' => __('Authorization Type', 'paypal-for-woocommerce'), + 'description' => __(''), + 'type' => 'select', + 'class' => 'wc-enhanced-select', + 'options' => array( + 'Full Authorization' => __('Full Authorization', 'paypal-for-woocommerce'), + 'Card Verification' => __('Card Verification', 'paypal-for-woocommerce'), + ), + 'default' => 'Full Authorization' + ), 'pending_authorization_order_status' => array( 'title' => __('Pending Authorization Order Status', 'paypal-for-woocommerce'), 'label' => __('Pending Authorization Order Status.', 'paypal-for-woocommerce'), @@ -429,9 +441,11 @@ public function admin_options() {