Closed (fixed)
Project:
Commerce Open Payment Platform
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2018 at 15:04 UTC
Updated:
29 Jan 2020 at 21:29 UTC
Jump to comment: Most recent
Comments
Comment #2
jrochate commentedThis is fundamental aspect of commerce_opp, specially on transaction types that must wait for user to take action, like:
- SIBS_MULTIBANCO
- MB WAY
- maybe others
Instead of polling the server for the transaction state, with a web hook the module would be contacted in case of a transaction state change.
For a large number of transactions, the web hook are the only solution to avoid Drupal server overflow with requests.
There are some examples about implementing a Webhook on Drupal 8, where we could start paving the way:
Webhook project that is lagging on time for another alpha or RC to merge all pending patches
article about Webhooks explaining the process and with code examples
The API of OPP needs some decrypting of the payload that will need Libsodium if PHP is <7.1:
https://sibs.docs.onlinepayments.pt/tutorials/webhooks/decryption-example
If you think on the structure and best methodology, maybe we can work in this.
Comment #3
agoradesign commentedthanks for the input..
Processing the webhook requests shouldn't be too different to processing the payment notifications, we already do.
We will define an explicit route, that we can fully control by an own controller, so modules like the mentioned webhook module would only complicate things :)
regarding decrpytion: we will just raise requirements to PHP 7.1, as PHP 7.0 is officially not maintained any more - I know, Drupal Core officially still support it, while not recommending it.
Comment #5
agoradesign commentedPushed an untested implementation - no real test requests done so far. Additonally, the README must be extended with a webhooks section, describing how to configure them
And we'll have to create a follow up issue on providing config settings on a per-gateway base, for allowing to en-/disable processing the pending payments on cron, as well as deleting expired authorizations on cron.
Comment #6
agoradesign commentedadded child issues for README updates and configuration changes
Comment #13
agoradesign commentedTest payments with different brands (VISA, SOFORT, Paypal) were successful.. however, we found out that all of our 3 currently global settings should be shifted to gateway configuration level instead, see #3104794: Allow to control cron operations per configuration for more information... We'll keep this one open, until the other issue is resolved
Comment #14
agoradesign commentedRelated issues are marked as fixed, so we can fix this too