/** * Return the HTML output for the current gateway's checkout fields. * @return string The HTML of the current gateway's checkout fields. * @uses apply_filters() Filters output through wpsc_gateway_checkout_form_{gateway_internal_name} */ function wpsc_gateway_form_fields() { global $wpsc_gateway, $gateway_checkout_form_fields, $wpsc_gateway_error_messages; $messages = is_array($wpsc_gateway_error_messages) ? $wpsc_gateway_error_messages : array(); $error = array('card_number' => empty($messages['card_number']) ? '' : $messages['card_number'], 'expdate' => empty($messages['expdate']) ? '' : $messages['expdate'], 'card_code' => empty($messages['card_code']) ? '' : $messages['card_code'], 'cctype' => empty($messages['cctype']) ? '' : $messages['cctype']); $output = ''; // Match fields to gateway switch ($wpsc_gateway->gateway['internalname']) { case 'paypal_pro': // legacy // legacy case 'wpsc_merchant_paypal_pro': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $error['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $error['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $error['card_code'], wpsc_the_checkout_CCtype_validation_class(), $error['cctype']); break; case 'authorize': case 'paypal_payflow': $output = @sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $error['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $error['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $error['card_code']); break; case 'eway': case 'bluepay': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $error['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $error['expdate']); break; case 'linkpoint': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $error['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $error['expdate']); break; } if (empty($output) && isset($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']])) { $output = $gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']]; } return apply_filters('wpsc_gateway_checkout_form_' . $wpsc_gateway->gateway['internalname'], $output); }
function wpsc_gateway_form_fields() { global $wpsc_gateway, $gateway_checkout_form_fields; // Match fields to gateway switch ($wpsc_gateway->gateway['internalname']) { case 'paypal_pro': // legacy // legacy case 'wpsc_merchant_paypal_pro': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_code'], wpsc_the_checkout_CCtype_validation_class(), $_SESSION['wpsc_gateway_error_messages']['cctype']); break; case 'authorize': case 'paypal_payflow': $output = @sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_code']); break; case 'eway': case 'bluepay': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate']); break; case 'linkpoint': $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate']); break; } if (isset($output) && !empty($output)) { return $output; } else { return $gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']]; } }
function wpsc_gateway_form_fields() { global $wpsc_gateway, $gateway_checkout_form_fields; //sprintf on paypalpro module if ($wpsc_gateway->gateway['internalname'] == 'paypal_pro') { $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_code'], wpsc_the_checkout_CCtype_validation_class(), $_SESSION['wpsc_gateway_error_messages']['cctype']); return $output; } if ($wpsc_gateway->gateway['internalname'] == 'authorize' || $wpsc_gateway->gateway['internalname'] == 'paypal_payflow') { $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate'], wpsc_the_checkout_CCcvv_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_code']); return $output; } if ($wpsc_gateway->gateway['internalname'] == 'eway' || $wpsc_gateway->gateway['internalname'] == 'bluepay') { $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate']); return $output; } if ($wpsc_gateway->gateway['internalname'] == 'linkpoint') { $output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']], wpsc_the_checkout_CC_validation_class(), $_SESSION['wpsc_gateway_error_messages']['card_number'], wpsc_the_checkout_CCexpiry_validation_class(), $_SESSION['wpsc_gateway_error_messages']['expdate']); return $output; } //$output = sprintf($gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']] , $size['width'], $size['height']); return $gateway_checkout_form_fields[$wpsc_gateway->gateway['internalname']]; }