You are here

function stripe_payment_currencies in Stripe 7

Return the payment currencies available in the location of our Stripe account.

Return value

array An associative array of three-character currency codes.

1 string reference to 'stripe_payment_currencies'
StripePaymentMethodController::__construct in stripe_payment/includes/StripePaymentMethodController.inc
Public constructor.

File

./stripe.module, line 531
stripe.module Drupal hooks used for integrating the Stripe service.

Code

function stripe_payment_currencies() {
  if (stripe_load_library()) {
    try {
      $info = \Stripe\Account::retrieve();
      $country_spec = \Stripe\CountrySpec::retrieve($info->country);
      $supported_currencies = $country_spec->supported_payment_currencies;
      return $supported_currencies;
    } catch (Exception $e) {
      return array();
    }
  }
}