modules/acm_payment/src/Plugin/PaymentMethod/Braintree.php
public function getToken() {
    $cid = 'acm_payment:braintree_token';
    $token = NULL;

    if ($cache = \Drupal::cache()->get($cid)) {
      $token = $cache->data;
    }
    else {
      $token = \Drupal::service('acm.api')->getPaymentToken('braintree');
      \Drupal::cache()->set($cid, $token);
    }

    return $token;
  }
public function getToken() {
    $cid = 'acm_payment:braintree_token';
    $token = NULL;

    if ($cache = \Drupal::cache()->get($cid)) {
      $token = $cache->data;
    }
    else {
      $token = \Drupal::service('acm.api')->getPaymentToken('braintree');
      \Drupal::cache()->set($cid, $token);
    }

    return $token;
  }
public function getToken ( ) { $ cid = 'acm_payment:braintree_token' ; $ token = NULL ; if ( $ cache = \ Drupal :: cache ( ) -> get ( $ cid ) ) { $ token = $ cache -> data ; } else { $ token = \ Drupal :: service ( 'acm.api' ) -> getPaymentToken ( 'braintree' ) ; \ Drupal :: cache ( ) -> set ( $ cid , $ token ) ; } return $ token ; }
Get and cache the token used for a transaction.
Get and cache the token used for a transaction .