Comments (17)
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.
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.
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.
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.
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.
- Installed the official laravel cashier-paddle package using composer require laravel/cashier-paddle
- Published necessary migrations and added the necessary API Keys on my env file
- Added the @paddlejs in may master layout blade file and updated the VerifyCsrfToken middleware so it except routes paddle/*
- Added the Billable trait to the User model
- 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)
{
}
}
- 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.
@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.
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
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.
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.
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.
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 placeCashier::ignoreRoutes();
in the boot method of your AppServiceProvider and remove thewebhook_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.
@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.
@esanalok you shouldn't need to do that. That's already been done for you behind the scenes.
from cashier-paddle.
@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.
@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.
A general note of "make sure you have a valid url" can be added though. Feel free to PR that.
from cashier-paddle.
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)
- Allow reusing an existing customer through `PerformsCharges::subscribe()` HOT 8
- createAsCustomerIfNotExists HOT 4
- Disable generic trial once customer is subscribed HOT 1
- Fix incrementQuantity() & decrementQuantity() Throwing Error HOT 5
- Notice in the docs about "default checkout URL" HOT 1
- [2.x] add end at of the subscription period HOT 1
- Fix nextPayment() total HOT 1
- returnTo function added to checkout does not redirect HOT 6
- Bill for non-catalog items HOT 4
- Issues with subscriptions "price_id must be a string" HOT 4
- Webhook duplicating the response statuses HOT 8
- Cashier::findBillable($customerId) not returning anythying HOT 2
- Get subscription payment method HOT 1
- Add support for authentication via client-side tokens HOT 1
- Paddle webhook handler doesnt work HOT 3
- Laravel cashier-paddle package conflict with passport Auth Header HOT 1
- Paddle with Passport giving: Authentication header included, but incorrectly formatted HOT 2
- Pausing Subscriptions HOT 1
- Applying a discount on checkout HOT 1
- Problem with billing API - Transaction not created in the db HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cashier-paddle.