#Rob.Clayton
1 messages · Page 1 of 1 (latest)
Where do you set the metadata and which object are you trying to search from?
at the customer level, and I'm trying to retrieve the customer by that metadata "handle"
it's an id that matches with something in our own db
customer = stripe.Customer.create(
email="jenny.rosen@example.com",
test_clock=test_clock.id,
payment_method="pm_card_visa",
metadata={"account_id": "85b83f41-7e99-4cdb-9541-0aff438b6491"},
invoice_settings={"default_payment_method": "pm_card_visa"},
api_key=stripe_client.api_key,
)
line_items = [
LineItem(
PriceID="price_1N4CkfDBF4LGcRTgnsCo96IQ", quantity=1
), # Add tier 1 monthly
LineItem(
PriceID="price_1N4zAuDBF4LGcRTg1HXkQ7DZ", quantity=10
), # Add monthly paid licenses
]
subscription = stripe_client.create_stripe_subscription(
account_id="85b83f41-7e99-4cdb-9541-0aff438b6491",
payment_method="pm_card_visa",
promo_code=None,
line_items=line_items,
)
that's my test code
actually .... no ... I shouldn't show you that piece of code
just know that the stripe_client call is searching against the account_id metadata
I see! Sometimes it'll take time to for the metadata to become searchable
ahhhhhh
is there a away to deal with that?
since we rely on it as a linking point back to our db
Why don't you save the customer ID associated to the account_id instead? In the above code, you have already had the customer ID from stripe.Customer.create, why extra search is needed?
we have done the reverse, and not modified our db, but added a meta data column holding our id so we can find it. Yes, we could change our db, but that's not a good fit.
That's okay though, I can work through that.
I'm now trying to progress the time clock, and because you can only do two cycles at a time, I'm trying to progress it a cycle at a time 12 times ...
without using webhook events, can I avoid this error:
This means that the same test clock is under advancement and there's a conflict. You can't have two advancement on the same test clock at the same time
is there a way I can wait for the advancement to complete without using webhooks (I'm trying to write a test harness)?
I'm afraid that will not be possible
ah, ok