From 69a09e9a3e6f66bb8f816f443895205a0b770b32 Mon Sep 17 00:00:00 2001 From: JasWSInc Date: Thu, 2 Oct 2014 01:05:51 -0800 Subject: [PATCH] ClickBank IPN v6 compat. See: websharks/s2member#256 --- .../gateways/clickbank/clickbank-notify-in.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 33758e39..9eac8a48 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 @@ -123,7 +123,7 @@ public static function clickbank_notify() $ipn['txn_type'] = 'subscr_signup'; $ipn['subscr_id'] = $s2vars['s2_subscr_id']; - $ipn['recurring'] = $clickbank['lineItems'][0]->paymentPlay->paymentsRemaining > 0 ? '1' : '0'; + $ipn['recurring'] = $clickbank['lineItems'][0]->paymentPlan->paymentsRemaining > 0 ? '1' : '0'; $ipn['txn_id'] = $clickbank['receipt']; @@ -133,7 +133,7 @@ public static function clickbank_notify() $ipn['period3'] = $s2vars['s2_p3']; $ipn['mc_amount1'] = number_format($clickbank['totalOrderAmount'], 2, '.', ''); - $ipn['mc_amount3'] = number_format($clickbank['lineItems'][0]->paymentPlay->rebillAmount, 2, '.', ''); + $ipn['mc_amount3'] = number_format($clickbank['lineItems'][0]->paymentPlan->rebillAmount, 2, '.', ''); $ipn['mc_gross'] = (preg_match('/^[1-9]/', $ipn['period1'])) ? $ipn['mc_amount1'] : $ipn['mc_amount3']; @@ -238,8 +238,8 @@ 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]->paymentPlay->rebillStatus. - (preg_match('/^(?:TEST_)?(?:SALE|BILL)$/i', $clickbank['transactionType']) && $clickbank['lineItems'][0]->recurring && (preg_match('/^COMPLETED$/i', $clickbank['lineItems'][0]->paymentPlay->rebillStatus) || $clickbank['lineItems'][0]->paymentPlay->paymentsRemaining <= 0) && apply_filters('c_ws_plugin__s2member_pro_clickbank_notify_handles_completions', TRUE, get_defined_vars())) + 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_)?CANCEL-REBILL$/i', $clickbank['transactionType']) && $clickbank['lineItems'][0]->recurring) ) {