We are developing a payment gateway in Bolivia that uses cash payments in stores (https://www.drupal.org/project/commerce_pagos_net). The plugin is implementing both the OnsitePaymentInterface (because during checkout we call a web service to send the code that the user will have to present at the physical store to pay) and also implements the OffistePaymentInterface, because the payments provider sends a JSON back to our site once the user pays in any store. It works right now because in the PaymentProcess class, the `if` checks before if we are implementing the OnsitePaymentInterface, but if the if order changed then it would no longer work. I think it would be better to separate the onNotify method of the OffsitePaymentInterface to another interface so that any payment gateway can implement the onNotify method and use the OffsitePaymentController.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | offsite-payment-notification-interface-2906360-2.patch | 4.59 KB | jackbravo |
Comments
Comment #2
jackbravo commentedHere is the patch.
This is from this PR on github: https://github.com/drupalcommerce/commerce/pull/782
Comment #3
bojanz commentedBetter title. Suggested naming it SupportsNotificationsInterface in the PR.
Comment #4
jackbravo commentedSounds good. I've just updated the PR.
Is it too much noise updating both the PR and the issue in d.o? Do you prefer one over the other?
Comment #5
bojanz commentedI get notified for both, so it's your choice. I don't mind seeing both.
Comment #7
bojanz commentedAdded more docs, split the controller into two (since notifications are not off-site specific anymore), and committed.
Thanks! This will allow onsite gateways to implement webhooks, which is important.