Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:51:56-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13238 2011-12-20T09:51:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=57997#p57997 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:05:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=55679#p55679 <![CDATA[s2Member v111206 / Source Code: s2member-p...]]>
s2Member v111206
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:05 am


]]>
2011-11-05T19:27:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=52053#p52053 <![CDATA[s2Member v111105 / Source Code: s2member-p...]]>
s2Member v111105
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=50149#p50149 <![CDATA[s2Member v111029 / Source Code: s2member-p...]]>
s2Member v111029
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=47943#p47943 <![CDATA[s2Member v111017 / Source Code: s2member-p...]]>
s2Member v111017
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=46345#p46345 <![CDATA[s2Member v111011 / Source Code: s2member-p...]]>
s2Member v111011
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=44474#p44474 <![CDATA[s2Member v111003 / Source Code: s2member-p...]]>
s2Member v111003
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=43181#p43181 <![CDATA[s2Member v111002 / Source Code: s2member-p...]]>
s2Member v111002
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=41423#p41423 <![CDATA[s2Member v110927 / Source Code: s2member-p...]]>
s2Member v110927
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=40179#p40179 <![CDATA[s2Member v110926 / Source Code: s2member-p...]]>
s2Member v110926
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:04:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=38323#p38323 <![CDATA[s2Member v110915 / Source Code: s2member-p...]]>
s2Member v110915
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:04 pm


]]>
2011-09-14T01:29:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=36901#p36901 <![CDATA[s2Member v110913 / Source Code: s2member-p...]]>
s2Member v110913
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=35629#p35629 <![CDATA[s2Member v110912 / Source Code: s2member-p...]]>
s2Member v110912
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=31737#p31737 <![CDATA[s2Member v110815 / Source Code: s2member-p...]]>
s2Member v110815
Source Code: s2member-pro\includes\classes\gateways\google\google-co-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\google\google-co-in.inc.php ?php /** * Google® Checkout ( 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\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_co_in" ) ) { /** * Google® Checkout ( inner processing routines ). * * @package s2Member\Google * @since 1.5 */ class c_ws_plugin__s2member_pro_google_co_in { /** * Handles Google® XML Checkout redirections. * * @package s2Member\Google * @since 1.5 * * @attaches-to ``add_action("init");`` * * @return null Or exits script execution after redirection to Google® Checkout. */ public static function google_co ( ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ if ( ! empty ( $_GET [ "s2member_pro_google_co" ] ) && ! empty ( $_REQUEST [ "co" ] ) && is_array ( $attr = c_ws_plugin__s2member_utils_strings:: trim_deep ( stripslashes_deep ( $_REQUEST [ "co" ] ) ) ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] ) { $attr = shortcode_atts ( array ( "ids" = "0" , "exp" = "72" , "level" = "1" , "ccaps" = "" , "desc" = "" , "cc" = "USD" , "custom" = $_SERVER [ "HTTP_HOST" ] , "ta" = "0" , "tp" = "0" , "tt" = "D" , "ra" = "0.01" , "rp" = "1" , "rt" = "M" , "rr" = "1" , "modify" = "0" , "cancel" = "0" , "sp" = "0" , "image" = "default" , "output" = "anchor" ) , $attr ) ; /**/ $attr [ "tt" ] = strtoupper ( $attr [ "tt" ] ) ; /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */ $attr [ "rt" ] = strtoupper ( $attr [ "rt" ] ) ; /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */ $attr [ "rr" ] = strtoupper ( $attr [ "rr" ] ) ; /* Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts(). */ $attr [ "ccaps" ] = strtolower ( $attr [ "ccaps" ] ) ; /* Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts(). */ $attr [ "rr" ] = ( $attr [ "rt" ] === "L" ) ? "BN" : $attr [ "rr" ] ; /* Lifetime Subscriptions require Buy Now. Only after running shortcode_atts(). */ $attr [ "rr" ] = ( ! $attr [ "tp" ] && ! $attr [ "rr" ] ) ? "BN" : $attr [ "rr" ] ; /* No Trial / non-recurring. Only after running shortcode_atts(). */ /**/ if ( $attr [ "modify" ] || $attr [ "cancel" ] ) /* This is a special routine for Google® Modifications/Cancellations ( one in the same ). */ { $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ wp_redirect ( "https://" . $endpoint . "/" ) ; } /**/ else if ( $attr [ "sp" ] ) /* This is a special routine for Specific Posts/Pages. These use a different XML layout/model. */ { $attr [ "uniqid" ] = uniqid ( ) ; /* Unique ID. Used in the Transaction ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "sp_ids_exp" ] = "sp:" . $attr [ "ids" ] . ":" . $attr [ "exp" ] ; /* Combined "sp:ids:expiration hours". */ $attr [ "sp_access_link" ] = c_ws_plugin__s2member_sp_access:: sp_access_link_gen ( $attr [ "ids" ] , $attr [ "exp" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(TID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Grants you immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_txn_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_txn_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_item_number' . esc_html ( $attr [ "sp_ids_exp" ] ) . '/s2_item_number' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "sp_access_link" ] ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( $attr [ "sp_access_link" ] ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ else if ( $attr [ "rr" ] === "BN" || ( ! $attr [ "tp" ] && ! $attr [ "rr" ] ) ) /* This is a special routine for Buy Now Subscriptions. */ { $attr [ "desc" ] = ( ! $attr [ "desc" ] ) ? $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "level" . $attr [ "level" ] . "_label" ] : $attr [ "desc" ] ; /**/ $attr [ "uniqid" ] = uniqid ( ) ; /* Unique ID. Used in the Transaction ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "level_ccaps_eotper" ] = ( $attr [ "rt" ] !== "L" ) ? $attr [ "level" ] . ":" . $attr [ "ccaps" ] . ":" . $attr [ "rp" ] . " " . $attr [ "rt" ] : $attr [ "level" ] . ":" . $attr [ "ccaps" ] ; $attr [ "level_ccaps_eotper" ] = rtrim ( $attr [ "level_ccaps_eotper" ] , ":" ) ; /* Right-trim separators from this string so we don't have trailing colons. */ /**/ $attr [ "register_access_link" ] = c_ws_plugin__s2member_register_access:: register_link_gen ( "google" , "s2-" . $attr [ "uniqid" ] , $attr [ "custom" ] , $attr [ "level_ccaps_eotper" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(TID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Grants you immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_txn_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_txn_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account that is already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ else /* Else, it's an actual "Subscription"; use Membership routines. This may or may NOT be associated w/ recurring charges. */ { $attr [ "desc" ] = ( ! $attr [ "desc" ] ) ? $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "level" . $attr [ "level" ] . "_label" ] : $attr [ "desc" ] ; /**/ $attr [ "uniqid" ] = uniqid ( ) ; /* Unique ID. Used as the Subscription ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "level_ccaps_eotper" ] = $attr [ "level" ] . ":" . $attr [ "ccaps" ] ; /* Actual Subscriptions will always end on their own. */ $attr [ "level_ccaps_eotper" ] = rtrim ( $attr [ "level_ccaps_eotper" ] , ":" ) ; /* Clean any trailing separators from this string. */ /**/ $attr [ "periodicity" ] = c_ws_plugin__s2member_pro_google_utilities:: google_periodicity ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) ; /* Google® periodicity. */ /**/ $attr [ "register_access_link" ] = c_ws_plugin__s2member_register_access:: register_link_gen ( "google" , "s2-" . $attr [ "uniqid" ] , $attr [ "custom" ] , $attr [ "level_ccaps_eotper" ] ) ; /**/ if ( $attr [ "tp" ] ) /* An actual Subscription that includes a Trial Period; which MIGHT also be associated with multiple recurring charges. */ { $attr [ "start_time" ] = c_ws_plugin__s2member_pro_google_utilities:: google_start_time ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= ( $attr [ "ta" ] 0.01 ) ? /* This needs to change; depending on whether or not this is a 100% Free Trial offer. */ 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') 100% free trial. NO charge today./item-description' : /**/ 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') First payment for immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ta" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'descriptionYou\'ll receive an email confirmation within 15 minutes./description' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Cancel at any time to avoid ' . ( ( ! $attr [ "rr" ] ) ? 'this charge' : 'charges' ) . './item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"0.00/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account; already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= 'subscription type="google" period="' . esc_attr ( $attr [ "periodicity" ] ) . '" start-date="' . esc_attr ( date ( "Y-m-d" , $attr [ "start_time" ] ) . "T00:00:00Z" ) . '"' ; /**/ $xml .= 'payments' ; $xml .= 'subscription-payment' . ( ( ! $attr [ "rr" ] ) ? ' times="1"' : '' ) . '' ; $xml .= 'maximum-charge currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/maximum-charge' ; $xml .= '/subscription-payment' ; $xml .= '/payments' ; /**/ $xml .= 'recurrent-item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Covers ongoing access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_payment1/s2_subscr_payment' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( home_url ( "/" ) ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/recurrent-item' ; /**/ $xml .= '/subscription' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; } else if ( ! $attr [ "tp" ] && $attr [ "rr" ] ) /* This is a Subscription w/o a Trial Period; and it IS associated with multiple recurring charges. This should ALWAYS be associated with recurring charges, because of the "BN" check above that includes (!$attr["tp"] && !$attr["rr"]). In other words, we should never have a Subscription w/o a Trial Period, AND no recurring charges. That would make no sense. */ { $attr [ "start_time" ] = c_ws_plugin__s2member_pro_google_utilities:: google_start_time ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') First payment for immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'descriptionYou\'ll receive an email confirmation within 15 minutes./description' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Cancel at any time to avoid charges./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"0.00/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account that is already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= 'subscription type="google" period="' . esc_attr ( $attr [ "periodicity" ] ) . '" start-date="' . esc_attr ( date ( "Y-m-d" , $attr [ "start_time" ] ) . "T00:00:00Z" ) . '"' ; /**/ $xml .= 'payments' ; $xml .= 'subscription-payment' ; $xml .= 'maximum-charge currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/maximum-charge' ; $xml .= '/subscription-payment' ; $xml .= '/payments' ; /**/ $xml .= 'recurrent-item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "uniqid" ] ) . ') Covers ongoing access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_payment1/s2_subscr_payment' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "uniqid" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( home_url ( "/" ) ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/recurrent-item' ; /**/ $xml .= '/subscription' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; } /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ exit ( ) ; /* Clean exit. */ } } } } ? [ full view ]s2member-pro\includes\classes\gateways\google\google-co-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:35:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13238&p=27903#p27903 <![CDATA[s2Member v110710 / Source Code: s2member-p...]]>
s2Member v110710
Source Code: s2member-pro\includes\classes\gateways\google\google-co-in.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-co-in.inc.php ?php /** * Google® Checkout ( 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\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_co_in" ) ) { /** * Google® Checkout ( inner processing routines ). * * @package s2Member\Google * @since 1.5 */ class c_ws_plugin__s2member_pro_google_co_in { /** * Handles Google® XML Checkout redirections. * * @package s2Member\Google * @since 1.5 * * @attaches-to ``add_action("init");`` * * @return null Or exits script execution after redirection to Google® Checkout. */ public static function google_co ( ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ if ( ! empty ( $_GET [ "s2member_pro_google_co" ] ) && ! empty ( $_REQUEST [ "co" ] ) && is_array ( $attr = c_ws_plugin__s2member_utils_strings:: trim_deep ( stripslashes_deep ( $_REQUEST [ "co" ] ) ) ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] ) { $attr = shortcode_atts ( array ( "ids" = "0" , "exp" = "72" , "level" = "1" , "ccaps" = "" , "desc" = "" , "cc" = "USD" , "custom" = $_SERVER [ "HTTP_HOST" ] , "ta" = "0" , "tp" = "0" , "tt" = "D" , "ra" = "0.01" , "rp" = "1" , "rt" = "M" , "rr" = "1" , "modify" = "0" , "cancel" = "0" , "sp" = "0" , "image" = "default" , "output" = "anchor" ) , $attr ) ; /**/ $attr [ "tt" ] = strtoupper ( $attr [ "tt" ] ) ; /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */ $attr [ "rt" ] = strtoupper ( $attr [ "rt" ] ) ; /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */ $attr [ "rr" ] = strtoupper ( $attr [ "rr" ] ) ; /* Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts(). */ $attr [ "ccaps" ] = strtolower ( $attr [ "ccaps" ] ) ; /* Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts(). */ $attr [ "rr" ] = ( $attr [ "rt" ] === "L" ) ? "BN" : $attr [ "rr" ] ; /* Lifetime Subscriptions require Buy Now. Only after running shortcode_atts(). */ $attr [ "rr" ] = ( ! $attr [ "tp" ] && ! $attr [ "rr" ] ) ? "BN" : $attr [ "rr" ] ; /* No Trial / non-recurring. Only after running shortcode_atts(). */ /**/ if ( $attr [ "modify" ] || $attr [ "cancel" ] ) /* This is a special routine for Google® Modifications/Cancellations ( one in the same ). */ { $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ wp_redirect ( "https://" . $endpoint . "/" ) ; } /**/ else if ( $attr [ "sp" ] ) /* This is a special routine for Specific Posts/Pages. These use a different XML layout/model. */ { $attr [ "time" ] = time ( ) ; /* Unix timestamp. This will be used in the Transaction ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "sp_ids_exp" ] = "sp:" . $attr [ "ids" ] . ":" . $attr [ "exp" ] ; /* Combined "sp:ids:expiration hours". */ $attr [ "sp_access_link" ] = c_ws_plugin__s2member_sp_access:: sp_access_link_gen ( $attr [ "ids" ] , $attr [ "exp" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(TID:s2-' . esc_html ( $attr [ "time" ] ) . ') Grants you immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_txn_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_txn_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_item_number' . esc_html ( $attr [ "sp_ids_exp" ] ) . '/s2_item_number' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "sp_access_link" ] ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( $attr [ "sp_access_link" ] ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ else if ( $attr [ "rr" ] === "BN" || ( ! $attr [ "tp" ] && ! $attr [ "rr" ] ) ) /* This is a special routine for Buy Now Subscriptions. */ { $attr [ "desc" ] = ( ! $attr [ "desc" ] ) ? $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "level" . $attr [ "level" ] . "_label" ] : $attr [ "desc" ] ; /**/ $attr [ "time" ] = time ( ) ; /* Unix timestamp. This will be used in the Transaction ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "level_ccaps_eotper" ] = ( $attr [ "rt" ] !== "L" ) ? $attr [ "level" ] . ":" . $attr [ "ccaps" ] . ":" . $attr [ "rp" ] . " " . $attr [ "rt" ] : $attr [ "level" ] . ":" . $attr [ "ccaps" ] ; $attr [ "level_ccaps_eotper" ] = rtrim ( $attr [ "level_ccaps_eotper" ] , ":" ) ; /* Right-trim separators from this string so we don't have trailing colons. */ /**/ $attr [ "register_access_link" ] = c_ws_plugin__s2member_register_access:: register_link_gen ( "google" , "s2-" . $attr [ "time" ] , $attr [ "custom" ] , $attr [ "level_ccaps_eotper" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(TID:s2-' . esc_html ( $attr [ "time" ] ) . ') Grants you immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_txn_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_txn_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account that is already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ else /* Else, it's an actual "Subscription"; use Membership routines. This may or may NOT be associated w/ recurring charges. */ { $attr [ "desc" ] = ( ! $attr [ "desc" ] ) ? $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "level" . $attr [ "level" ] . "_label" ] : $attr [ "desc" ] ; /**/ $attr [ "time" ] = time ( ) ; /* Unix timestamp. This will be used as the Subscription ID for this Customer. */ $attr [ "referencing" ] = c_ws_plugin__s2member_utils_users:: get_user_subscr_or_wp_id ( ) ; /* User/Member? */ /**/ $attr [ "level_ccaps_eotper" ] = $attr [ "level" ] . ":" . $attr [ "ccaps" ] ; /* Actual Subscriptions will always end on their own. */ $attr [ "level_ccaps_eotper" ] = rtrim ( $attr [ "level_ccaps_eotper" ] , ":" ) ; /* Clean any trailing separators from this string. */ /**/ $attr [ "periodicity" ] = c_ws_plugin__s2member_pro_google_utilities:: google_periodicity ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) ; /* Google® periodicity. */ /**/ $attr [ "register_access_link" ] = c_ws_plugin__s2member_register_access:: register_link_gen ( "google" , "s2-" . $attr [ "time" ] , $attr [ "custom" ] , $attr [ "level_ccaps_eotper" ] ) ; /**/ if ( $attr [ "tp" ] ) /* An actual Subscription that includes a Trial Period; which MIGHT also be associated with multiple recurring charges. */ { $attr [ "start_time" ] = c_ws_plugin__s2member_pro_google_utilities:: google_start_time ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= ( $attr [ "ta" ] 0.01 ) ? /* This needs to change; depending on whether or not this is a 100% Free Trial offer. */ 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') 100% free trial. NO charge today./item-description' : /**/ 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') First payment for immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ta" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'descriptionYou\'ll receive an email confirmation within 15 minutes./description' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') Cancel at any time to avoid ' . ( ( ! $attr [ "rr" ] ) ? 'this charge' : 'charges' ) . './item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"0.00/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account; already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= 'subscription type="google" period="' . esc_attr ( $attr [ "periodicity" ] ) . '" start-date="' . esc_attr ( date ( "Y-m-d" , $attr [ "start_time" ] ) . "T00:00:00Z" ) . '"' ; /**/ $xml .= 'payments' ; $xml .= 'subscription-payment' . ( ( ! $attr [ "rr" ] ) ? ' times="1"' : '' ) . '' ; $xml .= 'maximum-charge currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/maximum-charge' ; $xml .= '/subscription-payment' ; $xml .= '/payments' ; /**/ $xml .= 'recurrent-item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') Covers ongoing access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_payment1/s2_subscr_payment' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period1' . esc_html ( $attr [ "tp" ] . " " . $attr [ "tt" ] ) . '/s2_period1' ; $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= ( $attr [ "rr" ] ) ? 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' : '' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( home_url ( "/" ) ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/recurrent-item' ; /**/ $xml .= '/subscription' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; } else if ( ! $attr [ "tp" ] && $attr [ "rr" ] ) /* This is a Subscription w/o a Trial Period; and it IS associated with multiple recurring charges. This should ALWAYS be associated with recurring charges, because of the "BN" check above that includes (!$attr["tp"] && !$attr["rr"]). In other words, we should never have a Subscription w/o a Trial Period, AND no recurring charges. That would make no sense. */ { $attr [ "start_time" ] = c_ws_plugin__s2member_pro_google_utilities:: google_start_time ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) ; /**/ $xml = '?xml version="1.0" encoding="UTF-8"?' ; $xml .= 'checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"' ; $xml .= 'shopping-cart' ; $xml .= 'items' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') First payment for immediate access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'descriptionYou\'ll receive an email confirmation within 15 minutes./description' ; $xml .= '/digital-content' ; /**/ $xml .= '/item' ; /**/ $xml .= 'item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') Cancel at any time to avoid charges./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"0.00/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; /**/ if ( $attr [ "referencing" ] ) /* If we're updating an existing account that is already in the system. */ { $xml .= 'description' . esc_html ( 'You\'ve been updated to:br /' ) . /**/ esc_html ( $attr [ "desc" ] ) . /* Include desc here so the Customer can see that an update is taking place. */ esc_html ( 'br /( a href="' . esc_attr ( wp_login_url ( ) ) . '"please log back in now/a )' ) . '/description' ; $xml .= 'url' . esc_html ( wp_login_url ( ) ) . '/url' ; /* Also provide login URL in this link. */ } else /* Otherwise, this checkout experience will establish a brand new Membership. */ { $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . /* Registration now. */ esc_html ( 'br /( the next step is to Register a Username )' ) . '/description' ; $xml .= 'url' . esc_html ( $attr [ "register_access_link" ] ) . '/url' ; } /**/ $xml .= '/digital-content' ; /**/ $xml .= 'subscription type="google" period="' . esc_attr ( $attr [ "periodicity" ] ) . '" start-date="' . esc_attr ( date ( "Y-m-d" , $attr [ "start_time" ] ) . "T00:00:00Z" ) . '"' ; /**/ $xml .= 'payments' ; $xml .= 'subscription-payment' ; $xml .= 'maximum-charge currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/maximum-charge' ; $xml .= '/subscription-payment' ; $xml .= '/payments' ; /**/ $xml .= 'recurrent-item' ; /**/ $xml .= 'quantity1/quantity' ; $xml .= 'item-name' . esc_html ( $attr [ "desc" ] ) . '/item-name' ; $xml .= 'item-description(SID:s2-' . esc_html ( $attr [ "time" ] ) . ') Covers ongoing access./item-description' ; $xml .= 'unit-price currency="' . esc_attr ( $attr [ "cc" ] ) . '"' . esc_html ( $attr [ "ra" ] ) . '/unit-price' ; /**/ $xml .= 'merchant-private-item-data' ; $xml .= 's2_subscr_payment1/s2_subscr_payment' ; $xml .= 's2_subscr_ids2-' . esc_html ( $attr [ "time" ] ) . '/s2_subscr_id' ; $xml .= 's2_custom' . esc_html ( $attr [ "custom" ] ) . '/s2_custom' ; $xml .= 's2_customer_ip' . esc_html ( $_SERVER [ "REMOTE_ADDR" ] ) . '/s2_customer_ip' ; $xml .= 's2_item_number' . esc_html ( $attr [ "level_ccaps_eotper" ] ) . '/s2_item_number' ; $xml .= 's2_period10 D/s2_period1' ; /* There is no Trial Period. */ $xml .= 's2_period3' . esc_html ( $attr [ "rp" ] . " " . $attr [ "rt" ] ) . '/s2_period3' ; $xml .= 's2_recurring' . esc_html ( $attr [ "rr" ] ) . '/s2_recurring' ; $xml .= ( $attr [ "referencing" ] ) ? 's2_referencing' . esc_html ( $attr [ "referencing" ] ) . '/s2_referencing' : '' ; $xml .= '/merchant-private-item-data' ; /**/ $xml .= 'digital-content' ; $xml .= 'display-dispositionOPTIMISTIC/display-disposition' ; $xml .= 'description' . esc_html ( $attr [ "desc" ] ) . '/description' ; $xml .= 'url' . esc_html ( home_url ( "/" ) ) . '/url' ; $xml .= '/digital-content' ; /**/ $xml .= '/recurrent-item' ; /**/ $xml .= '/subscription' ; /**/ $xml .= '/item' ; /**/ $xml .= '/items' ; $xml .= '/shopping-cart' ; /**/ $xml .= 'checkout-flow-support' ; $xml .= 'merchant-checkout-flow-support' ; $xml .= 'edit-cart-url' . esc_html ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "membership_options_page" ] ) ) . '/edit-cart-url' ; $xml .= 'continue-shopping-url' . esc_html ( ( ( $attr [ "referencing" ] ) ? wp_login_url ( ) : $attr [ "register_access_link" ] ) ) . '/continue-shopping-url' ; $xml .= '/merchant-checkout-flow-support' ; $xml .= '/checkout-flow-support' ; /**/ $xml .= '/checkout-shopping-cart' ; } /**/ $endpoint = ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_sandbox" ] ) ? "sandbox.google.com/checkout" : "checkout.google.com" ; /**/ if ( ( $xml = c_ws_plugin__s2member_utils_urls:: remote ( "https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "pro_google_merchant_id" ] , $xml , array_merge (c_ws_plugin__s2member_pro_google_utilities:: google_api_headers ( ) , array ( "timeout" = 20 ) ) ) ) /**/ && preg_match ( "/\redirect-url\(.+?)\\/redirect-url\/i" , preg_replace ( "/[\r \n \t]+/" , "" , $xml ) , $m ) && ( $google = $m [ 1 ] ) ) wp_redirect ( wp_specialchars_decode ( $google , ENT_QUOTES ) ) ; /* Redirect to Google® Checkout. */ else /* Display error message. */ echo strip_tags ( $xml ) ; } /**/ exit ( ) ; /* Clean exit. */ } } } } ? [ full view ]s2member-pro\includes\classes\gateways\google\google-co-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:35 pm


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


]]>