You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public object SendCreditCardPayment(dynamic body, dynamic order)
{
try
{
string orderID = GetOrderID(order);
string basicAuthUserName = "sk_test_algumcodigo"; // sua secret key
string basicAuthPassword = "";
MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
//string customerId = "cus_6l5dMWZ0hkHZ4XnE";
//var query = client.Customers.GetCustomer(customerId);
//if() ... tratar cliente
var customer = new CreateCustomerRequest
{
Name = "Consumidor",
Email = "[email protected]",
};
var request = new CreateChargeRequest()
{
Amount = body.amount,
Code = orderID,
Customer = customer,
Payment = new CreatePaymentRequest()
{
PaymentMethod = body.paymentMethod,
CreditCard = new CreateCreditCardPaymentRequest()
{
Card = new CreateCardRequest
{
Number = "4000000000000010",
HolderName = body.card.holderName,
ExpMonth = body.card.expMonth,
ExpYear = body.card.expYear,
Cvv = body.card.cvv,
}
}
}
};
GetChargeResponse response = client.Charges.CreateCharge(request);
var result = JObject.FromObject(response);
return result;
}
catch (Exception ex)
{
throw ex;
}
Quando vou obter a resposta dá erro de parse no campo due_at pois retorna nulo. Eu vejo que a cobrança é gerada mas não consegue associar na resposta. Já usei até var no lugar do tipo GetChargeResponse, mas o erro é o mesmo. Como pode ser resolvido essa situação?
The text was updated successfully, but these errors were encountered:
Quando vou obter a resposta dá erro de parse no campo
due_at
pois retorna nulo. Eu vejo que a cobrança é gerada mas não consegue associar na resposta. Já usei atévar
no lugar do tipoGetChargeResponse
, mas o erro é o mesmo. Como pode ser resolvido essa situação?The text was updated successfully, but these errors were encountered: