Use the store's default currency when creating entities (#3585)

* Use default currency for new pull payments

Closes #3582.

* Pull payment: Improve create form

* Use default currency for new invoices

Closes  #3581.

* Clean up old invoice form code

* Use default currency for new payment requests

* Test fixes
This commit is contained in:
d11n
2022-04-11 10:50:30 +02:00
committed by GitHub
parent bfdb1b4af9
commit cd9a52706c
8 changed files with 31 additions and 40 deletions

View File

@@ -89,10 +89,14 @@ namespace BTCPayServer.Controllers
return NotFound();
}
return View(nameof(EditPaymentRequest), new UpdatePaymentRequestViewModel(paymentRequest)
var vm = new UpdatePaymentRequestViewModel(paymentRequest)
{
StoreId = store.Id
});
};
vm.Currency ??= store.GetStoreBlob().DefaultCurrency;
return View(nameof(EditPaymentRequest), vm);
}
[HttpPost("/stores/{storeId}/payment-requests/edit/{payReqId?}")]