Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LaraBABA's avatar

Paddle api question regarding receipts

Hello,

I am not sure I understand fully the Paddle API here: https://laravel.com/docs/7.x/cashier-paddle#charging-products

I have generated a sales like this:

          $products = Product::where('product_status', 1)->orderBy('product_order')->get();

           $payLink = $user->chargeProduct($product->product_id, [
               'quantity_variable' => 0,
           ]);


        return view('backend.customer.dashboard.view', ['payLink' => $payLink]);

I created a discount of 99% and passed the same via Paypal.

I received the sales receipt from Paypal and Paddle but no receipts have been created in the "receipts table".

I have also checked the webhooks and receives a 200 from the paddle account:

200
{"p_product_id":596697,"p_price":0.75,"p_country":"US","p_currency":"USD","p_sale_gross":0.75,"p_tax_amount":0,"p_paddle_fee":0.54,"p_coupon_savings":0,"p_earnings":"{\"115809\":\"0.2100\"}","p_order_id":16955780,"p_coupon":"","p_used_price_override":true,"passthrough":"Example passthrough","p_quantity":1,"quantity":1,"event_time":"2020-08-16 16:50:12"}

How to you get a receipt generated in the database please? How to I know that Paddle sent a webhook to the app after a successful sale?

Thank you.

0 likes
6 replies
Braunson's avatar

Have you setup webhooks? https://laravel.com/docs/7.x/cashier-paddle#handling-paddle-webhooks

To test a webhook, set them up on your end in Laravel, then set the URLs in Paddle. If you are working locally, you can use something like Homestead's share or Ngrok or Expose to expose your app with a public URL.

If you want to confirm you are getting a webhook call back, throw in a logger()->info() call into the webhook code and log the incoming Request. Then just tail your Laravel logs..

LaraBABA's avatar

Hi Braunson,

You can check what I have already done here: https://github.com/laravel/cashier-paddle/issues/58

I can get it to work when I use the included controller but as soon as I try to override a method, the script bugs. Yes all the webhooks have been setup. It is working perfectly with the original controller but the custom part of it from the doc does not work. Have you managed to bypass a method like the one I show on github please? I need to add more logic to the payment succeeded method, this is why I need to overide it.

Thank you.

LaraBABA's avatar
LaraBABA
OP
Best Answer
Level 10

@tiznull If you search in the doc, it tells you to create your own listener, and from there you can listen to the payload output when Paddle sends the request back to you.

https://laravel.com/docs/9.x/cashier-paddle#defining-webhook-event-handlers

To check the request form paddle just to this:

        if ($event->payload['alert_name'] === 'payment_succeeded') {
            // Handle the incoming event...
        }
//Or use whatever payload event you want
;aravel\Paddle\Events\PaymentSucceeded    ->>> payment_succeeded
Laravel\Paddle\Events\SubscriptionCreated    ->>> subscription_created

and so on....

tiznull's avatar

@LaraBABA - Thank you for responding so fast. I feel like it used to create the subscriptions before. At least it was working for awhile without wiring up my own methods. For piece of mind I am willing to connect up the code. The link makes perfect sense. Thanks again.

Please or to participate in this conversation.