#dizzydizz1101_webhooks

1 messages ยท Page 1 of 1 (latest)

shrewd kernelBOT
#

๐Ÿ‘‹ 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.

verbal roseBOT
#

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.

dusty escarp
#

๐Ÿ‘‹ happy to help

fading adder
#

Hi Tarzan

dusty escarp
#

you can use the test cards https://docs.stripe.com/testing#disputes to trigger different dispute scenarios

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

fading adder
#

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

dusty escarp
#

when you trigger an event with the Stripe CLI what you're actually running is a 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

fading adder
#

i think i kind of understadn this.

dusty escarp
fading adder
#

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?

dusty escarp
#

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

fading adder
#

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

dusty escarp
#

I'm not sure what this have to do with how you test dispute

#

I'm a bit lost

fading adder
#

this payment failed and it was a sepa payment

dusty escarp
#

ok

fading adder
#

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

dusty escarp
#

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?

fading adder
#

that would be great ๐Ÿ˜‰ an the thing we need

dusty escarp
#

ok perfect

#

and instead of attaching the pm_card_visa to your customer in step 2 you change that to one of the dispute PMs

fading adder
#

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

dusty escarp
#

you can write your own fixture if you want as well

fading adder
#

stripe trigger charge.dispute.created --add payment_intent:customer=cus_QUpGc5UDUACed3

#

is how we start

dusty escarp
dusty escarp
#

and that's not how you should start

#

ok give me a minute I want to try something really quick

fading adder
#

sure take your time

shrewd kernelBOT
dusty escarp
#

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

fading adder
#

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

dusty escarp
#

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

fading adder
#

okay, thats amazing

#

thank you very very much vor you patience and effort to help me

dusty escarp
#

no worries, I'm glad I was able to help

fading adder
#

have a nice day