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

getPrices returns "Bad Method Call" #9

Closed brunocfalcao closed 4 years ago

brunocfalcao commented 4 years ago

Hi there,

First, thanks for this amazing package.

I am trying to get the price for my product with the following code:

Paddle::checkout()
                 ->getPrices(['product_ids' => '594915', 'customer_ip' => '213.55.224.117'])
                 ->send()

But unfortunately, it returns a "Bad Method Call", like below:

image

Can I ask your help to clarify what am I doing wrong?

Thanks in advance, Bruno

dagraro commented 4 years ago

Hi brunocfalcao,

I am checking this library out and it seems the API_ENDPOINT have changed for checkout api calls. According to documentation (https://developer.paddle.com/api-reference/checkout-api/prices/getprices) the endpoint is "https://checkout.paddle.com/api/2.0/prices" and the library is using "https://vendors.paddle.com/api/2.0/prices" API_ENDPOINT.

I guess the library must be updated to fix this problem.

Captura de pantalla 2020-06-15 a las 23 08 16

pascalbaljet commented 4 years ago

Thanks for notifying, I will look into it!

@dagraro do you know if Paddle has some kind of changelog for their API?

dagraro commented 4 years ago

Hi Pascal,

I am integrating paddle in one of my projects and checking your library I noticed the checkout API's didn't work properly. I made a change in my local copy to make it works, but I didn't make any pull request because the change is not as big thing and I left you a message. If you don't have time to fix it, I will make the pull request, so let me know.

About your question, Paddle has got a changelog (https://new.paddle.com/), but I haven't found any reference to changes on the API, I think it's more for paddle users more than developers. Anyway, nice to meet you and let me thank you for your library, it's pretty cool. Regards, David

pascalbaljet commented 4 years ago

I just tagged v1.1.3 which should use the right endpoint for the checkout calls. Please let me know if it works correctly 😀

brunocfalcao commented 4 years ago

That's amazing, thanks a lot @pascalbaljet and @dagraro ! Will try it out this night and close the ticket if it works correctly.

brunocfalcao commented 4 years ago

Just tested it and works perfectly. Thanks a lot!

image