Closed stefanzweifel closed 4 years ago
I am not able to build paylink using this code
$payLink = $user->newSubscription('default', $paddlePlanId)
->returnTo(route('home'))
->create();
I got blank screen,
anyone has similar issues
"laravel/cashier-paddle": "^1.0@beta",
"laravel/framework": "^7.0",
"php": "^7.2.5",
@stefanzweifel I can confirm this doesn't work. I'll pick this up with Paddle.
@alzaabi98 that works perfectly for me. I think that might be due to a network issue on your end? Maybe best to pick up with Paddle itself.
@stefanzweifel I just tested this again and Product coupons work for me. Can you please share your exact setup of products and the product coupon?
Hi @stefanzweifel, there is a known issue with checkout coupons and the pay link API that cashier makes use of. As Dries has mentioned, there shouldn't be an issue with product coupons so we'd encourage you to use them for the time being.
I've added this thread to our bug tracker and will endeavour to keep you updated when a fix is pushed out.
@driesvints I was able to make it via normal paddle href with plan id. I am not sure why I am getting blank screen with no errors. I dont think it is network issue. Do you have full sample to test method in laravel ? thanks
@alzaabi98 the snippet you posted is the full example.
@alzaabi98 the snippet you posted is the full example.
so " ->returnTo(route('home'))" does not mean to route to home after you get url ? I thought it means that..
Now I changed my code this way and it worked :
$payLink = $user->newSubscription('default', 'planId')
->returnTo(route('home'))
->create();
return view('home')->with('payLink', $payLink);
I'm not really sure what's unclear in the docs. The docs here tell you to use the pay link in a Blade component:
Further down at subscriptions it also notes:
The returnTo method accepts a URL that your user will be redirected to after they successfully complete the checkout.
Further down at subscriptions it also notes:
The returnTo method accepts a URL that your user will be redirected to after they successfully complete the checkout.
I thought returnto mean will route you to home to see the button but it means when you complete the transaction it will route you back. my be my mistake .. thanks
@driesvints @kieran-paddle Thanks for the info about checkout-coupons. After thinking about a minute about it, this makes total sense to me (as a paylink is for a product subscription).
My reported bug was a mistake on my side however. Forgot to link the product-coupon with my plans 🤦 Now everything works as expected.
Sorry for the noise :)
@stefanzweifel glad you found a fix 👍
I'm gonna leave this open a while longer to follow up until Paddle has fixed checkout coupons.
Just to let you know, I got caught with the exact same issue from your doc. I thought that:
->returnTo(route('home'))
Was the actual returned view until I saw this post and this:
$payLink = $user->newSubscription('default', 'planId')
->returnTo(route('home'))
->create();
return view('home')->with('payLink', $payLink);
A lot of people will get caught with this I believe. It would be nice to have this added to the example in your doc:
return view('home')->with('payLink', $payLink);
Thanks
Yeah I agree. I sent in a pr here: https://github.com/laravel/docs/pull/6109
@driesvints(and anyone else following this), I pushed a fix for checkout coupons today so they will now work for checkouts generated with the pay link API. Sorry it took a little while to get out!
Works again indeed! Thanks @kieran-paddle.
Description:
I'm trying to apply a coupon to a pay link by using the SubscriptionBuilder and the
withCoupon()
-method.In my app, the checkout process looks like this:
However, the coupon code doesn't seem to be applied. The price is not reduced and the user still has the option to add the coupon again by clicking "Add Coupon". (The coupon is valid as it's being applied when doing on paddle.com)
While debugging I've seen, that the coupon is available during the
buildPayload
-method call. The value is also still present before callingCashier::post()
hereI have the problem both with "Checkout" and "Product" Coupons.
Steps To Reproduce:
Build a paylink by using
withCoupon()
.