Skip to content

Custom Payment Method issue in Magento 2.4.5

Create a Custom Payment Method in Magento 2 but face this issue on the checkout page.

{ “message”: “Please enter a valid credit card expiration date.”,
“trace”: “#0
/home/css/public_html/magento245/vendor/magento/module-quote/Model/Quote/Payment.php(202):
MagentoPaymentModelMethodCc->validate()n#1
/home/css/public_html/magento245/vendor/magento/module-quote/Model/PaymentMethodManagement.php(79):
MagentoQuoteModelQuotePayment->importData(Object(MagentoFrameworkDataObject))n#2
/home/css/public_html/magento245/vendor/magento/module-checkout/Model/PaymentInformationManagement.php(181):
MagentoQuoteModelPaymentMethodManagement->set(311,
Object(MagentoQuoteModelQuotePayment))n#3
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoCheckoutModelPaymentInformationManagement->savePaymentInformation(311,
Object(MagentoQuoteModelQuotePayment), NULL)n#4
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(138):
MagentoCheckoutModelPaymentInformationManagementInterceptor->___callParent(‘savePaymentInfo…’,
Array)n#5
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(153):
MagentoCheckoutModelPaymentInformationManagementInterceptor->MagentoFrameworkInterception{closure}(311,
Object(MagentoQuoteModelQuotePayment), NULL)n#6
/home/css/public_html/magento245/generated/code/Magento/Checkout/Model/PaymentInformationManagement/Interceptor.php(32):
MagentoCheckoutModelPaymentInformationManagementInterceptor->___callPlugins(‘savePaymentInfo…’,
Array, Array)n#7 [internal function]:
MagentoCheckoutModelPaymentInformationManagementInterceptor->savePaymentInformation(311,
Object(MagentoQuoteModelQuotePayment), NULL)n#8
/home/css/public_html/magento245/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95):
call_user_func_array(Array, Array)n#9
/home/css/public_html/magento245/vendor/magento/module-webapi/Controller/Rest.php(195):
MagentoWebapiControllerRestSynchronousRequestProcessor->process(Object(MagentoFrameworkWebapiRestRequestProxy))n#10
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoWebapiControllerRest->dispatch(Object(MagentoFrameworkAppRequestHttp))n#11
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(138):
MagentoWebapiControllerRestInterceptor->___callParent(‘dispatch’,
Array)n#12
/home/css/public_html/magento245/vendor/magento/framework/Interception/Interceptor.php(153):
MagentoWebapiControllerRestInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))n#13
/home/css/public_html/magento245/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23):
MagentoWebapiControllerRestInterceptor->___callPlugins(‘dispatch’,
Array, Array)n#14
/home/css/public_html/magento245/vendor/magento/framework/App/Http.php(116):
MagentoWebapiControllerRestInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))n#15
/home/css/public_html/magento245/generated/code/Magento/Framework/App/Http/Interceptor.php(23):
MagentoFrameworkAppHttp->launch()n#16
/home/css/public_html/magento245/vendor/magento/framework/App/Bootstrap.php(264):
MagentoFrameworkAppHttpInterceptor->launch()n#17
/home/css/public_html/magento245/index.php(48):
MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))n#18
{main}” }

Please check the screen shot

issue image