You are here

function paypal_payment_ec_test_checkout in PayPal for Payment 7

Returns a checkout response.

Parameters

bool $success:

1 string reference to 'paypal_payment_ec_test_checkout'
paypal_payment_ec_test_menu in paypal_payment_ec_test/paypal_payment_ec_test.module
Implements hook_menu().

File

paypal_payment_ec_test/paypal_payment_ec_test.module, line 149
Contains hook implementations and global functions.

Code

function paypal_payment_ec_test_checkout($success) {
  if ($success && isset($_GET['cmd']) && $_GET['cmd'] == '_express-checkout' && isset($_GET['token']) && $_GET['token'] == paypal_payment_ec_test_token()) {
    $url = variable_get('paypal_payment_ec_test_return_url');
  }
  else {
    $url = variable_get('paypal_payment_ec_test_cancel_url');
  }
  drupal_goto($url, array(
    'query' => array(
      'token' => paypal_payment_ec_test_token(),
    ),
  ));
}