Webhook works when I simulate a webhook event, but not when I use my app
jhsmith12345
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jan-05-2019
11:53 PM
Hi all, I have a working listener that can successfully log data from a webhook simulation. When I try to use this webhook with my app, I get nothing from my listener server. The app successfully logs all relevant info in the browser console, and executes a payment. I have an API with webhooks enabled, and am using the clientID given in that API. I'll post some code:
Server:
const express = require("express"); app = express(); app.use(express.json()); const bodyParser = require("body-parser"); app.post("/", (req, res, next) => { console.log(req.body); res.status(200);
res.send("on");
next();
});
app.listen(3000, () => console.log("server started"));
App:
import React from "react"; import PaypalExpressBtn from "react-paypal-express-checkout"; export default class Pay extends React.Component { render() { const onSuccess = payment => { console.log(payment); }; let env = "sandbox"; let currency = "USD"; let total = 3.29; const client = { sandbox: "ID_FROM_MY_API_WITH_WEBHOOKS_ENABLED", production: "YOUR-PRODUCTION-APP-ID" }; return ( <div> <PaypalExpressBtn onSuccess={onSuccess} /> </div> ); } }
Any ideas? It seems like this should all work?!
Labels:
- Labels:
-
Technical Issues
1 REPLY 1
jhsmith12345
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan-07-2019
12:42 PM
I'm fairly convinced this is a paypal bug, have started a ticket. Am going to bump in hopes that someone sees this.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Web hook for subscription evenest not working in Payments Archives
- Is our payment flow correct? in Payments Archives
- Set up subscription without automatic payments? in Payments Archives
- How to update IPN URL in subscripiton? in Payments Archives
- [Integration Question] Webhook event after "get your money" confirmation click? in My Money Archives