Closed haszzam closed 11 months ago
Ok I found the source for this issue,
The createAsCustomer
method sends the trial_ends_at
property to paddle with the create customer POST request, and in my case since I want a free trial without payment method upfront Paddle is not expecting trial_ends_at
property so it throws the following error
I was able to get it to work by updating the createAsCustomer
method and unsetting the trial_ends_at
from the $options
array, like so.
This was just to test if it's gonna work or not, but this method needs to be updated to handle generic trials.
Thanks! I've sent in a PR for this one.
Great, thank you!
Cashier Paddle Version
2.1.0
Laravel Version
10.10
PHP Version
8.1
Database Driver & Version
sqlite
Description
I'm trying to integrate the new Paddle Billing with my laravel app, I'm not able to craete a customer.
I want to offer a free trial without payment method upfront and I followed the documentations like so
In the
RegisteredUserController
Controller right after I create the new user I try to make it as a customer like so$user->createAsCustomer([ 'trial_ends_at' => now()->addDays(7) ]);
But I keep getting this error and I don't know if it's an issue with Paddle or with Cashier.
I have all the required env variables set:
PADDLE_SANDBOX=true PADDLE_SELLER_ID= # Set to my seller ID PADDLE_AUTH_CODE= # Set to y API Key PADDLE_WEBHOOK_SECRET= # Set to my webhook secret
I don't know if anyone else is having this issue, or is it just me.
Steps To Reproduce
RegisteredUserController
add the following line$user->createAsCustomer([ 'trial_ends_at' => now()->addDays(7) ]);
right after you create the user.