Skip to content

Commit

Permalink
Add required ConsumerBic field to Create mandate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Jun 30, 2024
1 parent 1810adf commit c45d77b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ public class CreateMandateModel {

[Required]
public required string ConsumerAccount { get; set; }

[Required]
public required string ConsumerBic { get; set; }
}
15 changes: 13 additions & 2 deletions samples/Mollie.WebApplication.Blazor/Pages/Mandate/Create.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
</InputText>
</div>

<div class="form-group">
<label for="consumer-bic">Consumer BIC</label>
<InputText
id="consumer-bic"
class="form-control"
@bind-Value="_mandate.ConsumerBic">
</InputText>
</div>

<input type="submit" name="Save" value="Save" class="btn btn-primary mt-2"/>
</EditForm>

Expand All @@ -54,7 +63,8 @@

private CreateMandateModel _mandate = new() {
ConsumerName = "Consumer name",
ConsumerAccount = ""
ConsumerAccount = string.Empty,
ConsumerBic = string.Empty
};

private async Task OnSave() {
Expand All @@ -64,7 +74,8 @@
await MandateClient.CreateMandateAsync(CustomerId, new SepaDirectDebitMandateRequest {
Method = PaymentMethod.DirectDebit,
ConsumerName = _mandate.ConsumerName,
ConsumerAccount = _mandate.ConsumerAccount
ConsumerAccount = _mandate.ConsumerAccount,
ConsumerBic = _mandate.ConsumerBic
});

NavigationManager.NavigateTo($"/customer/{CustomerId}/mandate/overview");
Expand Down

0 comments on commit c45d77b

Please sign in to comment.