Developer forum

Forum » Development » Send additional parameter to quickpay

Send additional parameter to quickpay

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I need to send the deadline parameter to Quick Pay (QuickPay Form - https://learn.quickpay.net/tech-talk/payments/form/) in order to control the time the user has to complete the order (so it matches the reservation time in the cart). I tried a  few options but they are all sub optimal:

1. Build a custom Post template and add the custom field. Easy to implement at the template level. However, QuickPay wants a checksum of all fields so the existing one is now invalid. This means I need to keep track of all post values myself in the template, duplicate ComputeHash and some other helpers and compute the hash myself. This could work and is not too bad if ComputeHash didn't need the ApiKey into QuickPay. That's not available as a tag and thus I need to duplicate it in my template.

2. Build a custom version of QuickPayPaymentWindow that has the field. Bad for future upgrades but is a clean way to get it done for now.

3. File a feature request or a PR and wait for a new version.

What would you recommend? I need to get this done sooner rather than later so option #3 is not great either.

Thanks!

Imar

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

@3 :-)

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Happy to create a PR. Instead of adding the timeout as a setting directly, would it make sense to have a subscriber that can collect additional fields to be sent? I.e. something like this:

var extraValueArgs = new Notifications.OnCollectingFormValuesArgs(formValue);
NotificationManager.Notify("OnCollectingFormValues", extraValueArgs);
formValues.AddRange(extraValueArgs.NewValues);
formValues.Add("checksum", ComputeHash(ApiKey, GetMacString(formValues)));

 

Then in a subscriber I can do something like:

var localArgs = (OnCollectingFormValuesArgs)args;
localArgs.NewValues.Add("deadline", 5 * 60);

This may be overkill for the deadline parameter which has broader reach I assume, but it opens a way to add others from the supported parameters list.

Happy to go either way; adding a timeout property directly on the provider is fine with me as well.

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Bump. Do you have a preference on how to move forward with this?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Sorry, had missed this post!

Just a new property. I do not want notifications here - will result in select * from largetable, try gets and other stuff that will take the remainder of life for us to debug :).

Thanks!

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Understood. I have submitted a PR to go into main. Hope I did it correctly but let me know if I need to change anything.

 

You must be logged in to post in the forum