Stripe Does Not Attempt to Contact My Webhook - stripe-payments

I am building my first Stripe integration with a Wordpress plugin and cannot get Stripe to attempt to contact my webhook. I have followed the instructions at https://stripe.com/docs/checkout/integration-builder and successfully made some test payments. Then I copied and pasted the sample code at https://stripe.com/docs/payments/checkout/fulfill-orders into a file named webhook.php and configured the CLI stripe listen setting with that URL except instead of localhost mine starts with 127.0.0.1. Then I pasted the webhook authentication code into the webhook.php file and made another test payment. It worked fine, but there was no attempt to access the webhook.
What am I missing, is there something I need to add to the sample app from the first URL I listed to instruct the checkout process to ping my server? The sample app does not include a webhook and the page with the fulfillment instructions has no link to any sample app, so I can't tell if I need to add anything more to my create-checkout-session.php file. The Stripe instructions are not very good.
There is also no way to type anything into cmd.exe after it gives me my webhook signing secret. It just has a blinking _ character underneath the line with the secret and anything I try to type anything nothing appears on the screen.
I checked my account on the Stripe website and under the checkout.session.completed event it says "No recent webhook attempts"

My problem was that there are two types of webhook listeners. One is called Direct en the other Connect.
When you create a webhook you can select the box: Listen to events on Connected accounts. Tick it and you create a Connect listener. Don't tick and it's a Direct one.
In my case a charge.succeeded was only listened to in the Direct version of the listener.
Exactly why eludes me. But the support said:
"The first webhook [the Connected type] that you create will inform you regarding the connected accounts."
"And the second one [the Direct type] from your platform"

It sounds like Stripe CLI may not have been running properly; are you following the instructions here? https://stripe.com/docs/stripe-cli/webhooks

Related

Stripe API testing automation

Background
I am integrating stripe API into my site to take one off payments. My site will be API first on server side with a separate web and mobile front end. I am working on the API server side code. I will eventually use stripe payment pages to take credit card payments. I am trying to automate the testing of my APIs and am bamboozled by the documentation (which are thorough) as I just can't see what steps to take next.
My server side initiates a call with stripe using stripe sdk to create a stripe Session object - this contains a URL to redirect to checkout.stripe.com/pay/..., a success URL when payment is successful and a cancel URL (these I set to handle the callback).
Problem
I can automate in Postman all my API calls from Browse Products, Select Product, Place Order but the next step I am stuck. After Placing Order I get back the stripe session but how can I mimick making the payment with stripe for the session and then call my Success URL ?
When the site is complete I will redirect the UI to stripe to take payments but I am testing and completing the back end flow first.
I have copied and pasted the session URL which is returned by the stripe Session object to bring up the page in a browser and used Dev tools on Chrome to inspect Network to see which APIs are being called by stripe in an attempt to reproduce and I can see a POST to stripe.com/api/payment_methods and I can see the posted values but I can't reproduce this in Postman. Also, the documentation (https://stripe.com/docs/api/payment_methods/create) says
"Instead of creating a PaymentMethod directly, we recommend using the
PaymentsIntents API to accept a payment immediately"
Question
Which stripe APIs do I need to call to automate the flow from a stripe Session object to make a payment and then check that it was successful? Payment Methods? Make a Charge? Payments Intents? ...and how. Happy to be pointed to the documentation if you can help me understand the flow.
TIA
Checkout is a Stripe product that looks like a "box" and you can't know (and shouldn't need to know) what happens inside. It is created for the purpose that merchants won't have to think about what's being done under the hood.
Speaking from an automation perspective, you can try to reproduce the whole process but there's no guarantee it won't change in the future, and it could leave you with more problems later.
For options to reproduce:
The closest way is simulating browser filling and submission, using automated browser tools (ie Selenium). But it's not as straightforward as PostMan. Generally you would want to simulate every browser action that a human could do.
Or you can try to accomplish the same with the logs and events you receive on Stripe's Dashboard, when you test a Checkout Session by yourself. From now there are 3 requests.
And your goal is to receive the same 5 events in Webhook:
TBH I recommend to reconsider the need of this test, to see if it worth your efforts.

Plaid with Stripte PRODUCT_NOT_READY 400 Error

