#Sébastien-proxy

1 messages · Page 1 of 1 (latest)

dawn trench
#

@ancient hollow there is. Which language are you using for the backend?

ancient hollow
#

and c#

dawn trench
ancient hollow
#

Thank you so much

ancient hollow
#

Hi again ! So I try to implement your solution but it seems to ignore my proxy. I don't know if you can take a look at the code but I just copy pasted it from the github. I don't really know what else I can try. I'm a bit lost actually.. ahah. Could you help me please ?

dawn trench
#

that feels like it should work

#

can you share the full code, like where you make the API request as well?

ancient hollow
#

yeah sure

#

thanks for having a look

#

Server side code

#

Client side - Javascript (copied from stripe)

dawn trench
#

that feels like it should work really. let me test something quickly

ancient hollow
#

ok thanks

dawn trench
#

it does work in general, e.g. this works(well actually it fails because I don't have a proxy in my environment, but you know what I mean).

static void proxyText()
{
   var handler = new HttpClientHandler
   {
       Proxy = new WebProxy("http://local-proxy.net"),
       UseProxy = true,
   };
   var httpClient = new HttpClient(handler);

   var stripeClient = new StripeClient(
       "sk_test_xx",
       httpClient: new SystemNetHttpClient(httpClient)
   );
   StripeConfiguration.StripeClient = stripeClient;

   var service = new CustomerService();
   var customer = service.Create(new CustomerCreateOptions { Description = "test proxy customer" });
   Console.WriteLine(customer.Id);
}
#

I don't really know anything about ASP or your "Configure" method or when that gets called though

ancient hollow
#

Okok I’ll try with your code

#

Maybe it’s just a little mistake somewhere

dawn trench
#

maybe StripeConfiguration is only global in a single file

#

so try setting it in the route controller as well, or at least set it in the Create route that creates the PaymentIntent there to at least get unblocked