Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:52:00-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13245 2011-12-20T09:52:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=58004#p58004 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:52 am


]]>
2011-12-07T01:05:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=55686#p55686 <![CDATA[s2Member v111206 / Source Code: s2member-p...]]>
s2Member v111206
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:05 am


]]>
2011-11-05T19:27:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=52060#p52060 <![CDATA[s2Member v111105 / Source Code: s2member-p...]]>
s2Member v111105
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=50156#p50156 <![CDATA[s2Member v111029 / Source Code: s2member-p...]]>
s2Member v111029
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=47950#p47950 <![CDATA[s2Member v111017 / Source Code: s2member-p...]]>
s2Member v111017
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=46352#p46352 <![CDATA[s2Member v111011 / Source Code: s2member-p...]]>
s2Member v111011
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=44481#p44481 <![CDATA[s2Member v111003 / Source Code: s2member-p...]]>
s2Member v111003
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=43188#p43188 <![CDATA[s2Member v111002 / Source Code: s2member-p...]]>
s2Member v111002
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=41430#p41430 <![CDATA[s2Member v110927 / Source Code: s2member-p...]]>
s2Member v110927
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:05:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=40186#p40186 <![CDATA[s2Member v110926 / Source Code: s2member-p...]]>
s2Member v110926
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:05 pm


]]>
2011-09-17T17:04:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=38330#p38330 <![CDATA[s2Member v110915 / Source Code: s2member-p...]]>
s2Member v110915
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:04 pm


]]>
2011-09-14T01:29:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=36908#p36908 <![CDATA[s2Member v110913 / Source Code: s2member-p...]]>
s2Member v110913
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=35636#p35636 <![CDATA[s2Member v110912 / Source Code: s2member-p...]]>
s2Member v110912
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=31744#p31744 <![CDATA[s2Member v110815 / Source Code: s2member-p...]]>
s2Member v110815
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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\google\google-utilities.inc.php ?php /** * Google® utilities. * * 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\Google * @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_google_utilities" ) ) { /** * Google® utilities. * * @package s2Member\Google * @since 1.5 */ class c_ws_plugin__s2member_pro_google_utilities { /** * Builds an HMAC-SHA1 encrypted hash for XML data transfer verification. * * @package s2Member\Google * @since 1.5 * * @param str $data An XML data string to sign. * @return str An HMAC-SHA1 hash with key encryption. */ public static function google_sign ( $data = FALSE ) { $key = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_key" ] ; $key = str_pad ( ( ( strlen ( $key ) 64 ) ? pack ( 'H*' , sha1 ( $key ) ) : $key ) , 64 , chr ( 0x00 ) ) ; return pack ( 'H*' , sha1 ( ( $key ^ str_repeat ( chr ( 0x5c ) , 64 ) ) . pack ( 'H*' , sha1 ( ( $key ^ str_repeat ( chr ( 0x36 ) , 64 ) ) . $data ) ) ) ) ; } /** * Formulates request Authorization headers. * * @package s2Member\Google * @since 1.5 * * @return array Request Authorization headers for Google® API communication. */ public static function google_api_headers ( ) { $req [ "headers" ] [ "Accept" ] = "application/xml; charset=UTF-8" ; $req [ "headers" ] [ "Content-Type" ] = "application/xml; charset=UTF-8" ; $req [ "headers" ] [ "Authorization" ] = "Basic " . base64_encode ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] . ":" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_key" ] ) ; /**/ return $req ; /* Return array with headers.*/ } /** * Converts a "Period Term" into a Google® periodicity for XML subscription attribute. * * @package s2Member\Google * @since 1.5 * * @param str $period_term A "Period Term" combination. * @return str The Google® Checkout equivalent for ``$period_term``. * One of `DAILY`, `WEEKLY`, `SEMI_MONTHLY`, `MONTHLY`, `EVERY_TWO_MONTHS`, `QUARTERLY`, or `YEARLY`. * Defaults to `MONTHLY` if ``$period_term`` is not configured properly. */ public static function google_periodicity ( $period_term = FALSE ) { list ( $num , $span ) = preg_split ( "/ /" , strtoupper ( $period_term ) , 2 ) ; $num = (int) $num ; /* Force this to an integer. */ /**/ if ( $num === 1 && $span === "D" ) return "DAILY" ; /**/ else if ( $num === 1 && $span === "W" ) return "WEEKLY" ; /**/ else if ( $num === 2 && $span === "W" ) return "SEMI_MONTHLY" ; /**/ else if ( $num === 1 && $span === "M" ) return "MONTHLY" ; /**/ else if ( $num === 2 && $span === "M" ) return "EVERY_TWO_MONTHS" ; /**/ else if ( $num === 3 && $span === "M" ) return "QUARTERLY" ; /**/ else if ( $num === 1 && $span === "Y" ) return "YEARLY" ; /**/ return "MONTHLY" ; } /** * Parses s2Vars from Google® IPN Notifications. * * @package s2Member\Google * @since 1.5 * * @param str $xml XML data section returned by Google® for s2Vars. * @return array|bool An array of s2Vars, else false on failure. */ public static function google_parse_s2vars ( $xml = FALSE ) { if ( preg_match_all ( "/([^\]+)([^\]+)\/([^\]+)/" , $xml , $m ) && is_array ( $m [ 1 ] ) ) { foreach ( $m [ 1 ] as $key = $var ) $s2vars [ $var ] = wp_specialchars_decode ( $m [ 2 ] [ $key ] ) ; /**/ return $s2vars ; } else return false ; } /** * Get ``$_POST`` or ``$_REQUEST`` vars from Google®. * * @package s2Member\Google * @since 1.5 * * @return array|bool An array of verified ``$_POST`` or ``$_REQUEST`` variables, else false. * * @todo Continue optimizing this routine with ``empty()`` and ``isset()``. * @todo Candidate for the use of ``ifsetor()``? */ public static function google_postvars ( ) { if ( ! empty ( $_REQUEST [ "s2member_pro_google_notify" ] ) && ! empty ( $_REQUEST [ "serial-number" ] ) ) { $_request = c_ws_plugin__s2member_utils_strings:: trim_deep ( stripslashes_deep ( $_REQUEST ) ) ; /**/ foreach ( $_request as $var = $value ) if ( preg_match ( "/^s2member_/" , $var ) ) unset ( $_request [ $var ] ) ; /**/ $postback [ "_type" ] = "notification-history-request" ; $postback [ "serial-number" ] = $_request [ "serial-number" ] ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $response = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/reportsForm/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $postback , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ && wp_parse_str ( $response , $postvars ) !== "nill" && ! empty ( $postvars [ "_type" ] ) ) return $postvars ; /* We can return the POST vars. */ else /* Nope. Return false. */ return false ; } else /* Nope. */ return false ; } /** * Calculates start date for a Recurring Payment Profile. * * @package s2Member\Google * @since 1.5 * * @param str $period1 Optional. A "Period Term" combination. Defaults to `0 D`. * @param str $period3 Optional. A "Period Term" combination. Defaults to `0 D`. * @return int The start time, a Unix timestamp. */ public static function google_start_time ( $period1 = FALSE , $period3 = FALSE ) { if ( ! ( $p1_time = 0 ) && ( $period1 = trim ( strtoupper ( $period1 ) ) ) ) { list ( $num , $span ) = preg_split ( "/ /" , $period1 , 2 ) ; /**/ $days = 0 ; /* Days start at 0. */ /**/ if ( is_numeric ( $num ) && ! is_numeric ( $span ) ) { $days = ( $span === "D" ) ? 1 : $days ; $days = ( $span === "W" ) ? 7 : $days ; $days = ( $span === "M" ) ? 30 : $days ; $days = ( $span === "Y" ) ? 365 : $days ; } /**/ $p1_days = (int) $num * (int) $days ; $p1_time = $p1_days * 86400 ; } /**/ if ( ! ( $p3_time = 0 ) && ( $period3 = trim ( strtoupper ( $period3 ) ) ) ) { list ( $num , $span ) = preg_split ( "/ /" , $period3 , 2 ) ; /**/ $days = 0 ; /* Days start at 0. */ /**/ if ( is_numeric ( $num ) && ! is_numeric ( $span ) ) { $days = ( $span === "D" ) ? 1 : $days ; $days = ( $span === "W" ) ? 7 : $days ; $days = ( $span === "M" ) ? 30 : $days ; $days = ( $span === "Y" ) ? 365 : $days ; } /**/ $p3_days = (int) $num * (int) $days ; $p3_time = $p3_days * 86400 ; } /**/ $start_time = strtotime ( "now" ) + $p1_time + $p3_time ; /**/ $start_time = ( $start_time = 0 ) ? strtotime ( "now" ) : $start_time ; /**/ $start_time = $start_time + 43200 ; /* + 12 hours. */ /* This prevents date clashes with Google's API server. */ /**/ return $start_time ; } } } ? [ full view ]s2member-pro\includes\classes\gateways\google\google-utilities.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:35:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=27910#p27910 <![CDATA[s2Member v110710 / Source Code: s2member-p...]]>
s2Member v110710
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.inc.php
Docs updated: July 11, 2011, 6:35 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\google\google-utilities.inc.php ?php /** * Google® utilities. * * 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\Google * @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_google_utilities" ) ) { /** * Google® utilities. * * @package s2Member\Google * @since 1.5 */ class c_ws_plugin__s2member_pro_google_utilities { /** * Builds an HMAC-SHA1 encrypted hash for XML data transfer verification. * * @package s2Member\Google * @since 1.5 * * @param str $data An XML data string to sign. * @return str An HMAC-SHA1 hash with key encryption. */ public static function google_sign ( $data = FALSE ) { $key = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_key" ] ; $key = str_pad ( ( ( strlen ( $key ) 64 ) ? pack ( 'H*' , sha1 ( $key ) ) : $key ) , 64 , chr ( 0x00 ) ) ; return pack ( 'H*' , sha1 ( ( $key ^ str_repeat ( chr ( 0x5c ) , 64 ) ) . pack ( 'H*' , sha1 ( ( $key ^ str_repeat ( chr ( 0x36 ) , 64 ) ) . $data ) ) ) ) ; } /** * Formulates request Authorization headers. * * @package s2Member\Google * @since 1.5 * * @return array Request Authorization headers for Google® API communication. */ public static function google_api_headers ( ) { $req [ "headers" ] [ "Accept" ] = "application/xml; charset=UTF-8" ; $req [ "headers" ] [ "Content-Type" ] = "application/xml; charset=UTF-8" ; $req [ "headers" ] [ "Authorization" ] = "Basic " . base64_encode ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] . ":" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_key" ] ) ; /**/ return $req ; /* Return array with headers.*/ } /** * Converts a "Period Term" into a Google® periodicity for XML subscription attribute. * * @package s2Member\Google * @since 1.5 * * @param str $period_term A "Period Term" combination. * @return str The Google® Checkout equivalent for ``$period_term``. * One of `DAILY`, `WEEKLY`, `SEMI_MONTHLY`, `MONTHLY`, `EVERY_TWO_MONTHS`, `QUARTERLY`, or `YEARLY`. * Defaults to `MONTHLY` if ``$period_term`` is not configured properly. */ public static function google_periodicity ( $period_term = FALSE ) { list ( $num , $span ) = preg_split ( "/ /" , strtoupper ( $period_term ) , 2 ) ; $num = (int) $num ; /* Force this to an integer. */ /**/ if ( $num === 1 && $span === "D" ) return "DAILY" ; /**/ else if ( $num === 1 && $span === "W" ) return "WEEKLY" ; /**/ else if ( $num === 2 && $span === "W" ) return "SEMI_MONTHLY" ; /**/ else if ( $num === 1 && $span === "M" ) return "MONTHLY" ; /**/ else if ( $num === 2 && $span === "M" ) return "EVERY_TWO_MONTHS" ; /**/ else if ( $num === 3 && $span === "M" ) return "QUARTERLY" ; /**/ else if ( $num === 1 && $span === "Y" ) return "YEARLY" ; /**/ return "MONTHLY" ; } /** * Parses s2Vars from Google® IPN Notifications. * * @package s2Member\Google * @since 1.5 * * @param str $xml XML data section returned by Google® for s2Vars. * @return array|bool An array of s2Vars, else false on failure. */ public static function google_parse_s2vars ( $xml = FALSE ) { if ( preg_match_all ( "/([^\]+)([^\]+)\/([^\]+)/" , $xml , $m ) && is_array ( $m [ 1 ] ) ) { foreach ( $m [ 1 ] as $key = $var ) $s2vars [ $var ] = wp_specialchars_decode ( $m [ 2 ] [ $key ] ) ; /**/ return $s2vars ; } else return false ; } /** * Get ``$_POST`` or ``$_REQUEST`` vars from Google®. * * @package s2Member\Google * @since 1.5 * * @return array|bool An array of verified ``$_POST`` or ``$_REQUEST`` variables, else false. * * @todo Continue optimizing this routine with ``empty()`` and ``isset()``. * @todo Candidate for the use of ``ifsetor()``? */ public static function google_postvars ( ) { if ( ! empty ( $_REQUEST [ "s2member_pro_google_notify" ] ) && ! empty ( $_REQUEST [ "serial-number" ] ) ) { $_request = c_ws_plugin__s2member_utils_strings:: trim_deep ( stripslashes_deep ( $_REQUEST ) ) ; /**/ foreach ( $_request as $var = $value ) if ( preg_match ( "/^s2member_/" , $var ) ) unset ( $_request [ $var ] ) ; /**/ $postback [ "_type" ] = "notification-history-request" ; $postback [ "serial-number" ] = $_request [ "serial-number" ] ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $response = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/reportsForm/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $postback , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ && wp_parse_str ( $response , $postvars ) !== "nill" && ! empty ( $postvars [ "_type" ] ) ) return $postvars ; /* We can return the POST vars. */ else /* Nope. Return false. */ return false ; } else /* Nope. */ return false ; } /** * Calculates start date for a Recurring Payment Profile. * * @package s2Member\Google * @since 1.5 * * @param str $period1 Optional. A "Period Term" combination. Defaults to `0 D`. * @param str $period3 Optional. A "Period Term" combination. Defaults to `0 D`. * @return int The start time, a Unix timestamp. */ public static function google_start_time ( $period1 = FALSE , $period3 = FALSE ) { if ( ! ( $p1_time = 0 ) && ( $period1 = trim ( strtoupper ( $period1 ) ) ) ) { list ( $num , $span ) = preg_split ( "/ /" , $period1 , 2 ) ; /**/ $days = 0 ; /* Days start at 0. */ /**/ if ( is_numeric ( $num ) && ! is_numeric ( $span ) ) { $days = ( $span === "D" ) ? 1 : $days ; $days = ( $span === "W" ) ? 7 : $days ; $days = ( $span === "M" ) ? 30 : $days ; $days = ( $span === "Y" ) ? 365 : $days ; } /**/ $p1_days = (int) $num * (int) $days ; $p1_time = $p1_days * 86400 ; } /**/ if ( ! ( $p3_time = 0 ) && ( $period3 = trim ( strtoupper ( $period3 ) ) ) ) { list ( $num , $span ) = preg_split ( "/ /" , $period3 , 2 ) ; /**/ $days = 0 ; /* Days start at 0. */ /**/ if ( is_numeric ( $num ) && ! is_numeric ( $span ) ) { $days = ( $span === "D" ) ? 1 : $days ; $days = ( $span === "W" ) ? 7 : $days ; $days = ( $span === "M" ) ? 30 : $days ; $days = ( $span === "Y" ) ? 365 : $days ; } /**/ $p3_days = (int) $num * (int) $days ; $p3_time = $p3_days * 86400 ; } /**/ $start_time = strtotime ( "now" ) + $p1_time + $p3_time ; /**/ $start_time = ( $start_time = 0 ) ? strtotime ( "now" ) : $start_time ; /**/ $start_time = $start_time + 43200 ; /* + 12 hours. */ /* This prevents date clashes with Google's API server. */ /**/ return $start_time ; } } } ? [ full view ]s2member-pro\includes\classes\gateways\google\google-utilities.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

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


]]>
2011-07-09T06:15:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13245&p=25540#p25540 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\gateways\google\google-utilities.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


]]>