Android Question C# to B4A Please help! Thanks in advance

jeruelx5d

New Member
Masters,

Please anyone can help me translate this to B4A Code? Thanks a lot!

START**********************************
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.paymongo.com/v1/sources"),
Headers =
{
{ "accept", "application/json" },
{ "authorization", "Basic cGtfdGVzdF96VnFYNjNWTGZ3NjZYckFjM2pZdDQ1dEE6" },
},
Content = new StringContent("{\"data\":{\"attributes\":{\"amount\":10000,\"redirect\":{\"success\":\"https://surseco1.ph/api/PaymentSuccess.aspx\",\"failed\":\"https://surseco1.ph/api/PaymentFailed.aspx\"},\"type\":\"gcash\",\"currency\":\"PHP\"}}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}

END*********************************
 
Top