Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Money donation / payment #439

Closed
tiagonmas opened this issue Oct 4, 2021 · 9 comments · Fixed by #641
Closed

Money donation / payment #439

tiagonmas opened this issue Oct 4, 2021 · 9 comments · Fixed by #641
Assignees
Labels
doar+ prio:High Issue of higher priority. Should be addressed first

Comments

@tiagonmas
Copy link
Collaborator

tiagonmas commented Oct 4, 2021

Create a new entry page (specific page not available via a link in the home page) that allows the user to give a money contribution (and not a specific food cart). The goal is to replace the current donation process used in https://www.bancoalimentar.pt/faca-um-donativo/ (that uses ifthenpayforms as the payment gateway, or direct MBway payments that are hard to track and currently have no automated way to produce a invoice). This way we would use the same mechanism of alimentestaideia to process the money donation and send a receipt. The user would still pick the donation amount and the food bank he is donating to. It needs to be clear that this is a money donation and not a food donation.

A second request, but very similar, is to allow to make a donation / payment of meals that a given user has eaten in the food bank (The food bank warehouse has a kitchen that serves meals to employees and volunteers, but meals need to be paid). An automated process (that is not part of this site) will send a link to the user with the amount that he needs to pay (and to what food bank). The user will follow the link and only add his personal details and payment method (the amount and food bank will already be hard coded in the link or in the database).

@tiagonmas tiagonmas added the prio:High Issue of higher priority. Should be addressed first label Oct 4, 2021
@guerrerotook
Copy link
Contributor

Working on this

@guerrerotook
Copy link
Contributor

@tiagonmas, this is how the current implementation looks like,

image

@tiagonmas
Copy link
Collaborator Author

tiagonmas commented Oct 15, 2021

Hi @guerrerotook ,
New specs for this feature:

  • Add a new area so we can have a separate layout.
  • Receipt for this type of donation - the NIF needs to be specific of the Food Bank that is issuing the invoice. The template needs to be different as the name of bank and who signs needs to change.
  • When we are paying lunches, a different system will generate a link and send an email to the user indicating the food bank, the total, and what is being paid. The invoice needs to reflect what is being paid.
  • [confirmed] When the receipt is for a specific purpose (as opposed to a generic donation) we need to identify what is being paid, eg: "August 2021". For legal reasons the invoice cannot specify that it is lunches as it's given as a donation since the food bank cannot sell goods or services.

@tiagonmas
Copy link
Collaborator Author

Error when making a cash donation.

Azure.RequestFailedException: The specifed resource name contains invalid characters.
RequestId:e9ef9ff8-4002-010c-5cdd-de8ff2000000
Time:2021-11-21T13:44:14.4823880Z
Status: 400 (Bad Request)
ErrorCode: InvalidResourceName

Content:
{"odata.error":{"code":"InvalidResourceName","message":{"lang":"en-US","value":"The specifed resource name contains invalid characters.\nRequestId:e9ef9ff8-4002-010c-5cdd-de8ff2000000\nTime:2021-11-21T13:44:14.4823880Z"}}}

Headers:
Transfer-Encoding: chunked
Server: Windows-Azure-Table/1.0,Microsoft-HTTPAPI/2.0
x-ms-request-id: e9ef9ff8-4002-010c-5cdd-de8ff2000000
x-ms-client-request-id: 23ab26f7-b2e4-4d0e-94e2-441ac33830f7
x-ms-version: REDACTED
X-Content-Type-Options: REDACTED
Date: Sun, 21 Nov 2021 13:44:14 GMT
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8

   at Azure.Data.Tables.TableRestClient.MergeEntity(String table, String partitionKey, String rowKey, Nullable`1 timeout, String ifMatch, IDictionary`2 tableEntityProperties, QueryOptions queryOptions, CancellationToken cancellationToken)
   at Azure.Data.Tables.TableClient.UpsertEntity[T](T entity, TableUpdateMode mode, CancellationToken cancellationToken)
   at BancoAlimentar.AlimentaEstaIdeia.Repository.AzureTables.SinglePaymentAuditingTable.SaveEntity() in C:\Users\tiagoand\source\repos\alimentestaideia.pt\BancoAlimentar.AlimentaEstaIdeia.Repository\AzureTables\SinglePaymentAuditingTable.cs:line 68
   at BancoAlimentar.AlimentaEstaIdeia.Web.Pages.PaymentModel.CreateEasyPayPaymentAsync(String transactionKey, MethodEnum method) in C:\Users\tiagoand\source\repos\alimentestaideia.pt\BancoAlimentar.AlimentaEstaIdeia.Web\Pages\Payment.cshtml.cs:line 457
   at BancoAlimentar.AlimentaEstaIdeia.Web.Pages.PaymentModel.OnPostMbWayAsync() in C:\Users\tiagoand\source\repos\alimentestaideia.pt\BancoAlimentar.AlimentaEstaIdeia.Web\Pages\Payment.cshtml.cs:line 193
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

@tiagonmas
Copy link
Collaborator Author

the exception above is being generated in

image

because of the this.configuration["AzureStorage:SinglePaymentAuditingTableName"] is ""#{AzureStorage--SinglePaymentAuditingTableName}#""
image

@tiagonmas
Copy link
Collaborator Author

the above issue only happens locally. I guess when running in Azure this is getting the configs from the right place, while in dev it is not. How can I run this locally @guerrerotook ? thanks

@guerrerotook
Copy link
Contributor

The configuration that you have in the second screenshot, is to be replaced in the pipeline, so you don't use that locally.

If you came across this value in runtime means that you don't have that setup in your secrets.json file. Look if you have the AzureStorage.SinglePaymentAuditingTableName properti set.

@guerrerotook
Copy link
Contributor

Add a new column IsCashDonation to signal that is a cashdonation.

guerrerotook added a commit that referenced this issue Nov 22, 2021
@guerrerotook
Copy link
Contributor

Added the column in the last commit and migrated the database both Staging and Prod.

@guerrerotook guerrerotook linked a pull request Mar 9, 2022 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doar+ prio:High Issue of higher priority. Should be addressed first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants