PaymentNonceResponseValidator.php 775 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Braintree\Gateway\Validator;
  7. /**
  8. * Class PaymentNonceResponseValidator
  9. */
  10. class PaymentNonceResponseValidator extends GeneralResponseValidator
  11. {
  12. /**
  13. * @return array
  14. */
  15. protected function getResponseValidators()
  16. {
  17. return array_merge(
  18. parent::getResponseValidators(),
  19. [
  20. function ($response) {
  21. return [
  22. !empty($response->paymentMethodNonce) && !empty($response->paymentMethodNonce->nonce),
  23. [__('Payment method nonce can\'t be retrieved.')]
  24. ];
  25. }
  26. ]
  27. );
  28. }
  29. }