How it works
Your user sends a specially formatted SMS message to your Twilio phone number.
Twilio receives the message and forwards it to the Notifications URL you have provided.
The message is captured by the add-on and processed. If set, a reply is sent back to the user.
- A user types a SMS message where he enters (in order): The action he wants to take, the amount of points he wants to send, the user he wants to send it to and if allowed, an optional description for the transfer referred to as “a message”.
- The user sends this SMS to your Twilio number that you have given him.
- Twilio receives the message and forwards it to the URL set in your phone numbers Messaging settings.
- The SMS Payments add-on intercepts this call and processes the message body.
- First, the add-on tries to identify the sender by checking the senders phone number against your database.
- If the user is found, the add-on then checks that the amount requested to be sent can be covered by the sender and if set, does not exceed his transfer limit.
- If the amount is good, the add-on then tries to identify the recipient. You can identify recipients by either their user ID, login (username) or email.
- If the recipient is found, the transfer is initiated by first charging the sender then depositing the amount into the recipients account.
- If you allow cancellations, the add-on will save the transaction for x number of seconds via WordPress Transients and presents Twilio (who at this stage is still waiting for a reply) with a SMS message.
- This SMS message is given to Twilio as a “reply” to the call causing Twilio to send it back to the user.
The transfer sender then receives the SMS message and if you allow cancellations has then x number of seconds to send the cancellations message. Once the cancellation time has passed, the transient is deleted and cancellations is no longer possible.
SMS Message Structure
Making a transfer:
ACTION AMOUNT RECIPIENT MESSAGE
Cancelling a transfer: