Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

please insert a valid credit card expiration date #11

Open
alexcrz opened this issue Jun 2, 2016 · 3 comments
Open

please insert a valid credit card expiration date #11

alexcrz opened this issue Jun 2, 2016 · 3 comments
Labels

Comments

@alexcrz
Copy link

alexcrz commented Jun 2, 2016

Hi, I managed to install the inchoo stripe module , but when I go on the checkout page and insert the credit card info , when I try to pay I get please insert a valid credit card expiration date error. I have tryed with several credit cards , and allways get the same error.

@rahulvramesh
Copy link

Override validate() function in Payment.php

@udovicic
Copy link
Member

I have tried several of these on Magento 2.1., and haven't seen any issues:

https://stripe.com/docs/testing

Could you give me an example? Provided that it is a test credit card, of course.

@felipemarques
Copy link

I have the same problem with the message: please insert a valid credit card expiration date
I can resolve this, changing the file app/code/Inchoo/Stripe/Model/Payment.php and adding the following code:

    /**
     * Assign data to info model instance
     *
     * @param \Magento\Framework\DataObject|mixed $data
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function assignData(\Magento\Framework\DataObject $data)
    {
        if (!$data instanceof \Magento\Framework\DataObject) {
            $data = new \Magento\Framework\DataObject($data);
        }

        $info = $this->getInfoInstance();
        $info->setCcType(
            $data->getDataByPath('additional_data/cc_type')
        )->setCcOwner(
            $data->getDataByPath('additional_data/cc_owner')
        )->setCcLast4(
            substr($data->getDataByPath('additional_data/cc_number'), -4)
        )->setCcNumber(
            $data->getDataByPath('additional_data/cc_number')
        )->setCcCid(
            $data->getDataByPath('additional_data/cc_cid')
        )->setCcExpMonth(
            $data->getDataByPath('additional_data/cc_exp_month')
        )->setCcExpYear(
            $data->getDataByPath('additional_data/cc_exp_year')
        )->setCcSsIssue(
            $data->getCcSsIssue()
        )->setCcSsStartMonth(
            $data->getCcSsStartMonth()
        )->setCcSsStartYear(
            $data->getCcSsStartYear()
        );
        return $this;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants