You are here

function commerce_worldpay_bg_response_url in Commerce Worldpay 7

Returns the Payment Response URL.

Parameters

$method_id: Optionally specify a payment method ID to include in the URL.

$https: Return the URL using SSL protocal (https://)

Return value

The absolute path to the callback page

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

File

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

Code

function commerce_worldpay_bg_response_url($method_id = NULL, $https = FALSE) {
  if ($https) {

    // URL will fail if https is not of type BOOL
    $https = TRUE;
  }
  else {
    $https = FALSE;
  }
  $parts = array(
    'commerce_worldpay',
    'bg',
    'response',
  );
  if (!empty($method_id)) {
    $parts[] = $method_id;
  }
  return url(implode('/', $parts), array(
    'absolute' => TRUE,
    'https' => $https,
  ));
}