You are here

function _commerce_worldpay_bg_build_sig_array in Commerce Worldpay 7

@todo document this function

Parameters

$order_wrapper:

$installation_id:

$response_url:

Return value

array

1 call to _commerce_worldpay_bg_build_sig_array()
commerce_worldpay_bg_order_form in ./commerce_worldpay_bg.module
Build the form to be submitted to WorldPay.

File

./commerce_worldpay_bg.module, line 921
Provides a Worldpay Business Gateway payment method for Drupal Commerce.

Code

function _commerce_worldpay_bg_build_sig_array($order_wrapper, $installation_id, $response_url) {

  // Current fields are: instId, amount, currency, cartId, MC_orderId, C_WORLDPAY_BG_RESPONSE_URL_TOKEN
  $currency_code = $order_wrapper->commerce_order_total->currency_code
    ->value();
  $amount = round(commerce_currency_amount_to_decimal($order_wrapper->commerce_order_total->amount
    ->value(), $currency_code), 2);
  return array(
    $installation_id,
    $amount,
    $currency_code,
    $order_wrapper->order_number
      ->value(),
    $order_wrapper->order_id
      ->value(),
    $response_url,
  );
}