Create a new customer without relying on Card on File

Created on 29 July 2016, about 9 years ago
Updated 18 August 2025, about 1 month ago

We have a situation where we need to create a customer object when sending over the charge data, even if we don't have the customer ID on hand (via the Card on File module). Considering that Stripe doesn't consider an email address a unique identifier, this makes it difficult (impossible?) to query Stripe for a customer record that may already exist.

I have some code written that I can submit as a patch that will allow the site admin to force the creation of the customer object for every charge. Obviously, this isn't great, we'd prefer to only create the customer if that customer doesn't exist.

A bit more background: We're building a donation system for an organization who has several other donation platforms, so we can't count on parity between the customers that are in Stripe and the customers that are in Drupal Commerce. It may very well be that a donor donated through an external donation page and then they use our system for another donation. We want all donations to show up as charges under one customer object.

Some advice, please? Thanks.

✨ Feature request
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States capellic Austin, Texas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024