save the token in the write field (was not broking the payment)

This commit is contained in:
2017-05-28 06:12:11 +02:00
parent f76bfca9b5
commit c73f3a9c47

View File

@ -187,6 +187,7 @@ namespace Yavsc.ApiControllers
_logger.LogError(ex.Message);
return new HttpStatusCodeResult(500);
}
if (payment==null) {
_logger.LogError("Error doing SetExpressCheckout, aborting.");
_logger.LogError(JsonConvert.SerializeObject(Startup.PayPalSettings));
@ -200,9 +201,8 @@ namespace Yavsc.ApiControllers
var dbinfo = new PayPalPayment
{
ExecutorId = User.GetUserId(),
PaypalPayerId = payment.Token,
CreationToken = null,
State = "inserted"
CreationToken = payment.Token,
State = payment.Ack.ToString()
};
await _context.SaveChangesAsync(User.GetUserId());
}