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 17 forks source link

[139] The given prices format is not valid. #25

Closed MdAnowarHosen closed 2 years ago

MdAnowarHosen commented 2 years ago

I got this error.

ProtoneMedia\LaravelPaddle\Api\PaddleApiException
[139] The given prices format is not valid. The prices must have the format of ['currency:amount', 'currency:amount', …]. 

Here is my code:

        $products = "1,2,3";
        $user = Auth::user();

        $checkOutUrl = Paddle::product()->generatePayLink([
            'title' => '3D Wallpaper',
            'webhook_url' => 'http://05c0-118-179-103-52.ngrok.io/paddle/webhook',
            'prices' => '[USD:19.99]',
            'customer_email' => $user->email,
            'customer_country' => 'BD',
            'passthrough' => ['products' => $products],
        ])->send()['url'];

How to solve this?

zaherg commented 2 years ago

if I am not mistaken you should change the price from 'prices' => '[USD:19.99]', to 'prices' => ['USD:19.99'],

since the prices should be array not string

MdAnowarHosen commented 2 years ago

It's working @zaherg. Thanks for correcting me.

MdAnowarHosen commented 2 years ago

One more question, Is there any way to disable Qty option of paddle? @zaherg

zaherg commented 2 years ago

One more question, Is there any way to disable Qty option of paddle? @zaherg

no idea sorry, I never used the package

MdAnowarHosen commented 2 years ago

Thank you

MdAnowarHosen commented 2 years ago

How can I disable Qty and coupon option of paddle using this package?