Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:51:52-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13229 2011-12-20T09:51:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=57988#p57988 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: December 20, 2011, 9:52 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 20th, 2011, 9:51 am


]]>
2011-12-07T01:04:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=55670#p55670 <![CDATA[s2Member v111206 / Source Code: s2member-p...]]>
s2Member v111206
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: December 7, 2011, 1:05 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 7th, 2011, 1:04 am


]]>
2011-11-05T19:27:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=52044#p52044 <![CDATA[s2Member v111105 / Source Code: s2member-p...]]>
s2Member v111105
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: November 5, 2011, 8:27 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — November 5th, 2011, 7:27 pm


]]>
2011-10-29T20:37:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=50140#p50140 <![CDATA[s2Member v111029 / Source Code: s2member-p...]]>
s2Member v111029
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: October 29, 2011, 9:37 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 29th, 2011, 8:37 pm


]]>
2011-10-17T15:41:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=47934#p47934 <![CDATA[s2Member v111017 / Source Code: s2member-p...]]>
s2Member v111017
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: October 17, 2011, 1:41 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 17th, 2011, 3:41 pm


]]>
2011-10-11T14:37:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=46336#p46336 <![CDATA[s2Member v111011 / Source Code: s2member-p...]]>
s2Member v111011
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: October 11, 2011, 12:37 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 11th, 2011, 2:37 pm


]]>
2011-10-03T15:49:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=44465#p44465 <![CDATA[s2Member v111003 / Source Code: s2member-p...]]>
s2Member v111003
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: October 3, 2011, 1:49 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:49 pm


]]>
2011-10-03T03:43:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=43172#p43172 <![CDATA[s2Member v111002 / Source Code: s2member-p...]]>
s2Member v111002
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: October 3, 2011, 1:43 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:43 am


]]>
2011-09-27T05:28:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=41414#p41414 <![CDATA[s2Member v110927 / Source Code: s2member-p...]]>
s2Member v110927
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: September 27, 2011, 3:28 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 27th, 2011, 5:28 am


]]>
2011-09-26T21:04:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=40170#p40170 <![CDATA[s2Member v110926 / Source Code: s2member-p...]]>
s2Member v110926
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: September 26, 2011, 7:05 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 26th, 2011, 9:04 pm


]]>
2011-09-17T17:03:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=38314#p38314 <![CDATA[s2Member v110915 / Source Code: s2member-p...]]>
s2Member v110915
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: September 17, 2011, 3:04 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 17th, 2011, 5:03 pm


]]>
2011-09-14T01:29:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=36892#p36892 <![CDATA[s2Member v110913 / Source Code: s2member-p...]]>
s2Member v110913
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: September 13, 2011, 11:29 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 14th, 2011, 1:29 am


]]>
2011-09-13T12:04:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=35620#p35620 <![CDATA[s2Member v110912 / Source Code: s2member-p...]]>
s2Member v110912
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: September 13, 2011, 10:04 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 13th, 2011, 12:04 pm


]]>
2011-08-15T15:17:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=31728#p31728 <![CDATA[s2Member v110815 / Source Code: s2member-p...]]>
s2Member v110815
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: August 15, 2011, 4:17 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php ?php /** * ClickBank® IPN Handler ( inner processing routines ). * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * This WordPress® plugin ( s2Member Pro ) is comprised of two parts: * * o (1) Its PHP code is licensed under the GPL license, as is WordPress®. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * o (2) All other parts of ( s2Member Pro ); including, but not limited to: * the CSS code, some JavaScript code, images, and design; * are licensed according to the license purchased. * See: {@link http://www.s2member.com/prices/} * * Unless you have our prior written consent, you must NOT directly or indirectly license, * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module; * or make an offer to do any of these things. All of these things are strictly * prohibited with part (2) of the s2Member Pro Module. * * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com * ( i.e. new features, bug fixes, updates, improvements ); along with full access * to our video tutorial library: {@link http://www.s2member.com/videos/} * * @package s2Member\ClickBank * @since 1.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_pro_clickbank_notify_in" ) ) { /** * ClickBank® IPN Handler ( inner processing routines ). * * @package s2Member\ClickBank * @since 1.5 */ class c_ws_plugin__s2member_pro_clickbank_notify_in { /** * Handles ClickBank® IPN URL processing. * * @package s2Member\ClickBank * @since 1.5 * * @attaches-to ``add_action("init");`` * * @return null Or exits script execution after handling the Notification. */ public static function clickbank_notify ( ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ if ( ! empty ( $_GET [ "s2member_pro_clickbank_notify" ] ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_clickbank_username" ] ) { @ ignore_user_abort ( true ) ; /* Continue processing even if/when connection is broken by the sender. */ /**/ if ( is_array ( $clickbank = c_ws_plugin__s2member_pro_clickbank_utilities:: clickbank_postvars ( ) ) && ( $_clickbank = $clickbank ) ) { $clickbank [ "s2member_log" ] [ ] = "IPN received on: " . date ( "D M j, Y g:i:s a T" ) ; $clickbank [ "s2member_log" ] [ ] = "s2Member POST vars verified with ClickBank®." ; /**/ wp_parse_str ( $clickbank [ "cvendthru" ] , $s2vars ) ; /* Parse all the s2_ variables. */ /**/ if ( isset ( $s2vars [ "s2_p1" ] ) && $s2vars [ "s2_p1" ] === "0 D" ) /* Initial Period. */ $s2vars [ "s2_p1" ] = $s2vars [ "s2_p3" ] ; /* No Trial defaults to Regular Period. */ /**/ $clickbank [ "s2vars" ] = $s2vars ; /* So they appear in the log entry for this Notification. */ /**/ if ( preg_match ( "/^(TEST_)?SALE$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^STANDARD$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as ( `SALE/STANDARD` )." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `web_accept` )." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "web_accept" ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_gross" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?SALE$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as ( `SALE/RECURRING` )." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `subscr_signup` )." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_signup" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; $ipn [ "recurring" ] = ( $clickbank [ "cfuturepayments" ] 1 ) ? "1" : "0" ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "period1" ] = $s2vars [ "s2_p1" ] ; $ipn [ "period3" ] = $s2vars [ "s2_p3" ] ; /**/ $ipn [ "mc_amount1" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_amount3" ] = number_format ( $clickbank [ "crebillamnt" ] / 100 , 2 , "." , "" ) ; /**/ $ipn [ "mc_gross" ] = ( preg_match ( "/^[1-9]/" , $ipn [ "period1" ] ) ) ? $ipn [ "mc_amount1" ] : $ipn [ "mc_amount3" ] ; /**/ $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= ( $ipn [ "mc_gross" ] 0 ) ? ",subscr-signup-as-subscr-payment" : "" ; /* Use as first payment? */ $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?BILL$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as ( `BILL/RECURRING` )." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `subscr_payment` )." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_payment" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_gross" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?(RFND|CGBK|INSF)$/i" , $clickbank [ "ctransaction" ] ) ) /* Product Type irrelevant here; checked below. */ { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as ( `RFND|CGBK|INSF` )." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `payment_status` ( `refunded|reversed` )." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "payment_status" ] = ( preg_match ( "/^(TEST_)?RFND$/" , $clickbank [ "ctransaction" ] ) ) ? "refunded" : "reversed" ; /**/ $ipn [ "parent_txn_id" ] = ( preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) && $s2vars [ "s2_subscr_id" ] ) ? $s2vars [ "s2_subscr_id" ] : $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_fee" ] = "-" . number_format ( "0.00" , 2 , "." , "" ) ; $ipn [ "mc_gross" ] = "-" . number_format ( abs ( $clickbank [ "corderamount" ] ) / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = "-" . number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ if ( /* Here we handle Recurring cancellations, and/or EOT ( End Of Term ) through $clickbank["crebillstatus"]. */ ( preg_match ( "/^(TEST_)?(SALE|BILL)$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) && ( preg_match ( "/^COMPLETED$/i" , $clickbank [ "crebillstatus" ] ) || $clickbank [ "cfuturepayments" ] = 0 ) ) /**/ || ( preg_match ( "/^(TEST_)?CANCEL-REBILL$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as ( `RECURRING/COMPLETED` or `CANCEL-REBILL` )." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `subscr_cancel` )." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_cancel" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "period1" ] = $s2vars [ "s2_p1" ] ; $ipn [ "period3" ] = $s2vars [ "s2_p3" ] ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ if ( ! $processed ) /* If nothing was processed, here we add a message to the logs indicating the IPN was ignored. */ $clickbank [ "s2member_log" ] [ ] = "Ignoring this IPN request. The transaction does NOT require any action on the part of s2Member." ; } else /* Extensive log reporting here. This is an area where many site owners find trouble. Depending on server configuration; remote HTTPS connections may fail. */ { $clickbank [ "s2member_log" ] [ ] = "Unable to verify POST vars. This is most likely related to an invalid ClickBank® configuration. Please check: s2Member - ClickBank® Options." ; $clickbank [ "s2member_log" ] [ ] = "If you're absolutely SURE that your ClickBank® configuration is valid, you may want to run some tests on your server, just to be sure \$_POST variables are populated, and that your server is able to connect to ClickBank® over an HTTPS connection." ; $clickbank [ "s2member_log" ] [ ] = "s2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows® server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows® server." ; $clickbank [ "s2member_log" ] [ ] = var_export ( $_REQUEST , true ) ; /* Recording _POST + _GET vars for analysis and debugging. */ } /* If debugging/logging is enabled; we need to append $clickbank to the log file. Logging now supports Multisite Networking as well. */ $logv = c_ws_plugin__s2member_utilities:: ver_details ( ) ; $logm = c_ws_plugin__s2member_utilities:: mem_details ( ) ; $log4 = $_SERVER [ "HTTP_HOST" ] . $_SERVER [ "REQUEST_URI" ] . "\nUser-Agent: " . $_SERVER [ "HTTP_USER_AGENT" ] ; $log4 = ( is_multisite ( ) && ! is_main_site ( ) ) ? ( $_log4 = $current_blog - domain . $current_blog - path ) . "\n" . $log4 : $log4 ; $log2 = ( is_multisite ( ) && ! is_main_site ( ) ) ? "clickbank-ipn-4-" . trim ( preg_replace ( "/[^a-z0-9]/i" , "-" , $_log4 ) , "-" ) . ".log" : "clickbank-ipn.log" ; /**/ if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "gateway_debug_logs" ] ) if ( is_dir ( $logs_dir = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "logs_dir" ] ) ) if ( is_writable ( $logs_dir ) && c_ws_plugin__s2member_utils_logs:: archive_oversize_log_files ( ) ) file_put_contents ( $logs_dir . "/" . $log2 , $logv . "\n" . $logm . "\n" . $log4 . "\n" . var_export ( $clickbank , true ) . "\n \n" , FILE_APPEND) ; /**/ header ( "HTTP/1.0 200 OK" ) ; /* Send a 200 OK status header. */ exit ( ) ; /* Exit now. */ } } } } ? [ full view ]s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — August 15th, 2011, 3:17 pm


]]>
2011-07-11T17:34:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=27894#p27894 <![CDATA[s2Member v110710 / Source Code: s2member-p...]]>
s2Member v110710
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: July 11, 2011, 6:34 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php ?php /** * ClickBank® IPN Handler ( inner processing routines ). * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * This WordPress® plugin ( s2Member Pro ) is comprised of two parts: * * o (1) Its PHP code is licensed under the GPL license, as is WordPress®. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * o (2) All other parts of ( s2Member Pro ); including, but not limited to: * the CSS code, some JavaScript code, images, and design; * are licensed according to the license purchased. * See: {@link http://www.s2member.com/prices/} * * Unless you have our prior written consent, you must NOT directly or indirectly license, * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module; * or make an offer to do any of these things. All of these things are strictly * prohibited with part (2) of the s2Member Pro Module. * * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com * ( i.e. new features, bug fixes, updates, improvements ); along with full access * to our video tutorial library: {@link http://www.s2member.com/videos/} * * @package s2Member\ClickBank * @since 1.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_pro_clickbank_notify_in" ) ) { /** * ClickBank® IPN Handler ( inner processing routines ). * * @package s2Member\ClickBank * @since 1.5 */ class c_ws_plugin__s2member_pro_clickbank_notify_in { /** * Handles ClickBank® IPN URL processing. * * @package s2Member\ClickBank * @since 1.5 * * @attaches-to ``add_action("init");`` * * @return null Or exits script execution after handling the Notification. */ public static function clickbank_notify ( ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ if ( ! empty ( $_GET [ "s2member_pro_clickbank_notify" ] ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_clickbank_username" ] ) { @ ignore_user_abort ( true ) ; /* Continue processing even if/when connection is broken by the sender. */ /**/ if ( is_array ( $clickbank = c_ws_plugin__s2member_pro_clickbank_utilities:: clickbank_postvars ( ) ) && ( $_clickbank = $clickbank ) ) { $clickbank [ "s2member_log" ] [ ] = "IPN received on: " . date ( "D M j, Y g:i:s a T" ) ; $clickbank [ "s2member_log" ] [ ] = "s2Member POST vars verified with ClickBank®." ; /**/ wp_parse_str ( $clickbank [ "cvendthru" ] , $s2vars ) ; /* Parse all the s2_ variables. */ /**/ if ( isset ( $s2vars [ "s2_p1" ] ) && $s2vars [ "s2_p1" ] === "0 D" ) /* Initial Period. */ $s2vars [ "s2_p1" ] = $s2vars [ "s2_p3" ] ; /* No Trial defaults to Regular Period. */ /**/ $clickbank [ "s2vars" ] = $s2vars ; /* So they appear in the log entry for this Notification. */ /**/ if ( preg_match ( "/^(TEST_)?SALE$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^STANDARD$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as (SALE/STANDARD)." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as txn_type (web_accept)." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "web_accept" ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_gross" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?SALE$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as (SALE/RECURRING)." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as txn_type (subscr_signup)." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_signup" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; $ipn [ "recurring" ] = ( $clickbank [ "cfuturepayments" ] 1 ) ? "1" : "0" ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "period1" ] = $s2vars [ "s2_p1" ] ; $ipn [ "period3" ] = $s2vars [ "s2_p3" ] ; /**/ $ipn [ "mc_amount1" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_amount3" ] = number_format ( $clickbank [ "crebillamnt" ] / 100 , 2 , "." , "" ) ; /**/ $ipn [ "mc_gross" ] = ( preg_match ( "/^[1-9]/" , $ipn [ "period1" ] ) ) ? $ipn [ "mc_amount1" ] : $ipn [ "mc_amount3" ] ; /**/ $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= ( $ipn [ "mc_gross" ] 0 ) ? ",subscr-signup-as-subscr-payment" : "" ; /* Use as first payment? */ $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?BILL$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as (BILL/RECURRING)." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as txn_type (subscr_payment)." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_payment" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; /**/ $ipn [ "txn_id" ] = $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_gross" ] = number_format ( $clickbank [ "corderamount" ] / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ else if ( preg_match ( "/^(TEST_)?(RFND|CGBK|INSF)$/i" , $clickbank [ "ctransaction" ] ) ) /* Product Type irrelevant here; checked below. */ { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as (RFND|CGBK|INSF)." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as payment_status (refunded|reversed)." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "payment_status" ] = ( preg_match ( "/^(TEST_)?RFND$/" , $clickbank [ "ctransaction" ] ) ) ? "refunded" : "reversed" ; /**/ $ipn [ "parent_txn_id" ] = ( preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) && $s2vars [ "s2_subscr_id" ] ) ? $s2vars [ "s2_subscr_id" ] : $clickbank [ "ctransreceipt" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "mc_fee" ] = "-" . number_format ( "0.00" , 2 , "." , "" ) ; $ipn [ "mc_gross" ] = "-" . number_format ( abs ( $clickbank [ "corderamount" ] ) / 100 , 2 , "." , "" ) ; $ipn [ "mc_currency" ] = strtoupper ( $clickbank [ "ccurrency" ] ) ; $ipn [ "tax" ] = "-" . number_format ( "0.00" , 2 , "." , "" ) ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ if ( /* Here we handle Recurring cancellations, and/or EOT ( End Of Term ) through $clickbank["crebillstatus"]. */ ( preg_match ( "/^(TEST_)?(SALE|BILL)$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) && ( preg_match ( "/^COMPLETED$/i" , $clickbank [ "crebillstatus" ] ) || $clickbank [ "cfuturepayments" ] = 0 ) ) /**/ || ( preg_match ( "/^(TEST_)?CANCEL-REBILL$/i" , $clickbank [ "ctransaction" ] ) && preg_match ( "/^RECURRING$/i" , $clickbank [ "cprodtype" ] ) ) ) { $clickbank [ "s2member_log" ] [ ] = "ClickBank® transaction identified as (RECURRING/COMPLETED or CANCEL-REBILL)." ; $clickbank [ "s2member_log" ] [ ] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as txn_type (subscr_cancel)." ; $clickbank [ "s2member_log" ] [ ] = "Please check PayPal® IPN logs for further processing details." ; /**/ $processing = $processed = true ; $ipn = array ( ) ; /* Reset. */ /**/ $ipn [ "txn_type" ] = "subscr_cancel" ; $ipn [ "subscr_id" ] = $s2vars [ "s2_subscr_id" ] ; /**/ $ipn [ "custom" ] = $s2vars [ "s2_custom" ] ; /**/ $ipn [ "period1" ] = $s2vars [ "s2_p1" ] ; $ipn [ "period3" ] = $s2vars [ "s2_p3" ] ; /**/ $ipn [ "payer_email" ] = $clickbank [ "ccustemail" ] ; $ipn [ "first_name" ] = ucwords ( strtolower ( $clickbank [ "ccustfirstname" ] ) ) ; $ipn [ "last_name" ] = ucwords ( strtolower ( $clickbank [ "ccustlastname" ] ) ) ; /**/ $ipn [ "option_name1" ] = ( $s2vars [ "s2_referencing" ] ) ? "Referencing Customer ID" : "Originating Domain" ; $ipn [ "option_selection1" ] = ( $s2vars [ "s2_referencing" ] ) ? $s2vars [ "s2_referencing" ] : $_SERVER [ "HTTP_HOST" ] ; /**/ $ipn [ "option_name2" ] = "Customer IP Address" ; $ipn [ "option_selection2" ] = $s2vars [ "s2_customer_ip" ] ; /**/ $ipn [ "item_number" ] = $s2vars [ "s2_invoice" ] ; $ipn [ "item_name" ] = $s2vars [ "s2_desc" ] ; /**/ $ipn_q = "&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=standard-emails" ; $ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities:: paypal_proxy_key_gen ( ) ) ; /**/ c_ws_plugin__s2member_utils_urls:: remote ( site_url ( "/?s2member_paypal_notify=1" . $ipn_q ) , $ipn , array ( "timeout" = 20 ) ) ; } /**/ if ( ! $processed ) /* If nothing was processed, here we add a message to the logs indicating the IPN was ignored. */ $clickbank [ "s2member_log" ] [ ] = "Ignoring this IPN request. The transaction does NOT require any action on the part of s2Member." ; } else /* Extensive log reporting here. This is an area where many site owners find trouble. Depending on server configuration; remote HTTPS connections may fail. */ { $clickbank [ "s2member_log" ] [ ] = "Unable to verify POST vars. This is most likely related to an invalid ClickBank® configuration. Please check: s2Member - ClickBank® Options." ; $clickbank [ "s2member_log" ] [ ] = "If you're absolutely SURE that your ClickBank® configuration is valid, you may want to run some tests on your server, just to be sure \$_POST variables are populated, and that your server is able to connect to ClickBank® over an HTTPS connection." ; $clickbank [ "s2member_log" ] [ ] = "s2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows® server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows® server." ; $clickbank [ "s2member_log" ] [ ] = var_export ( $_REQUEST , true ) ; /* Recording _POST + _GET vars for analysis and debugging. */ } /* If debugging/logging is enabled; we need to append $clickbank to the log file. Logging now supports Multisite Networking as well. */ $logv = c_ws_plugin__s2member_utilities:: ver_details ( ) ; $log4 = $_SERVER [ "HTTP_HOST" ] . $_SERVER [ "REQUEST_URI" ] . "\nUser-Agent: " . $_SERVER [ "HTTP_USER_AGENT" ] ; $log4 = ( is_multisite ( ) && ! is_main_site ( ) ) ? ( $_log4 = $current_blog - domain . $current_blog - path ) . "\n" . $log4 : $log4 ; $log2 = ( is_multisite ( ) && ! is_main_site ( ) ) ? "clickbank-ipn-4-" . trim ( preg_replace ( "/[^a-z0-9]/i" , "-" , $_log4 ) , "-" ) . ".log" : "clickbank-ipn.log" ; /**/ if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "gateway_debug_logs" ] ) if ( is_dir ( $logs_dir = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "logs_dir" ] ) ) if ( is_writable ( $logs_dir ) && c_ws_plugin__s2member_utils_logs:: archive_oversize_log_files ( ) ) file_put_contents ( $logs_dir . "/" . $log2 , $logv . "\n" . $log4 . "\n" . var_export ( $clickbank , true ) . "\n \n" , FILE_APPEND) ; /**/ header ( "HTTP/1.0 200 OK" ) ; /* Send a 200 OK status header. */ exit ( ) ; /* Exit now. */ } } } } ? [ full view ]s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — July 11th, 2011, 5:34 pm


]]>
2011-07-09T06:15:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13229&p=25524#p25524 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\gateways\clickbank\clickbank-notify-in.inc.php
Docs updated: December 20, 2011, 9:52 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — July 9th, 2011, 6:15 am


]]>