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

This commit is contained in:
Paul Schneider 2017-05-28 06:12:11 +02:00
commit e4b73377de

View file

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