protonemedia / laravel-paddle

Paddle.com API integration for Laravel with support for webhooks/events
https://protone.media/en/blog/a-new-laravel-package-to-handle-payments-and-subscriptions-with-paddle
MIT License
203 stars 18 forks source link

Support vendors in blade directive and Request #29

Open Djuki opened 2 years ago

Djuki commented 2 years ago

I mentioned this feature in #28.

I added support for multi vendors via configuration in Request:

Usage:

Paddle::product()
        ->generatePayLink([
            'vendor_id' => '44334',
            'vendor_auth_code' => 'fdfsdfsdf'
        ])
        ->productId('5345')
        ->send();

Also, I added support for multi vendors in blade directive:

@paddle(123)

Both changes are covered in unit tests. What have left is to add support for verifySignature in WebhookController, but only this method can support overloading public_key from config, not the controller because I think we can't support multi-vendors in that case. Users need to create own controllers because they know where from they will read public_key.

We can discuss Do we want to change WebhookController or not.