Closed enkota closed 4 years ago
I can see under ManagesCustomer
you are referencing the email column on the particular model. It would be good to override so we can set the customer_email
in the create method.
public function paddleEmail()
{
return $this->email;
}
Hey @enkota. Please read the core concepts in the docs, particularly the section here: https://laravel.com/docs/7.x/cashier-paddle#user-identification
We take over control of the customer_email
key in Cashier to ensure every payment made is properly linked to the same use in Paddle. This is absolutely vital to make sure Cashier Paddle works properly.
Unfortunately this is due to how Paddle's user identification works and there's no other way for us to achieve this.
Hey @driesvints. I understand that you need to control the customer_email
key, however, at the moment when using a different Billable
model than User
, the payLink will not assign to any email and require the user to enter one on the pop-up.
I do not need to update the email after creation, only the inital subscription where the Tenant
owner is the relation to the user.
If you’d rather not allow the email to be passed on the create()
method, would you allow the email to be passed through newSubscription()
?
For my case, adding the relation to paddleEmail
works perfectly since the Tenant
belongs to the owner (User):
public function paddleEmail()
{
return $this->owner->email;
}
This would be useful as at the moment no email can be assigned on a Billable model outside User
.
Thanks!
If you’d rather not allow the email to be passed on the create() method, would you allow the email to be passed through newSubscription()?
Hmm we don't allow that anywhere?
I think you're looking for https://laravel.com/docs/7.x/cashier-paddle#customer-defaults. You can overwrite the paddleEmail
method just like you did. It was intended to be used like this. I'm not sure if I understand you completely correctly?
Hey @driesvints ahh sorry, missed that part in the docs. Didn’t realise we could override that on the Model. All makes sense now :) Thanks!
Hey again,
When using something other than
User
forBillable
I can't seem to pass through thecustomer_email
parameter as specified on the Paddle docs.Price seems to work fine, but using
customer_email
will not pre-fill the email field. I have tried addingmarketing_consent = 1
as it mentions this is required but no difference.Thanks!