Ensure all methods on base gateway plugin:

  1. Are tested
  2. Have a core implementation

If they don't, then introduce an optional extra interface in SMS Framework core, or a separate module.

Configurable Plugin Interface

  • getConfiguration()
  • setConfiguration()
  • defaultConfiguration()

Plugin form interface

  • buildConfigurationForm()
  • validateConfigurationForm()
  • submitConfigurationForm()

Dependent Plugin Interface

  • calculateDependencies()

Sms Gateway Plugin Interface

  • send
  • balance
  • parseDeliveryReports
  • getDeliveryReports

Sms Gateway Plugin Incoming Interface

  • incoming

Comments

dpi created an issue. See original summary.

almaudoh’s picture

Pulling this to the top of the queue

dpi’s picture

Priority: Normal » Major
dpi’s picture

Seems like its safe to remove:

  • validateNumbers
  • balance
  • getDeliveryReports
  • getError
almaudoh’s picture

We can remove validateNumbers, but the others are useful in some applications for me. getDeliveryReports is needed for some gateways where you need to pull delivery reports by http request from the server, balance provides a means to know the credit balance on that server while getError was a way of managing errors from the gateway.
Exceptions can be used to replace the getError functionality.

We should retain balance and getDeliveryReports.

dpi’s picture

I understand the two methods can/could be useful but there is no first party usages or tests for them. I propose they can be added back later, considering the following:

\Drupal\sms\Plugin\SmsGatewayPluginInterface::getDeliveryReports()

The message ID's argument is not a standardised concept within the framework yet. This should be rethought... Yes they are used in delivery reports themselves but not yet elsewhere.

Perhaps add a pullDeliveryReports or similar to check for new reports.

Add some annotation to gateway plugin to say how it handles delivery reports: push, pull, both, none? This way we can provide a future UI to force pull reports. Or even set up a cronjob to automate this.

\Drupal\sms\Plugin\SmsGatewayPluginInterface::balance()

Balance is difficult because it is a currency: could be an officially traded currency or credit or token system.

To make this method usable within the framework there needs to be some standards.

Need to figure out what the purpose of the balance system; and why it benefits the Drupal install to know about the balance. Whether the balance is purely informational; or we can take action on available balance.

Balance cannot just be an int (current behaviour) or float...

I have the same reservations about balance in \Drupal\sms\Message\SmsMessageResultInterface but that is for another time.

The balance default of zero does not make sense, should be NULL...

edit: 8 Sept: balance base default

dpi’s picture

dpi’s picture

Issue summary: View changes

rm validateNumbers, getError from OP.

dpi’s picture

dpi’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.