class Telerivet::AirtimeTransaction

Represents a transaction where airtime is sent to a mobile phone number.

To send airtime, first [create a Custom Actions service to send a particular amount of airtime](/dashboard/add_service?subtype_id=main.service.rules.contact&action_id=main.rule.sendairtime), then trigger the service using [service.invoke](#Service.invoke), [project.sendBroadcast](#Project.sendBroadcast), or [project.scheduleMessage](#Project.scheduleMessage).

Fields:

- id
    * ID of the airtime transaction
    * Read-only

- to_number
    * Destination phone number in international format (no leading +)
    * Read-only

- operator_name
    * Operator name
    * Read-only

- country
    * Country code
    * Read-only

- status
    * Current status of airtime transaction (`successful`, `failed`, `cancelled`,
        `queued`, `pending_approval`, or `pending_payment`)
    * Read-only

- status_text
    * Error or success message returned by airtime provider, if available
    * Read-only

- value
    * Value of airtime sent to destination phone number, in units of value_currency
    * Read-only

- value_currency
    * Currency code of price
    * Read-only

- price
    * Price charged for airtime transaction, in units of price_currency
    * Read-only

- price_currency
    * Currency code of price
    * Read-only

- contact_id
    * ID of the contact the airtime was sent to
    * Read-only

- service_id
    * ID of the service that sent the airtime
    * Read-only

- project_id
    * ID of the project that the airtime transaction belongs to
    * Read-only

- external_id
    * The ID of this transaction from an external airtime gateway provider, if available.
    * Read-only

- vars (Hash)
    * Custom variables stored for this transaction
    * Updatable via API

Public Instance Methods

contact_id() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 117
def contact_id
    get('contact_id')
end
country() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 89
def country
    get('country')
end
external_id() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 129
def external_id
    get('external_id')
end
get_base_api_path() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 133
def get_base_api_path()
    "/projects/#{get('project_id')}/airtime_transactions/#{get('id')}"
end
id() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 77
def id
    get('id')
end
operator_name() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 85
def operator_name
    get('operator_name')
end
price() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 109
def price
    get('price')
end
price_currency() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 113
def price_currency
    get('price_currency')
end
project_id() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 125
def project_id
    get('project_id')
end
service_id() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 121
def service_id
    get('service_id')
end
status() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 93
def status
    get('status')
end
status_text() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 97
def status_text
    get('status_text')
end
to_number() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 81
def to_number
    get('to_number')
end
value() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 101
def value
    get('value')
end
value_currency() click to toggle source
# File lib/telerivet/airtimetransaction.rb, line 105
def value_currency
    get('value_currency')
end