You are here

function hook_payment_pre_finish in Payment 7

Executes right before payment execution is finished.

Parameters

Payment $payment:

Return value

NULL

See also

Payment::finish()

1 function implements hook_payment_pre_finish()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

payment_test_payment_pre_finish in tests/payment_test/payment_test.module
Implements hook_payment_pre_finish().
1 invocation of hook_payment_pre_finish()
Payment::finish in ./payment.classes.inc
Finish the payment after its execution.

File

./payment.api.php, line 153
Hook documentation.

Code

function hook_payment_pre_finish(Payment $payment) {
  if (payment_status_is_or_has_ancestor($payment
    ->getStatus()->status, PAYMENT_STATUS_SUCCESS)) {
    drupal_set_message(t('Your payment was successfully completed.'));
  }
  else {
    drupal_set_message(t('Your payment was not completed.'));
  }
}