
Problem/Motivation
This will become the start of the 2.0.x branch, implement the new API and refactor it along the way to make it more reusable.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork commerce_datatrans-3192924
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3192924-implement-new-json
changes, plain diff MR !1
1 hidden branch
Error loading live previews.
Comments
Comment #3
berdirThis is ready for testing.
Notes:
* Initializing the payment is now an API request and an API method on the gateway plugin, it has both an alter hook and an extra argument to pass customized data to Datatrans.
* Removed URL setting, that is now automatically based on the mode setting, renamed some settings for clarify, password is now required and of the other security settings, only sign2/hmac_key_2 is left and required when using the webhook.
* There is no upgrade path for the changed/updated settings yet, will need to be reconfigured manually. Most sites won't have a password yet and might not have the mode set correctly, so not sure if it's worth to spend time on that.
* The webhook is now supported and validating the signature is mandatory.
* Using the webhook is not required yet, the on return callback falls back to using the provided transaction ID argument if no payment exists for that transaction ID. Unsure about settings to enforce using it, the argument seems secure enough.
* No protection against race conditions yet. In my testing, I was able to hold a webhook for a minute or so with the debugger and my browser was waiting patiently for it to complete, so as far as I see, it really is enforced to process the webhook first.
* Webhooks are only supported through the custom controller as it is not possible to use the dynamic route provided by Commerce.
* Existing tests were updated but no new tests for initializing payments or the webhook yet.
Comment #5
berdirI somehow can't select it as a version yet, but this has been committed to the 2.0.x branch/development release: https://www.drupal.org/project/commerce_datatrans/releases/2.0.x-dev
Comment #7
berdirNow it's there.
Comment #9
mrupsidownA huge thanks to you @Berdir for the work you have done on implementing their API. I got stuck months ago with the cookie issue on the 8.x-1 branch and updated yesterday to the 2.0.0-beta1 version. So far, everything seems to be working fine on my side, so thanks again!