Skip to content

how to verify signature in laravel #54

@TheMrCorvy

Description

@TheMrCorvy

Hi, I wanted to know, I have a laravel project, and tried to implement this package in order to support payments with crypto.

The only problem I have is that I don't know how can I verify coinbase's signature on the webhook events.

What I'm trying to do is something like this example from the readme file:

use CoinbaseCommerce\Webhook;

try {
    Webhook::verifySignature($signature, $body, $sharedSecret);
    echo 'Successfully verified';
} catch (\Exception $exception) {
    echo $exception->getMessage();
    echo 'Failed';
}

I don't have any problem getting the signature or the shared secret, but I don't know how can I get the raw body of the request.

If anyone can help, I'd really appreciate it.

I'm using the following:

  • PHP 8.0.10
  • Laravel 8.61.0
  • coinbase/coinbase-commerce: "^1.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions