Module: Arafa::Ussd::Response

Defined in:
lib/arafa/ussd/response.rb

Overview

Builds the CON /END -prefixed plain-text reply body both providers' USSD callback contract expects within the 10-second response window (§1.2, §1.5). Not a network client — the adapter's own web framework is responsible for actually returning this body with Content-Type: text/plain.

Class Method Summary collapse

Class Method Details

.continue(text) ⇒ Object

Session continues; the gateway will prompt the subscriber again and POST their next input as a new callback.



15
16
17
# File 'lib/arafa/ussd/response.rb', line 15

def continue(text)
  "CON #{text}"
end

.end(text) ⇒ Object

Session terminates; this is the final screen shown to the subscriber.



20
21
22
# File 'lib/arafa/ussd/response.rb', line 20

def end(text)
  "END #{text}"
end