You are here

function pay_transaction::set_currency in Pay 7

Same name and namespace in other branches
  1. 6 includes/handlers/pay_transaction.inc \pay_transaction::set_currency()

Set the transaction currency, based on available options for its pay_form.

1 call to pay_transaction::set_currency()
pay_transaction::currency in includes/handlers/pay_transaction.inc

File

includes/handlers/pay_transaction.inc, line 236
A base class for payment transactions.

Class

pay_transaction
@file A base class for payment transactions.

Code

function set_currency($value = NULL) {

  // Use the default currency provided by its pay_form.
  if ($this
    ->pay_form()) {
    if (!$value) {
      $value = $this
        ->pay_form()
        ->currency();
    }
    elseif (!array_key_exists($value, $this
      ->pay_form()
      ->currency_list())) {
      $value = NULL;
    }
  }
  $this->currency = $value;
}