#greenlane-otavio_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1285181981482684488
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- greenlane-otavio_code, 3 days ago, 13 messages
I hope this message finds you well.
I am currently testing Stripe using the CLI sandbox, following the instructions provided in your documentation. Specifically, I am trying to overwrite the metadata field while triggering an event using the command below:
stripe trigger payment_method.attached --override metadata:GREANLANE_USER_ID="2342342"
However, the metadata field remains empty despite using this command, and the override does not seem to work as expected.
For reference, here is the relevant portion of the JSON response I am seeing, where the metadata field remains empty:
Event id: evt_1Pxol61njmFqhzphBEhuq096
https://dashboard.stripe.com/test/workbench/events/evt_1Pxol61njmFqhzphBEhuq096
{ "object": { "id": "pm_1Pxol51njmFqhzphM8t7YS5Q", "object": "payment_method", "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, "country": null, "line1": null, "line2": null, "postal_code": null, "state": null }, "email": null, "name": null, "phone": null }, "card": { "brand": "visa", "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "pass" }, "country": "US", "display_brand": "visa", "exp_month": 9, "exp_year": 2025, "fingerprint": "5HEtFZvMGkYtkqh2", "funding": "credit", "generated_from": null, "last4": "4242", "networks": { "available": [ "visa" ], "preferred": null }, "three_d_secure_usage": { "supported": true }, "wallet": null }, "created": 1726054251, "customer": "cus_QpTiETw2bjbYBH", "livemode": false, "metadata": {}, "type": "card" }, "previous_attributes": null }
Could you please help me understand how to correctly fill in the metadata during sandbox testing?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
What are you trying to achieve exactly?
And what are you trying to test?
CLI event triggers are only good to test webhooks.
I am changing the: "metadata": {}
That is what I would love to do
And Yes, I am testing the payment method webhooks
Changing where exactly? On which object?
Can you see the json that I sent to you?
at the metadata field
That is the command that I am running:
stripe trigger payment_method.attached --override metadata:GREANLANE_USER_ID="2342342"
I undertstand that you want to update metadata field. But most Stripe objects have a metadata field, and stripe trigger might require creating multiple test objects to simulate sending an event.
On which exact object do you want to set the metadata?
On the fixture definition you can see that you can't override the metadata field: https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/payment_method.attached.json
Fixtures/Triggers are fine to test the most basic event scenarios, but if you want any better level of customization, I recommend building a simple integration in Test mode and use test cards: https://stripe.com/docs/testing
I do need any feild to link the payment method to my user
If I cannot do it at metadata, how can I procedure it?
When I ran:
stripe trigger payment_method.attached --override payment_method_attach:metadata.GREANLANE_USER_ID=2342342
it returns:
Setting up fixture for: customer Running fixture for: customer Setting up fixture for: payment_method_attach Running fixture for: payment_method_attach Trigger failed: Request failed, status=400, body={ "error": { "code": "parameter_unknown", "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown", "message": "Received unknown parameter: metadata", "param": "metadata", "request_log_url": "https://dashboard.stripe.com/test/logs/req_3r6SEmyCJMZpP2?t=1726482828", "type": "invalid_request_error" } }
I can do with:
stripe trigger payment_method.attached --override payment_method_attach:customer=cus_QrKxrpmchaW2IM
But not with the metadata. I need some field to link to my system
I need some field to link to my system
What do you mean by this?
As I mentioned. This is not possible with CLI stripe trigger command.
Ok, is there any way to trigger a webhook without CLI?
I recommend building a simple integration in Test mode and use test cards: https://stripe.com/docs/testing