We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 926685db authored by attilak's avatar attilak

Rename constants to encrypted and fix translation

parent bc1ed8e4
...@@ -71,15 +71,15 @@ class CcAuthorizationDataBuilder implements BuilderInterface ...@@ -71,15 +71,15 @@ class CcAuthorizationDataBuilder implements BuilderInterface
$request['paymentMethod']['type'] = $variant; $request['paymentMethod']['type'] = $variant;
} }
if ($cardNumber = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::CREDIT_CARD_NUMBER)) { if ($cardNumber = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_CREDIT_CARD_NUMBER)) {
$request['paymentMethod']['encryptedCardNumber'] = $cardNumber; $request['paymentMethod']['encryptedCardNumber'] = $cardNumber;
} }
if ($expiryMonth = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::EXPIRY_MONTH)) { if ($expiryMonth = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_EXPIRY_MONTH)) {
$request['paymentMethod']['encryptedExpiryMonth'] = $expiryMonth; $request['paymentMethod']['encryptedExpiryMonth'] = $expiryMonth;
} }
if ($expiryYear = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::EXPIRY_YEAR)) { if ($expiryYear = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_EXPIRY_YEAR)) {
$request['paymentMethod']['encryptedExpiryYear'] = $expiryYear; $request['paymentMethod']['encryptedExpiryYear'] = $expiryYear;
} }
...@@ -87,15 +87,15 @@ class CcAuthorizationDataBuilder implements BuilderInterface ...@@ -87,15 +87,15 @@ class CcAuthorizationDataBuilder implements BuilderInterface
$request['paymentMethod']['holderName'] = $holderName; $request['paymentMethod']['holderName'] = $holderName;
} }
if ($securityCode = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::SECURITY_CODE)) { if ($securityCode = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_SECURITY_CODE)) {
$request['paymentMethod']['encryptedSecurityCode'] = $securityCode; $request['paymentMethod']['encryptedSecurityCode'] = $securityCode;
} }
// Remove from additional data // Remove from additional data
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::CREDIT_CARD_NUMBER); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_CREDIT_CARD_NUMBER);
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::EXPIRY_MONTH); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_EXPIRY_MONTH);
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::EXPIRY_YEAR); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_EXPIRY_YEAR);
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::SECURITY_CODE); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_SECURITY_CODE);
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::HOLDER_NAME); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::HOLDER_NAME);
/** /**
......
...@@ -40,7 +40,7 @@ class CheckoutPaymentCommentHistoryHandler implements HandlerInterface ...@@ -40,7 +40,7 @@ class CheckoutPaymentCommentHistoryHandler implements HandlerInterface
/** @var OrderPaymentInterface $payment */ /** @var OrderPaymentInterface $payment */
$payment = $payment->getPayment(); $payment = $payment->getPayment();
$commentText = "Adyen Result response:"; $comment = __("Adyen Result response:");
if (isset($response['resultCode'])) { if (isset($response['resultCode'])) {
$responseCode = $response['resultCode']; $responseCode = $response['resultCode'];
...@@ -60,16 +60,14 @@ class CheckoutPaymentCommentHistoryHandler implements HandlerInterface ...@@ -60,16 +60,14 @@ class CheckoutPaymentCommentHistoryHandler implements HandlerInterface
} }
if ($responseCode) { if ($responseCode) {
$commentText .= '<br /> authResult: ' . $responseCode; $comment .= '<br /> ' . __('authResult:') . ' ' . $responseCode;
$payment->getOrder()->setAdyenResulturlEventCode($responseCode); $payment->getOrder()->setAdyenResulturlEventCode($responseCode);
} }
if ($pspReference) { if ($pspReference) {
$commentText .= '<br /> pspReference: ' . $pspReference; $comment .= '<br /> ' . __('pspReference:') . ' ' . $pspReference;
} }
$comment = __($commentText);
$payment->getOrder()->addStatusHistoryComment($comment); $payment->getOrder()->addStatusHistoryComment($comment);
return $this; return $this;
......
...@@ -34,10 +34,10 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver ...@@ -34,10 +34,10 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver
const CC_TYPE = 'cc_type'; const CC_TYPE = 'cc_type';
const NUMBER_OF_INSTALLMENTS = 'number_of_installments'; const NUMBER_OF_INSTALLMENTS = 'number_of_installments';
const STORE_CC = 'store_cc'; const STORE_CC = 'store_cc';
const CREDIT_CARD_NUMBER = 'number'; const ENCRYPTED_CREDIT_CARD_NUMBER = 'number';
const SECURITY_CODE = 'cvc'; const ENCRYPTED_SECURITY_CODE = 'cvc';
const EXPIRY_MONTH = 'expiryMonth'; const ENCRYPTED_EXPIRY_MONTH = 'expiryMonth';
const EXPIRY_YEAR = 'expiryYear'; const ENCRYPTED_EXPIRY_YEAR = 'expiryYear';
const HOLDER_NAME = 'holderName'; const HOLDER_NAME = 'holderName';
const VARIANT = 'variant'; const VARIANT = 'variant';
...@@ -48,10 +48,10 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver ...@@ -48,10 +48,10 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver
self::CC_TYPE, self::CC_TYPE,
self::NUMBER_OF_INSTALLMENTS, self::NUMBER_OF_INSTALLMENTS,
self::STORE_CC, self::STORE_CC,
self::CREDIT_CARD_NUMBER, self::ENCRYPTED_CREDIT_CARD_NUMBER,
self::SECURITY_CODE, self::ENCRYPTED_SECURITY_CODE,
self::EXPIRY_MONTH, self::ENCRYPTED_EXPIRY_MONTH,
self::EXPIRY_YEAR, self::ENCRYPTED_EXPIRY_YEAR,
self::HOLDER_NAME, self::HOLDER_NAME,
self::VARIANT self::VARIANT
]; ];
......
...@@ -32,7 +32,7 @@ use Magento\Quote\Api\Data\PaymentInterface; ...@@ -32,7 +32,7 @@ use Magento\Quote\Api\Data\PaymentInterface;
class AdyenOneclickDataAssignObserver extends AbstractDataAssignObserver class AdyenOneclickDataAssignObserver extends AbstractDataAssignObserver
{ {
const RECURRING_DETAIL_REFERENCE = 'recurring_detail_reference'; const RECURRING_DETAIL_REFERENCE = 'recurring_detail_reference';
const SECURITY_CODE = 'cvc'; const ENCRYPTED_SECURITY_CODE = 'cvc';
const NUMBER_OF_INSTALLMENTS = 'number_of_installments'; const NUMBER_OF_INSTALLMENTS = 'number_of_installments';
const VARIANT = 'variant'; const VARIANT = 'variant';
...@@ -41,7 +41,7 @@ class AdyenOneclickDataAssignObserver extends AbstractDataAssignObserver ...@@ -41,7 +41,7 @@ class AdyenOneclickDataAssignObserver extends AbstractDataAssignObserver
*/ */
protected $additionalInformationList = [ protected $additionalInformationList = [
self::RECURRING_DETAIL_REFERENCE, self::RECURRING_DETAIL_REFERENCE,
self::SECURITY_CODE, self::ENCRYPTED_SECURITY_CODE,
self::NUMBER_OF_INSTALLMENTS, self::NUMBER_OF_INSTALLMENTS,
self::VARIANT self::VARIANT
]; ];
......
...@@ -92,7 +92,6 @@ define( ...@@ -92,7 +92,6 @@ define(
groupTypes: self.getAvailableCardTypeAltCodes(), groupTypes: self.getAvailableCardTypeAltCodes(),
onChange: function (state) { onChange: function (state) {
// isValid is not present on start // isValid is not present on start
if (typeof state.isValid !== 'undefined' && state.isValid === false) { if (typeof state.isValid !== 'undefined' && state.isValid === false) {
self.creditCardDetailsValid(false); self.creditCardDetailsValid(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment