You are here

function _uc_cybersource_soap_login_data in Ubercart 5

Same name and namespace in other branches
  1. 6.2 payment/uc_cybersource/uc_cybersource.module \_uc_cybersource_soap_login_data()
  2. 7.3 payment/uc_cybersource/uc_cybersource.module \_uc_cybersource_soap_login_data()
4 calls to _uc_cybersource_soap_login_data()
CyberSourceSoapClient::__doRequest in payment/uc_cybersource/uc_cybersource.soap.inc
uc_cybersource_calculate_tax in payment/uc_cybersource/uc_cybersource.module
Calculates taxes for an order using CyberSource's tax service.
uc_cybersource_settings_form in payment/uc_cybersource/uc_cybersource.module
_uc_cybersource_soap_charge in payment/uc_cybersource/uc_cybersource.module

File

payment/uc_cybersource/uc_cybersource.module, line 934
A module used for CyberSource's Silent Order POST method of payment.

Code

function _uc_cybersource_soap_login_data() {
  static $data;
  if (!empty($data)) {
    return $data;
  }
  $merchant_id = variable_get('uc_cybersource_soap_merchant_id', '');
  $transaction_key = variable_get('uc_cybersource_soap_transaction_key', '');

  // If CC encryption has been configured properly.
  if ($key = uc_credit_encryption_key()) {

    // Setup our encryption object.
    $crypt = new uc_encryption_class();

    // Decrypt the Merchant ID and Transaction key.
    if (!empty($merchant_id)) {
      $merchant_id = $crypt
        ->decrypt($key, $merchant_id);
    }
    if (!empty($transaction_key)) {
      $transaction_key = $crypt
        ->decrypt($key, $transaction_key);
    }

    // Store any errors.
    uc_store_encryption_errors($crypt, 'uc_cybersource');
  }
  $data = array(
    'merchant_id' => $merchant_id,
    'transaction_key' => $transaction_key,
  );
  return $data;
}