You are here

function _commerce_sagepay_ensure_postal_code in Drupal Commerce SagePay Integration 7

1 call to _commerce_sagepay_ensure_postal_code()
_commerce_sagepay_encrypted_order in includes/commerce_sagepay_common.inc
Encrypt the order details ready to send to SagePay Server.

File

includes/commerce_sagepay_common.inc, line 745
Common utility functions shared by all SagePay modules.

Code

function _commerce_sagepay_ensure_postal_code($address, $key = 'postal_code', $default = '0000') {
  $value = isset($address[$key]) ? trim($address[$key]) : $default;
  if (empty($value)) {
    $value = $default;
  }
  return $value;
}