You are here

function commerce_payflow_link_hosted_checkout_url in Commerce PayPal 7.2

Returns the URL to the specified Payflow Link Hosted Checkout page.

Parameters

$payment_method: The payment method instance used to generate a Secure Token for the order.

$order: The order object the hosted checkout is for.

Return value

The URL to use to redirect to Payflow's Hosted Checkout page.

2 calls to commerce_payflow_link_hosted_checkout_url()
commerce_payflow_link_hosted_checkout_iframe in modules/payflow/commerce_payflow.module
Returns an iframe embedding the specified Payflow Link Hosted Checkout page.
commerce_payflow_link_redirect_form in modules/payflow/commerce_payflow.module
Payment method callback: redirect form.

File

modules/payflow/commerce_payflow.module, line 1382
Implements PayPal Payments Advanced (U.S. only) and Payflow Link Hosted Checkout pages and Transparent Redirect.

Code

function commerce_payflow_link_hosted_checkout_url($payment_method, $order) {
  $mode = $payment_method['settings']['mode'];

  // Build a query array using information from the order object.
  $query = array(
    'SECURETOKEN' => $order->data['commerce_payflow']['token'],
    'SECURETOKENID' => $order->data['commerce_payflow']['tokenid'],
  );

  // Set the MODE parameter if the URL is for the test server.
  if ($mode == 'test') {
    $query['MODE'] = 'TEST';
  }

  // Grab the base URL of the appropriate API server.
  return url(commerce_payflow_link_server_url($mode), array(
    'query' => $query,
  ));
}