laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
245 stars 57 forks source link

Page Not Found Sorry, the page you were looking for could not be found. #47

Closed Benoit1980 closed 4 years ago

Benoit1980 commented 4 years ago
  Hello,

I am trying to create a fake purchase and have a few questions please.

1)When the amount if below 0.75 Euro, I get the error (The price is too low), is this normal?

2)When I use the belowcode:

  $user = User::find(Auth::id());
        $payLink = $user->charge(0.75, 'test onecharge');

        return view('home', ['payLink' => $payLink]);

I see a green button on my front end, click on it but get this message: image1

I thought this code could be used to create 1 time charge from the back end(without firs inputting the product name in the paddle admin panel.

Any idea why this is happening please?

Thank you.

GrahamCampbell commented 4 years ago

When the amount if below 0.75 Euro, I get the error (The price is too low), is this normal?

Yes, you cannot charge someone such a small amount. If you need to charge customers lots of small amounts, you should batch up the charges, and charge them all together.

GrahamCampbell commented 4 years ago

I am trying to create a fake purchase and have a few questions please.

What do you mean, fake purchase? Paddle currently doesn't support test purchases. You must use a real card and make a live transaction, or use a 100% off discount code. If you have tried to enable the sandbox mode option, that would explain the 404s. As the comment in the config file says, this feature is not generally available.

Benoit1980 commented 4 years ago

Sorry, my apology, by fake purchase I meant "purchased done from my side to test the system". Yes I understand that they have no system in place to create a fake purchase(I was surprised to be honest). The 100% off coupon is a great Idea I did not know about it.

So based on this code:

 $user = User::find(Auth::id());
        $payLink = $user->charge(0.75, 'test onecharge');

        return view('home', ['payLink' => $payLink]);

Do I have to create the "test onecharge" product in my paddle account first? As this is not explained in the doc. It says simple one time charge.

I was hoping to be able to see the checkout with the above code.

Thank you.

GrahamCampbell commented 4 years ago

Do I have to create the "test onecharge" product in my paddle account first?

Yes, I think so. Note that product IDs are integers, not strings.

Benoit1980 commented 4 years ago

Thanks, let me try that.

Benoit1980 commented 4 years ago

Just to let you know, in your doc you show a string. https://laravel.com/docs/7.x/cashier-paddle#simple-charge

Benoit1980 commented 4 years ago

I havet tried both as a string and integer, I get the same error for the simple charge. I have create the product and/or subscription in the paddle back end but it is not working.

GrahamCampbell commented 4 years ago

Paddle will tell you the product ID. It's not something you are able to choose.

Benoit1980 commented 4 years ago

Yes I know, I created them in the paddle back end: product id: 596697 Subscription plan: 596246

But none of them work with the simple product, but they work with this code:

$user = User::find(1);

$payLink = $user->newSubscription('default', $premium = 34567)
    ->returnTo(route('home'))
    ->create();

return view('billing', ['payLink' => $payLink]);

Thank you.

Hussam3bd commented 4 years ago

@FreddyCrugger Just make sure to add CASHIER_WEBHOOK in your .env file, the webhook URL is required by Paddle when you create a charge.

Hussam3bd commented 4 years ago

@FreddyCrugger Also for the price Paddle required a minimum amount to charge it was around $0.90, I'm not sure how much it was but you can try to create a product and play around it.

Benoit1980 commented 4 years ago

Thanks, this must be the problem then.

In the doc it says:

To ensure your application can handle Paddle webhooks, be sure to configure the webhook URL in the Paddle control panel. By default, Cashier's webhook controller listens to the /paddle/webhook URL path. The full list of all webhooks you should configure in the Paddle control panel are:

Subscription Created Subscription Updated Subscription Deleted Payment Succeeded Subscription Payment Succeeded

I did not look into this because the simple charge was not mentioned there.

Hussam3bd commented 4 years ago

@FreddyCrugger Your welcome hope it solved your problem,

I think when you charge user things work differently, casher will send a request to Paddle to create pay link and Paddle in this case as the product id is not set will ask for the webhook URL and return URL.

But when you create a subscription you set Paddle's product id and the webhook URL is not required in this case and Paddle will check if you provide webhook ULR in the vendor's dashboard.

Benoit1980 commented 4 years ago

Thanks great explanation. I will have to try it tomorrow night, 1am here :-(

Thanks again and I will revert back if it does not work.

driesvints commented 4 years ago

The 100% off coupon is a great Idea I did not know about it.

Please read the docs: https://laravel.com/docs/7.x/cashier-paddle#testing

Screenshot 2020-07-30 at 13 56 35

Do I have to create the "test onecharge" product in my paddle account first? As this is not explained in the doc. It says simple one time charge.

Again, explained here: https://laravel.com/docs/7.x/cashier-paddle#single-charges. Both simple charges and product charges are explained here.

Just to let you know, in your doc you show a string.

It does not? Please show where you see that. I've spotted one string usage in the subscription docs but all the others use an integer. I'll update that specific example.

I did not look into this because the simple charge was not mentioned there.

The very first step in the installation section says:

Screenshot 2020-07-30 at 14 00 43

Honestly, I don't mind helping out but you've clearly not read the docs closely enough. I'm going to close this now as the issue tracker isn't a support channel but if you try the cashier-paddle channel on Discord I'll try to help you out further.

Benoit1980 commented 4 years ago

Why did you add any comments? Hussam3bd sorted it all for me? Clearly you have not properly read the last comment(it seems to happen to all of us not to read everything fully isn't it)