Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally these changes are related with these bugs:
DW10: QuickPay - error exception on ordering - https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/19122
DW10: QuickPay - post template not rendered - https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/19123
DW10: Capture amount not shown in order overview-capture operations widget -
https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/19660
1). DW10: QuickPay - error exception on ordering.
We have a method
CheckData
, where we check the quickpay response for a needed data. For payment operation, we check thatorder_id
field is present in response, since this field is mandatory for payment command.See: https://learn.quickpay.net/tech-talk/api/services/#POST-payments---format-
But we also can save card and then pay by saved card. And for card related operations, we don't have the field
order_id
.See: https://learn.quickpay.net/tech-talk/api/services/#POST-cards--id-authorize---format-
And since we always checked the
order_id
field, the provider threw an exception, while QuickPay markedoperation successful. To fix this,
order_id
has been removed from the required checks.2). DW10: QuickPay - post template not rendered.
This part is more tricky.
The bug said that that Post template is not rendered. I can guess, that original provider was tested on sites, where we don't use "Save new card" functionality, or where this functionality is not mandatory. In Swift we always save card (if user is logged in). There is no way to reject this unless the user logs out (anonymous user can't save card).
In the old QuickPay provider code there is next part:
For usual payment operation, we have a Quickpay Form. See: https://learn.quickpay.net/tech-talk/payments/form/
And for usual payment operation, we use template to set form settings and then redirect user to QuickPay site. The form like this:
See: https://learn.quickpay.net/tech-talk/payments/form/
For saving card case, we have one recommended way to do this: create a card link, and then redirect user to this link to authorize the card. See: https://learn.quickpay.net/tech-talk/guides/cards/
So there is no some predefined way to use template, like for the Quickpay Form case. It looks like the reason why we just skip the templates and always do auto post to Quickpay instead.
But this is not good idea. We have to show some template, because we have this setting in the provider. There is no restrictions to do that. We just need implement our own template with Ajax interactions, so user could set needed settings, and then we create a card, return the link to authorize card and redirect user there. The same things like we already do, but with template.
This is what I did in that part of PR. I created a new template, Card.cshtml.
It looks like this:
So here we can set Branding, Language, payment methods - all things that we do to adjust Quickpay Form, like for usual payment operation template. And it works! After the button "Start payment" is clicked, user is redirected to Quickpay site with the selected QuickPay parameters.
Of course we need some guy to make this template more beautiful.
3). DW10: Capture amount not shown in order overview-capture operations widget.
Added captured amount to logs for "final capture result". We have this information for split capture, for final capture we also need it to make information more understandable.
4). Common changes: