示例#1
0
 public function parseRecurringContractData($data)
 {
     $this->setMethodCode('adyen_oneclick')->setReferenceId($data['recurringDetailReference'])->setCreatedAt($data['creationDate']);
     $creationDate = str_replace(' ', '-', $data['creationDate']);
     $this->setCreatedAt($creationDate);
     //Billing agreement SEPA
     if (isset($data['bank_iban'])) {
         $this->setAgreementLabel(__('%1, %2', $data['bank_iban'], $data['bank_ownerName']));
     }
     // Billing agreement is CC
     if (isset($data['card']['number'])) {
         $ccType = $data['variant'];
         $ccTypes = $this->_adyenHelper->getCcTypesAltData();
         if (isset($ccTypes[$ccType])) {
             $ccType = $ccTypes[$ccType]['name'];
         }
         $label = __('%1, %2, **** %3', $ccType, $data['card']['holderName'], $data['card']['number'], $data['card']['expiryMonth'], $data['card']['expiryYear']);
         $this->setAgreementLabel($label);
     }
     if ($data['variant'] == 'paypal') {
         $label = __('PayPal %1', $data['lastKnownShopperEmail']);
         $this->setAgreementLabel($label);
     }
     $this->setAgreementData($data);
     return $this;
 }
 protected function _addHppMethodsToConfig($store)
 {
     $paymentMethods = [];
     $ccEnabled = $this->_config->getValue('payment/' . \Adyen\Payment\Model\Method\Cc::METHOD_CODE . '/active');
     $ccTypes = array_keys($this->_adyenHelper->getCcTypesAltData());
     foreach ($this->_fetchHppMethods($store) as $methodCode => $methodData) {
         // skip payment methods if it is a creditcard that is enabled in adyen_cc
         if ($ccEnabled && in_array($methodCode, $ccTypes)) {
             continue;
         }
         $paymentMethods[$methodCode] = $methodData;
     }
     return $paymentMethods;
 }
示例#3
0
 /**
  * @param $store
  * @return array
  */
 protected function _addHppMethodsToConfig($store, $country)
 {
     $paymentMethods = [];
     $ccEnabled = $this->_config->getValue('payment/' . \Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE . '/active');
     $ccTypes = array_keys($this->_adyenHelper->getCcTypesAltData());
     $sepaEnabled = $this->_config->getValue('payment/' . \Adyen\Payment\Model\Ui\AdyenSepaConfigProvider::CODE . '/active');
     foreach ($this->_fetchHppMethods($store, $country) as $methodCode => $methodData) {
         /*
          * skip payment methods if it is a creditcard that is enabled in adyen_cc
          * or if payment is sepadirectdebit and SEPA api is enabled
          */
         if ($ccEnabled && in_array($methodCode, $ccTypes)) {
             continue;
         } elseif ($methodCode == 'sepadirectdebit' && $sepaEnabled) {
             continue;
         }
         $paymentMethods[$methodCode] = $methodData;
     }
     return $paymentMethods;
 }