Skip to content

Opening a webhook endpoint to receive data from external server about a payment. Rowy duplicating response #1401

Answered by Chadha93
Ausint asked this question in Support / Q&A
Discussion options

You must be logged in to vote

@Ausint
To handle the webhook event and prevent duplication of responses, you can use a Cloud Function in Google Cloud Platform (GCP) written in JavaScript. Here's an example of how you can implement it:

exports.yocoWebhook = (req, res) => {
  // Verify the request is a POST request
  if (req.method !== 'POST') {
    res.status(405).send('Method Not Allowed');
    return;
  }

  // Get the request body
  const requestBody = req.body;

  // Process the received data and extract metadata
  // Replace this with your own logic to handle the payment data
  const paymentData = requestBody.payment_data;

  // Create an in-app order notification using the metadata
  // Replace this with your own …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Chadha93
Comment options

Chadha93 Nov 6, 2023
Collaborator

Answer selected by Chadha93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants