Comments (8)
However, when the user already exists, the ManagesCustomer::createAsCustomer() method fails to create a customer with the same email address, throwing a PaddleException.
That's not possible. The method already checks if the billable has a customer attached here:
So I don't see how it's possible Cashier attempts to create a customer twice for the same billable for you?
from cashier-paddle.
Hello @driesvints,
I'm sorry I haven't explained properly. I meant to say this instead:
However, when the user already exists on Paddle's end but not in the database, the ManagesCustomer::createAsCustomer() method fails to create a customer with the same email address, throwing a PaddleException.
In other words, this is how it can happen:
- I have an existing
Customer
entity, linked to a billableUser
entity, with the email of[email protected]
. - Due to whatever reason, I run
php artisan migrate:fresh
. This recreates all the tables. - I try to create the user with the same email address of
[email protected]
. Since there is noCustomer
entity attached to the user,$customer = $this->customer
fails, andManagesCustomer::createAsCustomer()
proceeds with user creation. - Since a user already exists, the Paddle API returns an error stating that said user already exists.
This can also happen if two separate applications using laravel/cashier-paddle
are using the same Paddle account. One of them might not have a Customer
entity linked, and therefore encounter the aforementioned error when it tries to create what it thinks is a new user, but it already exists on Paddle's end.
from cashier-paddle.
I'm afraid this is impossible. It's not possible to use Cashier Paddle with existing Paddle accounts and customers, only new ones. This is because there's no way from Paddle's side to retrieve a customer by email address.
This can also happen if two separate applications using laravel/cashier-paddle are using the same Paddle account.
This also is impossible to do. You should never try to use two Laravel apps with the same Paddle account.
If there was a way from Paddle to retrieve customers by email address we could attempt to retrieve the customer before creating them and then sync them in through the createAsCustomer
method.
from cashier-paddle.
I've tried explaining it here: laravel/docs#9189
from cashier-paddle.
Wait, apparently it is possible to search for a customer by email: laravel/docs#9189. I'll try to see what I can do here.
from cashier-paddle.
Wait, apparently it is possible to search for a customer by email
There is no need to search the customer email by ID in this case, since the error message from Paddle itself returns the conflicting customer ID, and that can be passed on to the GetCustomer API, as I mentioned above.
This also is impossible to do. You should never try to use two Laravel apps with the same Paddle account.
The only issue that I see is the lack of separation of transactions would lead to notifications being sent through the webhook that are not relevant for one application. That discussion is for another issue though, and I could work around that by filtering the product IDs myself, in my own webhook handlers.
from cashier-paddle.
Thanks. Continuing the discussion in #219
from cashier-paddle.
I've sent in a fix for this: #220
from cashier-paddle.
Related Issues (20)
- 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 6
- 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 10
- Laravel cashier-paddle package conflict with passport Auth Header HOT 1
- Paddle with Passport giving: Authentication header included, but incorrectly formatted HOT 3
- Pausing Subscriptions HOT 1
- Applying a discount on checkout HOT 1
- Problem with billing API - Transaction not created in the db HOT 13
- Changing email on the payment screen HOT 5
- Activate subscription is not working. HOT 10
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.