Skip to content

Commit

Permalink
ClickBank IPN v6 compat. See: wpsharks/s2member#256
Browse files Browse the repository at this point in the history
  • Loading branch information
JasWSInc committed Oct 2, 2014
1 parent 69a09e9 commit 2679a28
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, '.', '');

Expand All @@ -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)
)
{
Expand Down

0 comments on commit 2679a28

Please sign in to comment.