You are here

function basic_cart_payment_finish in Basic cart 7.3

Implements Payment::finish_callback.

1 string reference to 'basic_cart_payment_finish'
basic_cart_payment_form_order_node_form_alter in basic_cart_payment/basic_cart_payment.module
Implementes hook_form_FORM_ID_alter().

File

basic_cart_payment/basic_cart_payment.module, line 132

Code

function basic_cart_payment_finish(Payment $payment) {
  if (payment_access('view', $payment)) {
    $view = ' ' . l(t('View payment'), 'payment/' . $payment->pid) . '.';
  }
  if (payment_status_is_or_has_ancestor($payment
    ->getStatus()->status, PAYMENT_STATUS_PENDING)) {
    drupal_set_message(t('Your payment is still being processed.') . $view);

    //drupal_goto('checkout/thank-you');
  }
  elseif (payment_status_is_or_has_ancestor($payment
    ->getStatus()->status, PAYMENT_STATUS_SUCCESS)) {
    drupal_set_message(t('Your payment was successfully completed.') . $view);

    //drupal_goto('checkout/thank-you');
  }
  elseif (payment_status_is_or_has_ancestor($payment
    ->getStatus()->status, PAYMENT_STATUS_FAILED)) {
    drupal_set_message(t('Your payment failed.') . $view);

    //drupal_goto('checkout/thank-you');
  }
}