#dizzydizz1101_webhooks
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/1264872975413280798
๐ 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.
- dizzydizz1101_api, 2 days ago, 86 messages
๐ happy to help
Hi Tarzan
you can use the test cards https://docs.stripe.com/testing#disputes to trigger different dispute scenarios
maybe i am totally wrong, but the testcards dont have anything to do with using the payment intent stripe cli trigger?
and our customers use sepa, anyways so the testcustomer has sepa as payment method
when you trigger an event with the Stripe CLI what you're actually running is a fixture
for example the stripe trigger charge.dispute.created would run this fixture https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/charge.dispute.created.json
what you can do then is you can override https://docs.stripe.com/cli/trigger#trigger-override the parameters you want in this fixture
in this case you can override the payment_method
and you can pass any of the values you can find for the testing cards I gave you
i think i kind of understadn this.
please use the PaymentMethod names though https://docs.stripe.com/testing?testing-method=payment-methods#disputes
but the problem is, that we save the customer id from our backand as metadat in the customer
so i run cli with stripe trigger charge.dispute.created with the customer id flag
then i also can retrieve the our customer id, but i then need to initiate a new invocie where i want to grab the elements of the last invoice and add a fee for the failed payment and sent it to the cusomter
so this is where we stuck in testing neither with the charge id nor the payment_intent id we can make it work to test our function cause we can not retrieve the invoice id of the failed dispute
you understand what we need to do?
in that case instead of running the charge.dispute.created you can trigger an invoice event
and instead of the payment method that is passed you override it with the PMs from the testing suite I shared with you
but when the inivoice is created we dont know if the SEPA payment of the customer later will fail and we need to block him out of the system
and all SEPA events are first marked as paid and even if the cusomter then afterwards blocks the payment in the system it is still marked as paid
this payment failed and it was a sepa payment
ok
we now need a webhook to log the customer out of the system when it fails
so we need the charge.dispute.created to test our webhook if everything is working correct
but we are not able to retrieve additional information when using the cli like shown in the opening message we did send you
so is there no way we can say, run the trigger for this customer for a certain invoice or pament_intent to get all the additional information ?
in the events everything looks like it was succeeded, but we did not recieve the money, cause the bank or the customer blocked it afterwards
ok let's put the live mode invoice aside for a sec
and focus on how to replicate this in test mode
would that be good as a first step?
that would be great ๐ an the thing we need
ok perfect
that was what I was trying to suggest here #1264872975413280798 message
you can run the invoice.paid event https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/invoice.paid.json
and you can add the --edit https://docs.stripe.com/cli/trigger#trigger-edit flag
and instead of attaching the pm_card_visa to your customer in step 2 you change that to one of the dispute PMs
I'm a bit lost
can we maybe just write this in the 3 cli commands it probably needs for a existing customer in our test envirionment
you can write your own fixture if you want as well
stripe trigger charge.dispute.created --add payment_intent:customer=cus_QUpGc5UDUACed3
is how we start
it's discribed here https://docs.stripe.com/cli/fixtures
that won't be linked to an invoice
and that's not how you should start
ok give me a minute I want to try something really quick
sure take your time
you can run a custom fixture as I mentioned with the following file
{
"_meta": {
"template_version": 0
},
"fixtures": [
{
"name": "customer",
"path": "/v1/customers/cus_xxx",
"method": "get",
"params": {
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_createDisputeProductNotReceived/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
{
"name": "invoiceitem",
"path": "/v1/invoiceitems",
"method": "post",
"params": {
"amount": 2000,
"currency": "usd",
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
}
},
{
"name": "invoice",
"path": "/v1/invoices",
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
"name": "invoice_pay",
"path": "/v1/invoices/${invoice:id}/pay",
"method": "post",
"params": {
"payment_method": "${payment_method:id}"
}
}
]
}```
but you need to replace cus_xxx with your customer ID
thank you very very much
โ๏ธ
i am not able to try it right now, but i asume this then returns a payment intent it, we can copy and run with: stripe trigger charge.dispute.created --add payment_intent=pi_XXXXXX
no!
this would generate all of the events from invoice.paid to charge.dispute.created
you don't need to do anything else
a fixture runs multiple API calls
okay, thats amazing
thank you very very much vor you patience and effort to help me
no worries, I'm glad I was able to help
have a nice day