'Why is not my webhook calling my backend?

I have an application in C# .NET Core and I am using PAGARME as payment solution (a payment gateway brazilian company) and I have configured web hooks, for example, when cards are created.

As I am developing on localhost, I am using NGROK to expose my application. I have configured my CORS to receive any origin, method and header.

The method that I have created to receive the webhook is working when calling it by postman, but the webhooks are not arriving and accessing my endpoint.

Only one more information: If i use postman to call this method it is working! It is not working from the pagarme system.

Could you tell me if I did something wrong?

My CORS configurations:

My CORS configurations

NGROK configuration:

NGROK configuration

The method I have created to receive the webhook. The method is not implemented, it is only a test:

The method i have created to receive the webhook. The method is not implemented, it is only a test

That is the configuration of webhook on Pagarme system. Look that the url is the same of NGROK with the rest of the endpoint:

That is the configuration of webhook on Pagarme system. Look that the url is the same of NGROK with the rest of the endpoint



Solution 1:[1]

Supposing you have, in your code:

mails = 'email1', 'email2', 'email3'

That is a tuple of strings, i.e.

('email1', 'email2', 'email3')

You can simply convert that into a list by casting:

mails = list(mails)

which will produce

['email1', 'email2', 'email3']

Of course, all depends on your input data. Normally you would retrieve the data from your database and add it instantly to a list or some data structure that supports the intended functionality on that data better than a list.

Solution 2:[2]

Using Regex and list comprehension:

import re
my_list = [re.sub(r"'([^']+)'", r"\1", x) for x in my_list]

Explanation: What is inside single quotes gets added to group which the replacement string \1 is referring to.

Solution 3:[3]

Just Do this:

mails = 'email1', 'email2', 'email3'
mails= list(mails)
print(mails)

and now the result will be the same as you want:

['email1', 'email2', 'email3']

Solution 4:[4]

import json
a_list = json.dumps(emails)

Is how i would do it If i wanted a string representation like what is described...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Karl Knechtel
Solution 2 phk
Solution 3 araz malek
Solution 4 Joran Beasley