#jwerre

1 messages · Page 1 of 1 (latest)

ornate lanceBOT
gritty jetty
#

req_I7sRdTGUmL32JS

#

This is the request id where I create the customer

static stone
#

Do you have the exact code with the query string that I can look at? My guess is that you're adding extra quotation marks, but I can't tell for sure without seeing what you're running on your end

gritty jetty
#
customersSearch = await stripe.customers.search({ query: `metadata["user-id"]:"${id.toString()}"`});```
static stone
#

What's the Customer ID of the customer that has that metadata?

gritty jetty
#

It's just a random mongodb ID

#

"642c9cd225e4ad06081814c1"

#

... something like this

static stone
#

No, I mean the Customer object ID that Stripe uses. Should look like cus_abc123

gritty jetty
#

It's delete after my unit tests complete but the request id is: req_I7sRdTGUmL32JS

#

Here is the search request: req_RbSDr8dPUBp2RK

#

I can run it again and not delete if you like

#

... going to hang it up for the day. I'll check on this tomorrow. Thanks for your help.

static stone
#

Ah, unfortunately I need a Customer ID from the Customer that has the metadata in order to confirm. Feel free to hop back in when you're back online

ornate lanceBOT
gritty jetty
#

Ok so here is the customer:

{
  id: 'cus_NeblNbN0eO01MT',
  object: 'customer',
  address: {
    city: 'Orlando',
    country: 'US',
    line1: '123 Palm St.',
    line2: null,
    postal_code: '32789',
    state: 'FL'
  },
  balance: 0,
  created: 1680648108,
  currency: null,
  default_source: null,
  delinquent: false,
  description: null,
  discount: null,
  email: 'billing-lg2uhnd9@surveyplanet.com',
  invoice_prefix: '89327431',
  invoice_settings: {
    custom_fields: null,
    default_payment_method: null,
    footer: null,
    rendering_options: null
  },
  livemode: false,
  metadata: {
    'user-email': 'lg2uhnd9@surveyplanet.com',
    'user-id': '642ca7ab5e2e801121957046'
  },
  name: 'Acme Inc.',
  next_invoice_sequence: 1,
  phone: '5555555555',
  preferred_locales: [],
  shipping: null,
  tax_exempt: 'exempt',
  tax_ids: {
    object: 'list',
    data: [ [Object] ],
    has_more: false,
    total_count: 1,
    url: '/v1/customers/cus_NeblNbN0eO01MT/tax_ids'
  },
  test_clock: null
}
#

It is not deleted

#

Searching with the following produces nothing:

customersSearch = await stripe.customers.search({ query: `metadata["user-id"]:"642ca7ab5e2e801121957046"`});
north sleet
#

Are you still receiving 0 results?

gritty jetty
#

Ok, I put a delay and retry in my unit test an then it was able to find the customer after 3 retries and about 12 seconds

#
this.retries(5);
await new Promise( (resolve) => setTimeout(resolve, 4000) );