going to live
This commit is contained in:
parent
893d5a5ecf
commit
000a984659
21 changed files with 2495 additions and 183 deletions
|
|
@ -88,13 +88,15 @@ namespace Yavsc.ApiControllers
|
|||
[HttpPost("createpayment/{id}")]
|
||||
public async Task<IActionResult> CreatePayment(long id)
|
||||
{
|
||||
var apiContext = _paymentSettings.CreateAPIContext();
|
||||
var apiContext = PayPalHelpers.CreateAPIContext();
|
||||
|
||||
var query = await _context.HairCutQueries.Include(q => q.Client).
|
||||
Include(q => q.Client.PostalAddress).Include(q => q.Prestation).Include(q=>q.Regularisation)
|
||||
.SingleAsync(q => q.Id == id);
|
||||
if (query.PaymentId!=null)
|
||||
return new BadRequestObjectResult(new { error = "An existing payment process already exists" });
|
||||
query.SelectedProfile = _context.BrusherProfile.Single(p => p.UserId == query.PerformerId);
|
||||
|
||||
var payment = Request.CreatePayment("HairCutCommand",apiContext, query, "sale", _logger);
|
||||
switch (payment.state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Yavsc.ApiControllers
|
|||
p=>p.PaypalPaymentId==paymentId)
|
||||
};
|
||||
await Task.Run( () => {
|
||||
var apiContext = paymentSettings.CreateAPIContext();
|
||||
var apiContext = PayPalHelpers.CreateAPIContext();
|
||||
result.FromPaypal = Payment.Get(apiContext,paymentId);
|
||||
});
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ namespace Yavsc.ApiControllers
|
|||
{
|
||||
Payment result=null;
|
||||
await Task.Run( () => {
|
||||
var apiContext = paymentSettings.CreateAPIContext();
|
||||
var apiContext = PayPalHelpers.CreateAPIContext();
|
||||
var payment = Payment.Get(apiContext,paymentId);
|
||||
var execution = new PaymentExecution();
|
||||
execution.payer_id = payerId;
|
||||
|
|
@ -64,7 +64,7 @@ namespace Yavsc.ApiControllers
|
|||
[HttpPost("create"),AllowAnonymous]
|
||||
public IActionResult Create()
|
||||
{
|
||||
var apiContext = paymentSettings.CreateAPIContext();
|
||||
var apiContext = PayPalHelpers.CreateAPIContext();
|
||||
Payment result= Request.CreatePayment("Command",apiContext,new Estimate());
|
||||
return Ok(Payment.Create(apiContext,result));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue