本文整理汇总了PHP中Checkout::getAdditionalPrerequisiteName方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::getAdditionalPrerequisiteName方法的具体用法?PHP Checkout::getAdditionalPrerequisiteName怎么用?PHP Checkout::getAdditionalPrerequisiteName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::getAdditionalPrerequisiteName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: asc_ctor
function asc_ctor($parameter)
{
loadCoreFile('UUIDUtils.php');
$payment_module_id = $parameter;
// javaScript .
$parameter = UUIDUtils::convert("minuses_and_capitals", "js", $parameter);
// checkout prerequisite' , Person Info (e.g. CustomerInfo)
$this->CHECKOUT_PREREQUISITE_NAME = Checkout::getAdditionalPrerequisiteName("bankAccountInfo", $payment_module_id);
// store , checkout prerequisite' .
$this->CHECKOUT_STORE_BLOCK_NAME = "bank-account-info-input" . $parameter;
// html , Person Info.
$this->HTML_TAGS_PREFIX = "BankAccountInfo" . $parameter;
// html , Person Info.
// . Container .
$this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID = "BankAccountInfo";
// . . (e.g. CheckoutCustomerInfoInput)
$this->BLOCK_TAG_NAME = "CheckoutBankAccountInfoInput" . $parameter;
// ,
// :
$this->{get_parent_class(__CLASS__)}();
}
示例2: addOrderPerson
/**
* Adds a Custoner (List Person) to this order.
* It is used, for example, to save unregistered customers.
* A separate record is not created in the table persons.
*
* @
* @param
* @return
*/
function addOrderPerson($order_id)
{
global $application;
$tables = $this->getTables();
$ptiv = $tables["person_to_info_variants"]['columns'];
$opd = $tables["order_person_data"]['columns'];
$data = $this->getPrerequisitesValidationResults();
$payment_module_id = modApiFunc("Checkout", "getChosenPaymentModuleIdCZ");
$required_cc_info_prerequisite_name = Checkout::getAdditionalPrerequisiteName("creditCardInfo", $payment_module_id);
$required_bank_account_info_prerequisite_name = Checkout::getAdditionalPrerequisiteName("bankAccountInfo", $payment_module_id);
loadCoreFile('db_multiple_insert.php');
$query = new DB_Multiple_Insert('order_person_data');
$query->setInsertFields(array('order_id', 'person_info_variant_id', 'person_attribute_id', 'order_person_data_name', 'order_person_data_value', 'order_person_data_description', 'order_person_data_b_encrypted', 'order_person_data_encrypted_secret_key', 'order_person_data_rsa_public_key_asc_format'));
foreach ($data as $prerequisite_key => $info) {
if (_ml_strpos($prerequisite_key, "Module") || $prerequisite_key == 'subscriptionTopics') {
//"shippingModuleAndMethod","paymentModule"
} else {
if (_ml_strpos($prerequisite_key, "creditCardInfo") !== FALSE) {
/**
* Define, if this creditCardInfo instance matches
* the selected payment module.
* If it does, then write it to the DB. Make two instances:
* 1. not encrypted obfuscaed one
* 2. not obfuscated encrypted one.
*/
if ($prerequisite_key == $required_cc_info_prerequisite_name) {
/*
Ask the payment module, if it has to store Credit Card Info
in the database, or it won't be used after creating the order.
*/
$mInfo = Checkout::getPaymentModuleInfo($payment_module_id);
$mmObj =& $application->getInstance('Modules_Manager');
$mmObj->includeAPIFileOnce($mInfo["APIClassName"]);
/* This condition can be checked only after loading */
if (is_callable(array($mInfo["APIClassName"], "storeCreditCardInfoInDB"))) {
$b_storeCreditCardInfoInDB = call_user_func(array($mInfo["APIClassName"], 'storeCreditCardInfoInDB'));
if ($b_storeCreditCardInfoInDB === true) {
$symmetric_secret_key = modApiFunc("Crypto", "blowfish_gen_blowfish_key");
$rsa_public_key = modApiFunc("Payment_Module_Offline_CC", "getRSAPublicKeyInCryptRSAFormat");
$rsa_public_key_asc_format = modApiFunc("Payment_Module_Offline_CC", "getRSAPublicKeyInASCFormat");
$rsa_obj = new Crypt_RSA();
$encrypted_symmetric_secret_key = $rsa_obj->encrypt($symmetric_secret_key, $rsa_public_key);
//Decrypt data in the session
$this->decrypt_prerequisite_with_checkout_cz_blowfish_key($prerequisite_key);
$decrypted_data = $this->getPrerequisitesValidationResults();
$info = $decrypted_data[$prerequisite_key];
//Encrypt data in the session
$this->encrypt_prerequisite_with_checkout_cz_blowfish_key($prerequisite_key);
$person_info_variant_id = $this->getPersonInfoVariantId($prerequisite_key, $info['variant_tag']);
//Encrypt data in the session
foreach ($info["validatedData"] as $attribute_key => $validatedData) {
$attribute_id = $validatedData["id"];
$attribute_visible_name = $validatedData["attribute_visible_name"];
if ($attribute_key == "CreditCardType") {
$cc_type_names = modApiFunc("Configuration", "getCreditCardSettings");
$attribute_value = $cc_type_names[$validatedData["value"]]["name"];
} else {
$attribute_value = $validatedData["value"];
}
$attribute_description = $validatedData["attribute_description"];
// add the not encrypted obfuscated value
$b_encrypted = "0";
$i_arr = array('order_id' => $order_id, 'person_info_variant_id' => $person_info_variant_id, 'person_attribute_id' => $attribute_id, 'order_person_data_name' => $attribute_visible_name, 'order_person_data_value' => $this->get_public_view_of_secured_data($attribute_value, $attribute_id), 'order_person_data_description' => $attribute_description, 'order_person_data_b_encrypted' => $b_encrypted, 'order_person_data_encrypted_secret_key' => $encrypted_symmetric_secret_key, 'order_person_data_rsa_public_key_asc_format' => $rsa_public_key_asc_format);
$query->addInsertValuesArray($i_arr);
// add the not obfuscated encrypted value
$i_arr['order_person_data_b_encrypted'] = "1";
$i_arr['order_person_data_value'] = base64_encode($this->encryptOrderPersonAttribute($attribute_value, $symmetric_secret_key));
$query->addInsertValuesArray($i_arr);
}
}
}
}
} else {
// , ,
// , ,
// .
if (_ml_strpos($prerequisite_key, "bankAccountInfo") !== FALSE && $required_bank_account_info_prerequisite_name != $prerequisite_key) {
//BankAccountInfo,
} else {
$person_info_variant_id = $this->getPersonInfoVariantId($prerequisite_key, $info['variant_tag']);
// add to the table order_person_data
foreach ($info["validatedData"] as $attribute_key => $validatedData) {
if ($attribute_key == "Statemenu" || $attribute_key == "Statetext") {
//An attribute "state" from the DB matches two attributes
// state_menu and state_text in the session. They are mutually exclussive in meaning:
// state_menu is the ID of the record about the state in the DB, i.e.
// a number. sate_text is a state name, inputted manually by a customer.
// It is inputted only if the customer selected a country, which has no
// defined states in the DB. As for now (Dec 2005) in the DB
// in the field "state" is saved only one of the values, which is not empty.
// Either sate_menu, or state_text.
//.........这里部分代码省略.........
示例3: output
/**
* Outputs the OneStepCheckout view.
*/
function output($current_step = '', $errors_only = false)
{
global $application;
if ($current_step < 1 || $current_step > 3) {
$current_step = '';
}
$step_id = $this->pCheckout->getCurrentStepID();
if ($step_id == 3) {
$payment_module_id = modApiFunc("Checkout", "getChosenPaymentModuleIdCZ");
$prerequisite_name = Checkout::getAdditionalPrerequisiteName("creditCardInfo", $payment_module_id);
$PrerequisitesValidationResults = modApiFunc("Checkout", "getPrerequisitesValidationResults");
if (isset($PrerequisitesValidationResults[$prerequisite_name]) && $PrerequisitesValidationResults[$prerequisite_name]["isMet"] != true) {
if ($prerequisite_name == "creditCardInfoAC593800_68BA_A4D3_6A14_49BA5022FED7" && isset($PrerequisitesValidationResults['billingInfo']['variant_tag']) && $PrerequisitesValidationResults['billingInfo']['variant_tag'] == "PayPalProExpressCheckout") {
} else {
$request = new Request();
$request->setView('CheckoutView');
$request->setAction("SetCurrStep");
$request->setKey('step_id', 2);
$request = modApiFunc("Checkout", "appendCheckoutCZGETParameters", $request);
modApiFunc("Checkout", "saveState");
$application->redirect($request);
return '';
}
}
}
// setting up the template engine
$template_block = $application->getBlockTemplate('OneStepCheckout');
$this->mTmplFiller->setTemplate($template_block);
if (!modApiFunc('Cart', 'getCartProductsQuantity') || modApiFunc('Checkout', 'getLastPlacedOrderID') || modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT) > ZERO_PRICE && modApiFunc('Checkout', 'getOrderPrice', 'Subtotal', modApiFunc('Localization', 'getMainStoreCurrency')) < modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT)) {
return getCheckout();
}
$_tags = array('Local_StepID' => $step_id, 'Local_FormAction' => $this->getLinkToCheckoutStep(), 'Local_BlowFishKey' => modApiFunc('Checkout', 'getPerRequestVariable', 'CHECKOUT_CZ_BLOWFISH_KEY'), 'Local_PaymentMethods' => $this->getPaymentModulesList(), 'Local_PaymentMethodOutput' => $this->getPaymentModuleOutput(), 'Local_CreditCardInfoJSAttrRules' => $this->getJSAttrRules(), 'Local_Errors_1' => $this->getErrors(1), 'Local_Errors_2' => $this->getErrors(2), 'Local_Errors_3' => $this->getErrors(3), 'Local_Errors' => $this->getErrors($step_id));
$this->_Template_Contents = $_tags;
$application->registerAttributes($this->_Template_Contents, 'OneStepCheckout');
if ($current_step) {
if ($errors_only && $this->getErrors($step_id)) {
return $this->mTmplFiller->fill('error');
}
return $this->mTmplFiller->fill('step' . $current_step);
}
return $this->mTmplFiller->fill('container');
}
示例4: output
/**
* Returns the CheckoutView view.
*
* @ finish the functions on this page
*/
function output()
{
global $application;
$step_id = $this->pCheckout->getCurrentStepID();
if (NULL == $step_id) {
$err_params = array("CODE" => "CHECKOUT_ERR_VIEW_001");
_fatal($err_params);
} else {
if ($step_id == 3) {
$payment_module_id = modApiFunc("Checkout", "getChosenPaymentModuleIdCZ");
$prerequisite_name = Checkout::getAdditionalPrerequisiteName("creditCardInfo", $payment_module_id);
$PrerequisitesValidationResults = modApiFunc("Checkout", "getPrerequisitesValidationResults");
if (isset($PrerequisitesValidationResults[$prerequisite_name]) && $PrerequisitesValidationResults[$prerequisite_name]["isMet"] != true) {
if ($prerequisite_name == "creditCardInfoAC593800_68BA_A4D3_6A14_49BA5022FED7" && isset($PrerequisitesValidationResults['billingInfo']['variant_tag']) && $PrerequisitesValidationResults['billingInfo']['variant_tag'] == "PayPalProExpressCheckout") {
//line to be added
} else {
$request = new Request();
$request->setView('CheckoutView');
$request->setAction("SetCurrStep");
$request->setKey('step_id', 2);
$request = modApiFunc("Checkout", "appendCheckoutCZGETParameters", $request);
modApiFunc("Checkout", "saveState");
$application->redirect($request);
return '';
}
}
}
$this->templateFiller =& $application->getInstance('TemplateFiller');
$this->template = $application->getBlockTemplate('CheckoutView');
$this->templateFiller->setTemplate($this->template);
$lastPlacedOrderID = modApiFunc("Checkout", "getLastPlacedOrderID");
//If the cart is empty from the very beginning (not after cle ring on CheckoutConfirmation)
// - output the message "Empty cart".
if (modApiFunc("Cart", "getCartProductsQuantity") == 0 && empty($lastPlacedOrderID)) {
$template_name = "ErrorEmptyCart";
$application->registerAttributes(array());
} elseif (modApiFunc("Cart", "getCartProductsQuantity") > 0 && empty($lastPlacedOrderID) && modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT) > ZERO_PRICE && modApiFunc("Checkout", "getOrderPrice", "Subtotal", modApiFunc("Localization", "getMainStoreCurrency")) < modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT)) {
// , (Subtotal ),
// ,
$application->registerAttributes(array("Local_CartMinSubtotal" => ''));
$template_name = "ErrorCartMinSubtotal";
} else {
$orderInfo = NULL;
if ($lastPlacedOrderID !== NULL) {
$orderInfo = modApiFunc("Checkout", "getOrderInfo", $lastPlacedOrderID, modApiFunc("Localization", "whichCurrencyToDisplayOrderIn", $lastPlacedOrderID));
}
if ($lastPlacedOrderID !== NULL && $orderInfo['PaymentStatusId'] == 3) {
$template_name = "PaymentTransactionFailed";
$application->registerAttributes(array("Local_OrderID" => '', "Local_Step4PaymentModuleMessage" => '', "Local_OrderTotal" => '', "Local_OrderTotalRaw" => ''));
} elseif (modApiFunc("Checkout", "getCustomPaymentGatewayPageContents") != NULL) {
// If the curent step is checkout-confirmation and an answer came from
// the server as pre-formatted HTML, then view it. Workaround: check if the
// variable containing the HTML code in the Checkout module is not empty.
# fill the template on the current step of the checkout process
$template_name = "CustomPaymentGatewayPage";
$application->registerAttributes(array("CustomPaymentGatewayPageContents" => ''));
} else {
# fill the template on the current step of the checkout process
$template_name = "Step" . $this->pCheckout->getCurrentStepID();
$default = array("Local_OrderID" => '', "Local_Step4PaymentModuleMessage" => '', "Local_OrderTotal" => '', "Local_OrderTotalRaw" => '', "Local_OrderDate" => '', "Local_OrderStatus" => '', "Local_OrderPaymentStatus" => '', "Local_OrderPaymentMethod" => '', "Local_OrderPaymentProcessorOrderId" => '', "Local_OrderShippingMethod" => '', "Local_ProcessPaymentHiddenFields" => '', "Local_PaymentMethodOutput" => '', "CheckoutPaymentMethodsOutput" => '', "CheckoutPaymentMethodsSelect" => '', "Local_CreditCardInfoJSAttrRules" => '', "Local_PaymentMethods" => '', "CheckoutConfirmationFormAction" => '', "Local_ConfirmationFormAction" => '', "Local_ConfirmationFormMethod" => '', "Local_CheckoutConfirmationBodyOnLoad" => '', "Local_FormName" => '', "Local_FormAction" => '', "Local_FormMethod" => '', "Local_FormHiddenFields" => '', "Local_FormActionFieldName" => '', "Local_FormActionFieldValue" => '', "Local_FormStepIDFieldName" => '', "Local_FormStepIDFieldValue" => '', "Local_FormPreviousStepIDFieldName" => '', "Local_FormPreviousStepIDFieldValue" => '', "Local_FormCHECKOUT_CZ_BLOWFISH_KEYName" => '', "Local_FormCHECKOUT_CZ_BLOWFISH_KEYValue" => '', "CheckoutErrors" => '');
$default = apply_filters("avactis_checkout_view_addAttributes", $default);
$application->registerAttributes($default, '');
}
}
$retval = $this->templateFiller->fill($template_name);
//Output blocks of current step page.
/**
* Don't check for prerequisites: it should be done while processing Action.
*/
}
if (modApiFunc("Checkout", "isLastStepWithPrerequisites", $step_id)) {
//remove validation info of the inputted data after checkout
// clear QuickCheckout Customers' personal information
if (modApiFunc('Settings', 'getParamValue', 'CUSTOMER_ACCOUNT_SETTINGS', 'CLEAR_QCC_PERSONAL_INFO') === 'YES' && modApiFunc('Customer_Account', 'getCurrentSignedCustomer') === null) {
$sess_obj = $application->getInstance("Session");
$sess_obj->un_Set('PrerequisitesValidationResults');
}
}
return $retval;
}