s2Member v110815
Package Class: s2Member\PayPal\c_ws_plugin__s2member_pro_paypal_utilities
Docs updated: August 15, 2011, 2:34 pm
Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Class Summary Classes Hooks/Filters Field Summary | Method Summary | Field Detail | Method Detail Package s2Member\PayPal s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #44 Class c_ws_plugin__s2member_pro_paypal_utilities c_ws_plugin__s2member_pro_paypal_utilities public class c_ws_plugin__s2member_pro_paypal_utilities PayPal® utilities. Since: 1.5 ( 8 Methods )Method Summary public static null paypal_ajax_tax() Handles the return of Tax for Pro Forms, via AJAX; through a JSON object. public static array|str paypal_apply_coupon(array $attr, str $coupon_code, str $return_response_or_attr, str $return_reponse_or_attr) Checks to see if a Coupon Code was supplied, and if so; what does it provide? public static array paypal_cost(int|str $trial_sub_total, int|str $sub_total, str $state, str $country, int|str $zip, str $currency, str $desc) Handles all cost calculations for PayPal®. public static array paypal_maestro_solo_2gbp(array $attr, str $card_type) Handles currency conversions for Maestro/Solo cards. public static str paypal_s2p_v_generate(str $url) Adds the s2p-v variable onto the end of a custom URL for success. public static bool paypal_s2p_v_query_ok(str $qs, bool $ignore_timestamp) Verifies s2p-v in a given query string argument; from a custom URL for success. public static int paypal_start_time(str $period1, str $period3) Calculates start date for a Recurring Payment Profile. public static bool paypal_tax_may_apply() Determines whether or not Tax may apply. ( 8 Methods )Method Detail s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #210 paypal_ajax_tax() public static null paypal_ajax_tax() Handles the return of Tax for Pro Forms, via AJAX; through a JSON object. Since: 1.5 Returns: null - Or exits script execution after returning data for AJAX caller. Todo: Check the use of strip_tags ( ) in this routine? Continue optimizing this routine with empty ( ) and isset ( ) . Candidate for the use of ifsetor( ) ? [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #401 paypal_apply_coupon() public static array|str paypal_apply_coupon(array $attr, str $coupon_code, str $return_response_or_attr, str $return_reponse_or_attr) Checks to see if a Coupon Code was supplied, and if so; what does it provide? Since: 1.5 Parameters: array $attr - An array of Pro Form Attributes. str $coupon_code - Optional. A possible Coupon Code supplied by the Customer. str $return_reponse_or_attr - Optional. One of response|attr. Defaults to attr. Returns: array|str - Original array, with prices and description modified when/if a Coupon Code is accepted. Or, if $return_response_or_attr === "response" , return a string response, indicating status. Todo: See if it's possible to simplify this routine. Add support for tracking Coupon Code usage. Add support for a fixed number of uses. [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #263 paypal_cost() public static array paypal_cost(int|str $trial_sub_total, int|str $sub_total, str $state, str $country, int|str $zip, str $currency, str $desc) Handles all cost calculations for PayPal®. Returns an associative array with a possible Percentage Rate, along with the calculated Tax Amount. Tax calculations are based on State/Province, Country, and/or Zip Code. Updated to support multiple data fields in it's return value. Since: 1.5 Parameters: int|str $trial_sub_total - Optional. A numeric Amount/cost of a possible Initial/Trial being offered. int|str $sub_total - Optional. A numeric Amount/cost of the purchase and/or Regular Period. str $state - Optional. The State/Province where the Customer is billed. str $country - Optional. The Country where the Customer is billed. int|str $zip - Optional. The Postal/Zip Code where the Customer is billed. str $currency - Optional. Expects a 3 character Currency Code. str $desc - Optional. Description of the sale. Returns: array - Array of calculations. Todo: Add support for Zip + 4 syntax? [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #188 paypal_maestro_solo_2gbp() public static array paypal_maestro_solo_2gbp(array $attr, str $card_type) Handles currency conversions for Maestro/Solo cards. PayPal® requires Maestro/Solo to be charged in GBP. So if a site owner is using another currency ( i.e. something NOT in GBP ), we have to convert all of the charge amounts dynamically. Coupon Codes should always be applied before this conversion takes place. That way a site owner's configuration remains adequate. Tax rates should be applied after this conversion takes place. Since: 110531 Parameters: array $attr - An array of PayPal® Pro Form Attributes. str $card_type - The Card Type ( i.e. Billing Method ) selected. Returns: array - The same array of Pro Form Attributes, with possible currency conversions. [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #55 paypal_s2p_v_generate() public static str paypal_s2p_v_generate(str $url) Adds the s2p-v variable onto the end of a custom URL for success. Since: 1.5 Parameters: str $url - A full URL to append the s2p-v variable onto. Returns: str - A full URL with the s2p-v query string argument as well. [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #74 paypal_s2p_v_query_ok() public static bool paypal_s2p_v_query_ok(str $qs, bool $ignore_timestamp) Verifies s2p-v in a given query string argument; from a custom URL for success. Since: 1.5 Parameters: str $qs - Optional. Defaults to $_SERVER [ "QUERY_STRING" ] . Returns: bool - True if the query string is OK/verified, else false. [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #105 paypal_start_time() public static int paypal_start_time(str $period1, str $period3) Calculates start date for a Recurring Payment Profile. Since: 1.5 Parameters: str $period1 - Optional. A "Period Term" combination. Defaults to 0 D. str $period3 - Optional. A "Period Term" combination. Defaults to 0 D. Returns: int - The start time, a Unix timestamp. [ back to top ] s2member-pro\includes\classes\gateways\paypal\paypal-utilities.inc.php at line #160 paypal_tax_may_apply() public static bool paypal_tax_may_apply() Determines whether or not Tax may apply. Since: 1.5 Returns: bool - True if Tax may apply, else false. [ back to top ] Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Class Summary Classes Hooks/Filters Field Summary | Method Summary | Field Detail | Method Detail(!-- :: s-words --)Statistics: Posted by System Robot — August 15th, 2011, 1:33 pm
]]>