craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
215 stars 170 forks source link

[3.x]: craft\commerce\errors\PaymentSourceException: Could not create the payment source #3190

Closed chandamotiyani closed 1 year ago

chandamotiyani commented 1 year ago

Description

I recently upgraded Craft Commerce to 3.4.22.1 and getting this error craft\commerce\errors\PaymentSourceException: Could not create the payment source on our live environment

Craft CMS version

3.8.13

Craft Commerce version

3.4.22.1

PHP version

7.2.34

Installed plugins and versions

{
    "require": {
        "ext-json": "*",
        "craftcms/cms": "3.8.13",
        "vlucas/phpdotenv": "^2.4.0",
        "verbb/navigation": "1.4.32",
        "craftcms/commerce": "3.4.22.1",
        "spicyweb/craft-neo": "2.13.18",
        "craftcms/redactor": "2.10.12",
        "studioespresso/craft-navigate": "2.3.0",
        "craftcms/aws-s3": "1.3.2",
        "verbb/super-table": "2.7.5.1",
        "nystudio107/craft-typogrify": "^1.1",
        "verbb/wishlist": "1.4.18",
        "league/flysystem-aws-s3-v3": "^1.0.13",
        "phpoffice/phpspreadsheet": "^1.8",
        "jalendport/craft-queuemanager": "^1.2",
        "nystudio107/craft-templatecomments": "1.2.0",
        "verbb/cp-nav": "3.1.0",
        "solspace/craft-freeform": "3.13.29",
        "yiisoft/yii2-redis": "~2.0.0",
        "nystudio107/craft-seomatic": "3.4.56",
        "symfony/process": "5.2.1",
        "ostark/craft-async-queue": "2.3.0",
        "studioespresso/craft-google-shopping-feed": "1.3.1",
        "isev-ltd/contact-form-validation": "0.0.1",
        "craftcms/element-api": "2.8.6.1",
        "mmikkel/cp-field-inspect": "1.4.4",
        "doublesecretagency/craft-inventory": "2.1.1",
        "studioespresso/craft-seeder": "3.3.1",
        "ngraf/slack-codeception-extension": "^1.8",
        "newism/craft-rollbar": "^1.3",
        "dompdf/dompdf": "^2.0"
    },
    "require-dev": {
        "nystudio107/craft-twigprofiler": "1.0.1",
        "am-impact/amcommand": "3.1.4",
        "charliedev/element-map": "1.2.1",
        "codeception/codeception": "^4.0"
    },
    "autoload": {
        "psr-4": {
            "modules\\": "modules/"
        }
    },
    "config": {
        "optimize-autoloader": true,
        "allow-plugins": {
            "craftcms/plugin-installer": true,
            "yiisoft/yii2-composer": true,
            "treeware/plant": true
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "5.2.1"
        }
    }
}
lukeholder commented 1 year ago

Hi, can you please put steps to reproduce and also give the full stack trace.

It might be easier to send your logs and steps to reproduce to support@craftcms.com

You also didn't mention what gateway you are using - I dont see one in your composer dependencies.

chandamotiyani commented 1 year ago

Hi @lukeholder thanks for your quick response, we are using Spreedly Gateway and this the fullstack trace

`2023-06-07 16:06:59 [-][58317][-][error][craft\commerce\errors\PaymentSourceException] craft\commerce\errors\PaymentSourceException: Could not create the payment source. in /var/www/repos/yalumba-craftcms-website/vendor/craftcms/commerce/src/services/PaymentSources.php:255
Stack trace:
#0 /var/www/repos/yalumba-craftcms-website/vendor/craftcms/commerce/src/controllers/PaymentsController.php(284): craft\commerce\services\PaymentSources->createPaymentSource(58317, Object(modules\Spreedly\Gateway), Object(modules\Spreedly\Models\PaymentForm))
#1 [internal function]: craft\commerce\controllers\PaymentsController->actionPay()
#2 /var/www/repos/yalumba-craftcms-website/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /var/www/repos/yalumba-craftcms-website/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /var/www/repos/yalumba-craftcms-website/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('pay', Array)
#5 /var/www/repos/yalumba-craftcms-website/vendor/craftcms/cms/src/web/Application.php(295): yii\base\Module->runAction('commerce/paymen...', Array)
#6 /var/www/repos/yalumba-craftcms-website/vendor/craftcms/cms/src/web/Application.php(608): craft\web\Application->runAction('commerce/paymen...', Array)
#7 /var/www/repos/yalumba-craftcms-website/vendor/craftcms/cms/src/web/Application.php(274): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 /var/www/repos/yalumba-craftcms-website/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /var/www/repos/yalumba-craftcms-website/web/index.php(21): yii\base\Application->run()
#10 {main}
2023-06-07 16:06:58 [-][58317][-][info][application] $_GET = []

$_POST = [
    'action' => 'commerce/payments/pay'
    'redirect' => 'd5b4a1b131c3c87f33768710d2850a5245876beb966cb8d2b8bf4925e1b90073/shop/customer/order?number=6f7c3a81b139aeb0c77008206a10f7fd'
    'CRAFT_CSRF_TOKEN' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'cancelUrl' => 'ebc219d569f3c976aea52d14213a11f0294f624b96520cadc387b19c35a9a968/shop/checkout'
    'orderEmail' => 'email@hsfe.com'
    'fullName' => 'test person'
    'firstName' => 'test'
    'lastName' => 'person'
    'number' => ''
    'short_expiry' => ''
    'expiry' => ''
    'cvv' => ''
    'savePaymentSource' => '1'
    'shippingMethodHandle' => 'flatRateAustraliaWide'
    'token' => '•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'yourdateofbirth' => ''
]
chandamotiyani commented 1 year ago

Have sent the additional details on the email @lukeholder as suggested, expecting some response, thanks in advance.

chandamotiyani commented 1 year ago

hi @lukeholder - it looks like its related to the Custom Shipping Method which we are using and not being handled in, I tried to downgrade it to the fix Version 3.4.20.1 (Craft Commerce) as mentioned in the change log but it is not making any difference

lukeholder commented 1 year ago

We have got your support ticket and working on it with you. We will continue assisting over our email support. We will keep re-open this ticket if we find a bug in Commerce.