From 2679a28e281925289e8d9b2210696b06b5f567f4 Mon Sep 17 00:00:00 2001 From: JasWSInc Date: Thu, 2 Oct 2014 01:10:52 -0800 Subject: [PATCH] ClickBank IPN v6 compat. See: websharks/s2member#256 --- .../classes/gateways/clickbank/clickbank-notify-in.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s2member-pro/includes/classes/gateways/clickbank/clickbank-notify-in.inc.php b/s2member-pro/includes/classes/gateways/clickbank/clickbank-notify-in.inc.php index 9eac8a48..c281054e 100644 --- a/s2member-pro/includes/classes/gateways/clickbank/clickbank-notify-in.inc.php +++ b/s2member-pro/includes/classes/gateways/clickbank/clickbank-notify-in.inc.php @@ -215,7 +215,7 @@ public static function clickbank_notify() $ipn['custom'] = $s2vars['s2_custom']; $ipn['mc_fee'] = '-'.number_format('0.00', 2, '.', ''); - $ipn['mc_gross'] = '-'.number_format(abs($clickbank['totalOrderAmount']), 2, '.', ''); // @TODO + $ipn['mc_gross'] = '-'.number_format(abs($clickbank['totalOrderAmount']), 2, '.', ''); // @TODO Check if this is correct. $ipn['mc_currency'] = strtoupper($clickbank['currency']); $ipn['tax'] = '-'.number_format('0.00', 2, '.', ''); @@ -239,7 +239,7 @@ public static function clickbank_notify() c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), $ipn, array('timeout' => 20)); } if( // Here we handle Recurring cancellations, and/or EOT (End Of Term) through $clickbank['lineItems'][0]->paymentPlan->rebillStatus. - (preg_match('/^(?:TEST_)?(?:SALE|BILL)$/i', $clickbank['transactionType']) && $clickbank['lineItems'][0]->recurring && (preg_match('/^COMPLETED$/i', $clickbank['lineItems'][0]->paymentPlan->rebillStatus) || $clickbank['lineItems'][0]->paymentPlan->paymentsRemaining <= 0) && apply_filters('c_ws_plugin__s2member_pro_clickbank_notify_handles_completions', TRUE, get_defined_vars())) + (preg_match('/^(?:TEST_)?(?:SALE|BILL)$/i', $clickbank['transactionType']) && $clickbank['lineItems'][0]->recurring && (preg_match('/^COMPLET(?:ED)?$/i', $clickbank['lineItems'][0]->paymentPlan->rebillStatus) || $clickbank['lineItems'][0]->paymentPlan->paymentsRemaining <= 0) && apply_filters('c_ws_plugin__s2member_pro_clickbank_notify_handles_completions', TRUE, get_defined_vars())) || (preg_match('/^(?:TEST_)?CANCEL-REBILL$/i', $clickbank['transactionType']) && $clickbank['lineItems'][0]->recurring) ) {