You are here

function commerce_avatax_void_transaction in Drupal Commerce Connector for AvaTax 7.5

VOID AvaTax transaction for $order.

1 string reference to 'commerce_avatax_void_transaction'
commerce_avatax_default_rules_configuration in ./commerce_avatax.rules_defaults.inc
Implements hook_default_rules_configuration().

File

./commerce_avatax.module, line 753
AvaTax service integration from Avalara, Inc.

Code

function commerce_avatax_void_transaction($order, $code = 'DocDeleted') {
  if (isset($order->data['commerce_avatax']['transaction_code']) && ($avatax = commerce_avatax_object())) {
    if (!empty($order->data['commerce_avatax']['company_code'])) {
      $parameters = array(
        'code' => $code,
      );
      $avatax
        ->transactionsVoid($order->data['commerce_avatax']['company_code'], $order->data['commerce_avatax']['transaction_code'], $parameters);
    }
  }
}