public function plgVmOnRealexUpdateStoredCard($element, $storedCC, &$success)
 {
     if (!$this->selectedThisElement($element)) {
         return FALSE;
     }
     $vendorId = 1;
     if ($this->getPluginMethods($vendorId) === 0) {
         return false;
     }
     foreach ($this->methods as $method) {
         if ($method->merchant_id == $storedCC['merchant_id']) {
             // the crypted fields are decrypted with that function
             if (!($this->_currentMethod = $this->getVmPluginMethod($method->virtuemart_paymentmethod_id))) {
                 return FALSE;
                 // this should not happen
             }
             break;
         }
     }
     if (empty($this->_currentMethod)) {
         Vmerror('No payment has been found with ' . $storedCC['merchant_id']);
         return FALSE;
     }
     //vmdebug('plgVmOnRealexUpdateStoredCard',$this->_currentMethod );
     $realexInterface = $this->_loadRealexInterface();
     if (!$realexInterface) {
         return false;
     }
     $success = $realexInterface->updateStoredCard($storedCC);
     return $success;
 }
示例#2
0
	private function _loadPayPalInterface() {
		$this->_currentMethod->paypalproduct = $this->getPaypalProduct($this->_currentMethod);

		if ($this->_currentMethod->paypalproduct == 'std') {
			$paypalInterface = new PaypalHelperPayPalStd($this->_currentMethod,$this);
		} else if ($this->_currentMethod->paypalproduct == 'api') {
			$paypalInterface = new PaypalHelperPayPalApi( $this->_currentMethod,$this);
		} else if ($this->_currentMethod->paypalproduct == 'exp') {
			$paypalInterface = new PaypalHelperPayPalExp($this->_currentMethod, $this);
		} else if ($this->_currentMethod->paypalproduct == 'hosted') {
			$paypalInterface = new PaypalHelperPayPalHosted( $this->_currentMethod,$this);
		} else {
			Vmerror('Wrong paypal mode');
			return NULL;
		}
		return $paypalInterface;
	}