public function stage(GatewayType $adapter, $normalized, &$stagedData)
 {
     if ($adapter->isBatchProcessor()) {
         // Only makes sense for real users.
         return;
     }
     if (!empty($normalized['returnto'])) {
         $returnto = $normalized['returnto'];
     } else {
         $returnto = '';
     }
     if (isset($normalized['payment_method']) && $normalized['payment_method'] === 'cc') {
         // Add order ID to the returnto URL, only if it's not already there.
         //TODO: This needs to be more robust (like actually pulling the
         //qstring keys, resetting the values, and putting it all back)
         //but for now it'll keep us alive.
         if ($adapter->getOrderIDMeta('generate') && !empty($returnto) && !strpos($returnto, 'order_id')) {
             $queryArray = array('order_id' => $normalized['order_id']);
             $stagedData['returnto'] = wfAppendQuery($returnto, $queryArray);
         }
     } else {
         // FIXME: An empty returnto should be handled by the result switcher instead.
         $stagedData['returnto'] = ResultPages::getThankYouPage($adapter);
     }
 }
コード例 #2
0
 protected static function singleton(GatewayType $gateway_adapter, Gateway_Extras_CustomFilters $custom_filter_object)
 {
     if (!self::$instance || $gateway_adapter->isBatchProcessor()) {
         self::$instance = new self($gateway_adapter, $custom_filter_object);
     }
     return self::$instance;
 }
 /**
  * @static Construct the singleton instance of this class.
  *
  * @param GatewayType $gateway_adapter
  *
  * @return Gateway_Extras_SessionVelocityFilter
  */
 private static function singleton(GatewayType $gateway_adapter)
 {
     if (!self::$instance || $gateway_adapter->isBatchProcessor()) {
         self::$instance = new self($gateway_adapter);
     }
     return self::$instance;
 }
コード例 #4
0
 protected static function singleton(GatewayType $gateway_adapter, Gateway_Extras_CustomFilters $custom_filter_object = null)
 {
     # FIXME: Why always construct a new object if we're batch processing?
     if (!self::$instance || $gateway_adapter->isBatchProcessor()) {
         self::$instance = new self($gateway_adapter, $custom_filter_object);
     }
     return self::$instance;
 }