GithubHelp home page GithubHelp logo

Comments (17)

driesvints avatar driesvints commented on May 5, 2024 2

Hey @esanalok. This perfectly worked for me. So I don't know what's happening here. Can you perhaps try with a fresh installation of cashier-paddle and laravel? Going to close this but feel free to reply.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024 2

Hi, @driesvints and @Hussam3bd thanks for your help. I've fixed the issue. Everything was fine. Just need to specify the webhook URL in the charge method. I think it should be mentioned in the documentation. Thanks for your help.

// paylink variable from controller
$payLink = auth()->user()->charge($total, 'Product Title', [
   'webhook_url' => 'webhook URL here',

]);

from cashier-paddle.

SebastianSchoeps avatar SebastianSchoeps commented on May 5, 2024 1

Hi, @driesvints and @Hussam3bd thanks for your help. I've fixed the issue. Everything was fine. Just need to specify the webhook URL in the charge method. I think it should be mentioned in the documentation. Thanks for your help.

// paylink variable from controller
$payLink = auth()->user()->charge($total, 'Product Title', [
   'webhook_url' => 'webhook URL here',

]);

I had to do exactly the same (thanks @esanalok!). Brand new project with only cashier-paddle, just for testing purposes. Only the following changes to a standard Laravel installation:

Route::get('/', function () {
    return view('welcome', [
        'payLink' => \App\Models\User::find(1)->charge(1.50, 'a product', [
            'webhook_url' => 'https://example.com/paddle/webhook',
        ])
    ]);
});

<x-paddle-button :url="$payLink" class="px-8 py-4">
    Buy
</x-paddle-button>

Without webhook_url I had the same issue.

Dug a little deeper - my TLD on my dev system is not a "valid" TLD. The webhook URL is generated in Cashier@webhookUrl and was http://paddle-test.invalid-tld/paddle/webhook. It seems like Paddle doesn't accept this.

@driesvints Maybe worth mentioning in the docs.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

Heya, thanks for reporting.

I'll need more info and/or code to debug this further. Please post relevant code like models, jobs, commands, notifications, events, listeners, controller methods, routes, etc. You may use https://paste.laravel.io to post larger snippets or just reply with shorter code snippets.

Thanks!

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

Thanks for your quick reply. I'm trying to apply a "one off" charge (Simple Charge) against a customer. So let me tell you the process that I have already completed.

  1. Installed the official laravel cashier-paddle package using composer require laravel/cashier-paddle
  2. Published necessary migrations and added the necessary API Keys on my env file
  3. Added the @paddlejs in may master layout blade file and updated the VerifyCsrfToken middleware so it except routes paddle/*
  4. Added the Billable trait to the User model
  5. Configured the webhook route and controller

// Route example

Route::post('paddle/webhook','WebhookController@handleWebhook')->name('cashier.webhook');

// WebhookController

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Laravel\Paddle\Http\Controllers\WebhookController as CashierController;

class WebhookController extends CashierController
{
    public function handleWebhook(Request $request)
    {
       
        logger('I can reach here!');
    }

    public function handlePaymentSucceeded($payload)
    {
        
    }
}
  1. Generated the paylink variable using my controller and finally used the variable on the paddle-button Blade component
    // paylink variable from controller
$payLink = auth()->user()->charge(12.99, 'Test Product Title');

// Blade file

<x-paddle-button :url="$payLink" class="px-8 py-4">
    Buy
</x-paddle-button>

Note: The simple charge is not working but the charge for a specific product is working fine. For example this one auth()->user()->chargeProduct(619859) is working fine.

These are the steps that I have already followed to integrate the paddle simple chare on my laravel application. Hope that information may help you. Let me know if I am doing anything wrong or missed any steps. Thanks in advance.

from cashier-paddle.

Hussam3bd avatar Hussam3bd commented on May 5, 2024

@esanalok
When you create single charge
You have to set the webhook_url in your .env file
Just make sure you do that and try.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

Hey @esanalok. This perfectly worked for me. So I don't know what's happening here. Can you perhaps try with a fresh installation of cashier-paddle and laravel? Going to close this but feel free to reply.

Thanks, I will try a fresh installation. Thanks for your help and time.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

@esanalok
When you create single charge
You have to set the webhook_url in your .env file
Just make sure you do that and try.

Thanks for your replay. I've already added the webhook by following the documentation and the webhook is working and the payment_succeeded alert is firing when a payment is made into my Paddle account.
But in the documentation, I can't see anything related to webhook_url for the env file. Is it really required?
Let me know if I need to out the webhook_url in my env file.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

That should indeed normally not be necessary. It falls back on the cashier.webhook. I think I might know what's going on though. Can you place Cashier::ignoreRoutes(); in the boot method of your AppServiceProvider and remove the webhook_url from your .env file and try again? I'm guessing we need to add that to the docs but want to verify first.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

Hey @esanalok. This perfectly worked for me. So I don't know what's happening here. Can you perhaps try with a fresh installation of cashier-paddle and laravel? Going to close this but feel free to reply.

Thanks, I have uninstalled the package and then install again. But sorry to inform you that I'm having the same issue. The charge for a specific product with product id from paddle working fine but when I try to charge the customer one-off (Simple charge) I am getting the same issue again. Also, I would like to inform you that I think there is another issue with the inline checkout. While I was trying to integrate the inline checkout I put the paddle-checkout Blade component on my blade file and I am getting an issue in my console and it says "Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed."

<x-paddle-checkout :override="$payLink" class="w-full" height="500" />

Note: Both of the Inline Checkout and simple charge is not working for me. I will be happy if I can get a solution to this issue. Thanks in advance.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

That should indeed normally not be necessary. It falls back on the cashier.webhook. I think I might know what's going on though. Can you place Cashier::ignoreRoutes(); in the boot method of your AppServiceProvider and remove the webhook_url from your .env file and try again? I'm guessing we need to add that to the docs but want to verify first.

Thanks for your suggestion. I have already followed your instructions but I am sorry to inform you that I'm still having the same issue.
Note: My project was a laravel 5.7 project but recently I have updated my project to laravel 7.24 by following the laravel update documentation. Everything is working fine after the update except the paddle checkout.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

@esanalok at this point I'd like to suggest you upload a repo which reproduces the problem. Please commit your changes separately from a fresh laravel installation.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

@esanalok you shouldn't need to do that. That's already been done for you behind the scenes.

from cashier-paddle.

esanalok avatar esanalok commented on May 5, 2024

@esanalok you shouldn't need to do that. That's already been done for you behind the scenes.

Thanks. But for some reason, it was not working for me. But it works after adding the webhook URL.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

@SebastianSchoeps we can't document every single exception that Paddle doesn't handle. That seems more something for the Paddle docs themselves. Best that you send a ticket to their support.

from cashier-paddle.

driesvints avatar driesvints commented on May 5, 2024

A general note of "make sure you have a valid url" can be added though. Feel free to PR that.

from cashier-paddle.

marcomessa avatar marcomessa commented on May 5, 2024

I had the same issue, but mine was cause by the test domain, which was not (yet) approved by Paddle. I had a PR in the docs, hoping to help. Cheers

from cashier-paddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.