function uc_cybersource_payment_gateway_settings_submit in Ubercart 7.3
Same name and namespace in other branches
- 5 payment/uc_cybersource/uc_cybersource.module \uc_cybersource_payment_gateway_settings_submit()
- 6.2 payment/uc_cybersource/uc_cybersource.module \uc_cybersource_payment_gateway_settings_submit()
Submit handler for payment gateway settings form to encrypt fields.
1 string reference to 'uc_cybersource_payment_gateway_settings_submit'
- uc_cybersource_form_uc_payment_method_settings_form_alter in payment/
uc_cybersource/ uc_cybersource.module - Implements hook_form_FORM_ID_alter() for uc_payment_method_settings_form().
File
- payment/
uc_cybersource/ uc_cybersource.module, line 73 - A module used for CyberSource's Silent Order POST and Hosted Order Page methods of payment.
Code
function uc_cybersource_payment_gateway_settings_submit($form, &$form_state) {
// If CC encryption has been configured properly.
if ($key = uc_credit_encryption_key()) {
// Setup our encryption object.
$crypt = new UbercartEncryption();
// Encrypt the Merchant ID and Transaction key.
if (!empty($form_state['values']['uc_cybersource_soap_merchant_id'])) {
variable_set('uc_cybersource_soap_merchant_id', $crypt
->encrypt($key, $form_state['values']['uc_cybersource_soap_merchant_id']));
}
if (!empty($form_state['values']['uc_cybersource_soap_transaction_key'])) {
variable_set('uc_cybersource_soap_transaction_key', $crypt
->encrypt($key, $form_state['values']['uc_cybersource_soap_transaction_key']));
}
// Store any errors.
uc_store_encryption_errors($crypt, 'uc_cybersource');
}
}