s2Member v110815
Package Class: s2Member\AuthNet\c_ws_plugin__s2member_pro_authnet_utilities
Docs updated: August 15, 2011, 2:28 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\AuthNet s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #44 Class c_ws_plugin__s2member_pro_authnet_utilities c_ws_plugin__s2member_pro_authnet_utilities public class c_ws_plugin__s2member_pro_authnet_utilities Authorize.Net® utilities. Since: 1.5 ( 16 Methods )Method Summary public static array _authnet_aim_response_filters(array $response) A sort of callback function that Filters Authorize.Net® AIM responses. public static array _authnet_arb_response_filters(array $response) A sort of callback function that Filters Authorize.Net® ARB responses. public static array _authnet_parse_arb_response(str $xml) A sort of callback function that parses Authorize.Net® ARB responses. public static array authnet_aim_response(array $post_vars) Calls upon Authorize.Net® AIM, and returns the response. public static null authnet_ajax_tax() Handles the return of Tax for Pro Forms, via AJAX; through a JSON object. public static array|str authnet_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 authnet_arb_response(array $post_vars) Calls upon Authorize.Net® ARB, and returns the response. public static array authnet_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 Authorize.Net®. public static str authnet_exp_date(str $exp) Re-formats credit card expiration dates for Authorize.Net®. public static array|bool authnet_parse_arb_desc(array $array) Parses an Authorize.Net® Silent Post. public static int authnet_per_term_2_days(int|str $period, str $term) Calculates period in days for Authorize.Net® ARB integration. public static array|bool authnet_postvars() Get $_POST or $_REQUEST vars from Authorize.Net®. public static str authnet_s2p_v_generate(str $url) Adds the s2p-v variable onto the end of a custom URL for success. public static bool authnet_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 authnet_start_time(str $period1, str $period3) Calculates start date for a Recurring Payment Profile. public static bool authnet_tax_may_apply() Determines whether or not Tax may apply. ( 16 Methods )Method Detail s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #131 _authnet_aim_response_filters() public static array _authnet_aim_response_filters(array $response) A sort of callback function that Filters Authorize.Net® AIM responses. Provides alternative explanations in some cases that require special attention. Since: 1.5 Parameters: array $response - An array of response variables. Returns: array - An array of response variables; possibly modified by this routine. [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #387 _authnet_arb_response_filters() public static array _authnet_arb_response_filters(array $response) A sort of callback function that Filters Authorize.Net® ARB responses. Provides alternative explanations in some cases that require special attention. Since: 1.5 Parameters: array $response - An array of response variables. Returns: array - An array of response variables; possibly modified by this routine. [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #350 _authnet_parse_arb_response() public static array _authnet_parse_arb_response(str $xml) A sort of callback function that parses Authorize.Net® ARB responses. Since: 1.5 Parameters: str $xml - XML markup returned by the ARB call. Returns: array - An array of response variables, parsed by s2Member. [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #57 authnet_aim_response() public static array authnet_aim_response(array $post_vars) Calls upon Authorize.Net® AIM, and returns the response. Since: 1.5 Parameters: array $post_vars - An array of variables to send through the Authorize.Net® API call. Returns: array - An array of variables returned from the API call. Todo: Continue optimizing this routine with empty ( ) and isset ( ) . [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #637 authnet_ajax_tax() public static null authnet_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\authnet\authnet-utilities.inc.php at line #828 authnet_apply_coupon() public static array|str authnet_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\authnet\authnet-utilities.inc.php at line #146 authnet_arb_response() public static array authnet_arb_response(array $post_vars) Calls upon Authorize.Net® ARB, and returns the response. Since: 1.5 Parameters: array $post_vars - An array of variables to send through the Authorize.Net® API call. Returns: array - An array of variables returned from the API call. Todo: Continue optimizing this routine with empty ( ) and isset ( ) . [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #690 authnet_cost() public static array authnet_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 Authorize.Net®. 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\authnet\authnet-utilities.inc.php at line #569 authnet_exp_date() public static str authnet_exp_date(str $exp) Re-formats credit card expiration dates for Authorize.Net®. Since: 1.5 Parameters: str $exp - Expects a credit card expiration date in mm/yyyy format. Returns: str - A credit card expiration date in yyyy-mm format for Authorize.Net®. [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #590 authnet_parse_arb_desc() public static array|bool authnet_parse_arb_desc(array $array) Parses an Authorize.Net® Silent Post. Parses s2_reference, s2_domain, s2_invoice, s2_start_time, s2_p1, s2_p3, s2_custom from an Authorize.Net® Silent Post ( aka: IPN ) response. Since: 1.5 Parameters: array $array - Expects an array of details returned by an Authorize.Net® Silent Post. Returns: array|bool - The same $array , but with additional details filled by this routine; else false. Todo: Continue optimizing this routine with empty ( ) and isset ( ) . Candidate for the use of ifsetor( ) ? [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #546 authnet_per_term_2_days() public static int authnet_per_term_2_days(int|str $period, str $term) Calculates period in days for Authorize.Net® ARB integration. Since: 1.5 Parameters: int|str $period - Optional. A numeric Period that coincides with $term . str $term - Optional. A Term that coincides with $period . Returns: int - A "Period Term", in days. Defaults to 0. [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #405 authnet_postvars() public static array|bool authnet_postvars() Get $_POST or $_REQUEST vars from Authorize.Net®. Authorize.Net® returns x_MD5_Hash in uppercase format for some reason. Since: 1.5 Returns: array|bool - An array of verified $_POST or $_REQUEST variables, else false. Todo: Continue optimizing this routine with empty ( ) and isset ( ) . Candidate for the use of ifsetor( ) ? Update to use strcasecmp ( ) . [ back to top ] s2member-pro\includes\classes\gateways\authnet\authnet-utilities.inc.php at line #439 authnet_s2p_v_generate() public static str authnet_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\authnet\authnet-utilities.inc.php at line #458 authnet_s2p_v_query_ok() public static bool authnet_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\authnet\authnet-utilities.inc.php at line #489 authnet_start_time() public static int authnet_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\authnet\authnet-utilities.inc.php at line #615 authnet_tax_may_apply() public static bool authnet_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:28 pm
]]>