Foro
Error al enviar la solicitud. C#
1 day ago by Rene Guerrero
Quiero usar el codigo de la documentacion pero al probarlo no se envia el request, siempre aparece el mensaje:
"Error al enviar la solicitud."
Codigo NET:
var options = new RestClientOptions("<https://gateway-154.netpaydev.com/gateway-ecommerce/v3.2/checkout/session/")>;
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddHeader("Authorization", "secret_key");
request.AddJsonBody("{\"successUrl\":\"<http://example.com/success\",\"cancelUrl\":\"http://example.com/cancel\",\"paymentMethodTypes\":[\"card\"],\"billing\":{\"firstName\":\"Jon\",\"lastName\":\"Doe\",\"email\":\"[[email protected]](mailto:[email protected])\",\"phone\":\"8123478321\",\"address\":{\"city\":\"Aguascalientes\",\"country\":\"MX\",\"postalCode\":\"64700\",\"state\":\"Nuevo> Leon\",\"street1\":\"Filosofos\",\"street2\":\"Tecnologico\"}},\"linkType\":\"NETPAY_CHECKOUT\",\"merchantRefCode\":\"id-transaction-325\",\"lineItems\":[{\"name\":\"Mensualidad\",\"amount\":250,\"quantity\":1,\"currency\":\"MXN\"}]}", false);
var response = await client.PostAsync(request);
Sabran el error o tendran un codigo funciona len C#?