I used ACH transfer with plaid and stripe my website.
Bank connections are currently working. However, after connecting their bank account, the user gets a 400 server error that prevents them from being redirected to the dashboard.
I believe the error code associated with this issue is PRODUCT_NOT_READY
https://plaid.com/docs/errors/assets/#product_not_ready.
The server is a node server.
I want to know how I can fix this error.
Regards
Are you tracking the webhook? It seems that the server will send you a WebHook to the endpoint and only after that the resource will be available.
The Plaid server will send you a PRODUCT_READY webhook before you can call /asset_report/get
The PRODUCT_NOT_READY error you linked to is of type ASSET_REPORT_ERROR. If you're using Plaid for ACH transfers, you're probably not using Assets and you're probably getting the PRODUCT_NOT_READY error of type ITEM_ERROR. For that error, the likely causes listed are:
/transactions/get was called before the first 30 days of transaction data could be pulled. [Not relevant to you if you're not using transactions]
/auth/get was called on an Item that hasn't been verified, which is possible when using micro-deposit based verification [probably the cause of your problem]
Like Nikolas L. says, you will need to listen for webhooks, in this case to be alerted when the Item has been verified.

Quire webhooks API

I have difficult to understand how webooks works. From documentation (https://quire.io/dev/api/#webhook) there is a section about Notification, and so:
"If the app wants to receive notifications of a specific projects or tasks, it can follow the projects or apps by sending a PUT request to the URL. To add a follower, the body of the request can be"
First question: Where should i send the put request?
What i want to do is to send task creation (and edit) on a specific nodejs server (listening over https). I have added my server url to "webhook" section in my app settings.
Second question: If above step is correct, what are the next steps?
Thansk, Nicola
1) the PUT request is sent to the resource you want to follow:
e.g. to follow an existing task you have to update a task using the addFollowers parameter
Four your case you'd have to follow a Project and see filter the notifications are posted to your webhook endpoint.
More detail was given in this duplicate question in github
2) next steps would be to implement your webhook endpoint and listen to notifications.

Zapier Webhook issue

I've set up a ZAP so that when a subscriber is added to my aweber email list they are automatically added to a product in my membership plugin called DAP or digital access pass.
As per the instructions of the membership plugins developers, I am using a webhook in the zapier 'post' section.
It's not working. Quite simply the webhook doesn't appear to be calling anything.
Now, weird thing is that zapier logs show the webhook has been sent and has had success. But from DAP's end nothing is being received.
The support team at DAP tell me that the script isn't being called, because nothing appears in their logs.
They show me this by putting the webhook URL into a browser and calling it that way, and THEN the relevant info arrives in the DAP logs.
Zapier told me they do not trouble shoot and so advised that I post here.
Would appreciate any help. Thank you very much.
Dan
You can easily test if Zapier is making a call or not by sending the request to http://requestb.in
Steps:
Create a request bin and copy the URL.
Request bin screenshot
In Zapier, replace the webhooks post URL with the requestb.in URL.
Now, whenever the Webhook makes a post request, you should be able to visit the inspect page of your bin and check if a request was received. Just add ?inspect to the end of the URL. For example, if your Request bin URL is https://requestb.in/wbto8jwb then you should visit https://requestb.in/wbto8jwb?inspect
The inspect page will show all the requests received.
With this, you will know if Zapier is sending the requests. If the requests are being received by request bin then there is something which needs to be fixed by DAP.
Note that it could also be something in the configuration of the Webhook that is causing the request to not be recognised by DAP. It will help if you add more details to your question - what format is the DAP team expecting to receive the data in?
Below is a sample Webhook implementation in Zapier.
I have added a hook to POST data to a request bin (https://requestb.in/wbto8jwb)
Webhook POST screenshot
When I test this step, the request is received in the Request Bin Inspect page (https://requestb.in/wbto8jwb?inspect).
Request Bin Screenshot
More reading:
https://zapier.com/help/webhooks/
Update:
You can also make a direct call to the DAP API by using a tool like https://www.hurl.it/. From the drop down in destination, select POST and put the URL here. Click on Add body and paste the raw data from request bin. Now ask the DAP team to check if the request was received.

Slack API send commands via webhook

I am not sure if what I am trying to do is even possible. I have a Slack App and via that SlackApp I want to control another Slack App which is not mine.
That's probably too abstract, so let's get into detail:
There is the SlackApp Foodtrain. If you are a user you just type "/lunchtrain Location Time" and it does it's job. I want my App to activate a Lunchtrain but if I just send a Message via Webhook thats '/lunchtrain Location Time' it doesn't activate the command. You can see it in plaintext. Is there any way to do this properly?
Thanks everybody for the help!
The official Slack API does not allow you to issue slash commands, but there is an undocumented API method called chat.command that has this functionality.
Usage example:
https://slack.com/api/chat.command?token=TOKEN&channel=C123456789&command=/who
Check out the documentation for the method on this github for details.

Resources