laravellaravel-cashier

Laravel's Cashier-Paddle Not Working Locally?


I've tried to use both ngrok and Expose with the Paddle Sandbox and while the subscription is being created perfectly in Paddle, on the Laravel side, I keep getting the same error:

[2022-05-08 23:23:50] local.ERROR: openssl_verify(): supplied key param cannot be coerced into a public key {"exception":"[object] (ErrorException(code: 0): openssl_verify(): supplied key param cannot be coerced into a public key at ~/vendor/laravel/cashier-paddle/src/Http/Middleware/VerifyWebhookSignature.php:71)

Is there a particular format the public key in .env needs to be in to prevent this error?


Solution

  • I figured this one out. It turns out that when you're putting your PADDLE_PUBLIC_KEY in .env, you should include everything i.e.

    PADDLE_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----
    MIICIjANBiuqhiiG9w0BAQEFXAOCAg8AMIIjjgKCAraAyj/UyC89sqpOnpEZcM76
    guppK9vfF7balLj87rE9VXq5...EAAQ==
    -----END PUBLIC KEY-----"