Wave 1.0.2 Stripe Setup_intents ERROR

mrawesomestaco

Aug 8th, 2020 01:40 AM

I followed the guide. Did the setup of the stripe API keys, webhooks, and all that however it seems when I go to do a subscribe stripe is returning:

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such setupintent: 'seti_1HDgtYI3v5QAdznHlGO6C4hu'",
    "param": "intent",
    "type": "invalid_request_error"
  }
}

The specific request it is making is to https://api.stripe.com/v1/setup_intents/seti_[product pricing API ID without the price_ front]/confirm.

I'm thinking it probably has something to do with the stripe version being v3 maybe. I'm lost. Anyone got an idea?

bobbyiliev

Aug 9th, 2020 04:45 PM

Hi there,

I tried recreating the error at my end but I was not able to.

Did you also create your plans via Stripe as described here:

https://wave.devdojo.com/docs/1.0/features/subscription-plans

mrawesomestaco

Aug 9th, 2020 06:50 PM

It seems you are having issues replicating what other's problems are. Allow me to showcase my configuration and you can compare it to yours.

My package list right now

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.2.5",
        "binarytorch/larecipe": "^2.2",
        "devdojo/app": "^0.10.0",
        "devdojo/themes": "0.0.3",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "intervention/image": "^2.4",
        "lab404/laravel-impersonate": "^1.2",
        "laravel/cashier": "^10.3",
        "laravel/framework": "^7.0",
        "laravel/helpers": "^1.0",
        "laravel/tinker": "^2.0",
        "orangehill/iseed": "dev-master",
        "pragmarx/google2fa-laravel": "^1.3",
        "pragmarx/recovery": "^0.1.0",
        "predis/predis": "^1.1",
        "tcg/voyager": "1.4.x-dev",
        "tymon/jwt-auth": "1.0.0"
    },
    "require-dev": {
      "roave/security-advisories": "dev-master"
      ,
      "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "laravel/dusk": "^5.0",
        "mockery/mockery": "^1.3.1",
        "phpunit/phpunit": "^8.5"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/",
            "Wave\\": "wave/src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [],
            "providers" : [
                "Wave\\WaveServiceProvider"
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "repositories": {
        "hooks": {
            "type": "composer",
            "url": "https://larapack.io"
        }
    }
}

My server configuration is Debian 10, NGINX 1.19.1, MariaDB 10.5.4, PHP 7.4.8 connected to NGINX with FPM, redis for cache and session management. I've extended the template with google 2fa authentication and backup codes for the 2fa authentication.

After looking at this package list I can confirm that cashier is using the 10 branch and not the 11 branch which isn't using the fixed stripe version. I'm going to look at this and get back to you guys. I believe it is due to the API system stripe is using now being different.

mrawesomestaco

Aug 9th, 2020 09:25 PM

Yep this wave template is broken in the latest stripe API configuration. If you remake your API keys to the latest version and try you will find that it will not work. Wave is running on an old API system which is broken in the latest version now.

bobbyiliev

Aug 10th, 2020 07:48 AM

Hi there,

Thanks for reporting this! This has been taken now into consideration and we will investigate this further!

tnylea

Aug 10th, 2020 10:54 PM

Yep, you're right. You will have to use an older Stripe API version in order for it to work with the current version. You should be able to use an old version and then upgrade when I release an update on our end.

I'll be doing an upgrade with the latest version of Cashier and I'll have an update available that will be compatible with the new Stripe API version in a couple days :)

mrawesomestaco

Aug 11th, 2020 01:20 AM

@tnylea Thanks for recognizing it. I got it already patched on my end if you want I can provide you my changed code.

tnylea

Aug 13th, 2020 06:25 PM

Ok, thanks!

I've just published a new version called 1.0.3, which is updated to support the latest Wave API.

Thanks for pointing this issue out.