You are here

function _commerce_braintree_set_feedback_url in Commerce Braintree 7

Provide the cancel and return url used when calling the payment provider.

2 calls to _commerce_braintree_set_feedback_url()
commerce_braintree_cof_redirect_form in ./commerce_braintree.commerce_braintree_cof.inc
Payment method callback: redirect form.
commerce_braintree_redirect_form in ./commerce_braintree.commerce_braintree.inc
Payment method callback: redirect form.

File

./commerce_braintree.module, line 455
Implementations of the Braintree payment gateway (http://braintreepayments.com) for drupal commerce.

Code

function _commerce_braintree_set_feedback_url($order, $payment_method) {

  // Set feedback URLs.
  $settings = array(
    // Return to the previous page when payment is canceled.
    'cancel_return' => url('checkout/' . $order->order_id . '/payment/back/' . $order->data['payment_redirect_key'], array(
      'absolute' => TRUE,
    )),
    // Return to the payment redirect page for processing successful payments.
    'return' => url('checkout/' . $order->order_id . '/payment/return/' . $order->data['payment_redirect_key'], array(
      'absolute' => TRUE,
    )),
    // Specify the current payment method instance ID in the notify_url
    'payment_method' => $payment_method['instance_id'],
  );
  return $settings;
}