Class: Telerivet::MobileMoneyReceipt
- Inherits:
-
Entity
- Object
- Entity
- Telerivet::MobileMoneyReceipt
show all
- Defined in:
- lib/telerivet/mobilemoneyreceipt.rb
Overview
Represents a receipt received from a mobile money system such as Safaricom M-Pesa (Kenya), Vodacom M-Pesa (Tanzania), or Tigo Pesa (Tanzania).
When your Android phone receives a SMS receipt from a supported mobile money service that Telerivet can understand, Telerivet will automatically parse it and create a MobileMoneyReceipt object.
Fields:
- id (string, max 34 characters)
* Telerivet's internal ID for the receipt
* Read-only
- tx_id
* Transaction ID from the receipt
* Read-only
- tx_type
* Type of mobile money transaction
* Allowed values: receive_money, send_money, pay_bill, deposit, withdrawal,
airtime_purchase, balance_inquiry, reversal
* Read-only
- currency
* [ISO 4217 Currency code](http://en.wikipedia.org/wiki/ISO_4217) for the transaction,
e.g. KES or TZS. Amount, balance, and fee are expressed in units of this currency.
* Read-only
- amount (number)
* Amount of this transaction; positive numbers indicate money added to your account,
negative numbers indicate money removed from your account
* Read-only
- balance (number)
* The current balance of your mobile money account (null if not available)
* Read-only
- fee (number)
* The transaction fee charged by the mobile money system (null if not available)
* Read-only
- name
* The name of the other person in the transaction (null if not available)
* Read-only
- phone_number
* The phone number of the other person in the transaction (null if not available)
* Read-only
- time_created (UNIX timestamp)
* The time this receipt was created in Telerivet
* Read-only
- other_tx_id
* The other transaction ID listed in the receipt (e.g. the transaction ID for a
reversed transaction)
* Read-only
- content
* The raw content of the mobile money receipt
* Read-only
- provider_id
* Telerivet's internal ID for the mobile money provider
* Read-only
- vars (Hash)
* Custom variables stored for this mobile money receipt
* Updatable via API
- contact_id
* ID of the contact associated with the name/phone number on the receipt. Note that
some mobile money systems do not provide the other person's phone number, so it's
possible Telerivet may not automatically assign a contact_id, or may assign it to a
different contact with the same name.
* Updatable via API
- phone_id
* ID of the phone that received the receipt
* Read-only
- message_id
* ID of the message corresponding to the receipt
* Read-only
- project_id
* ID of the project this receipt belongs to
* Read-only
Instance Method Summary
collapse
Methods inherited from Entity
#get, #initialize, #load_data, #set, #set_data, #to_s, #vars
Instance Method Details
#amount ⇒ Object
125
126
127
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 125
def amount
get('amount')
end
|
#balance ⇒ Object
129
130
131
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 129
def balance
get('balance')
end
|
161
162
163
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 161
def contact_id
get('contact_id')
end
|
165
166
167
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 165
def contact_id=(value)
set('contact_id', value)
end
|
#content ⇒ Object
153
154
155
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 153
def content
get('content')
end
|
#currency ⇒ Object
121
122
123
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 121
def currency
get('currency')
end
|
#delete ⇒ Object
105
106
107
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 105
def delete()
@api.do_request("DELETE", get_base_api_path())
end
|
#fee ⇒ Object
133
134
135
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 133
def fee
get('fee')
end
|
#get_base_api_path ⇒ Object
181
182
183
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 181
def get_base_api_path()
"/projects/#{get('project_id')}/receipts/#{get('id')}"
end
|
#id ⇒ Object
109
110
111
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 109
def id
get('id')
end
|
#message_id ⇒ Object
173
174
175
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 173
def message_id
get('message_id')
end
|
#name ⇒ Object
137
138
139
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 137
def name
get('name')
end
|
#other_tx_id ⇒ Object
149
150
151
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 149
def other_tx_id
get('other_tx_id')
end
|
#phone_id ⇒ Object
169
170
171
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 169
def phone_id
get('phone_id')
end
|
#phone_number ⇒ Object
141
142
143
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 141
def phone_number
get('phone_number')
end
|
#project_id ⇒ Object
177
178
179
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 177
def project_id
get('project_id')
end
|
#provider_id ⇒ Object
157
158
159
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 157
def provider_id
get('provider_id')
end
|
#save ⇒ Object
Saves any fields or custom variables that have changed for this mobile money receipt.
98
99
100
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 98
def save()
super
end
|
#time_created ⇒ Object
145
146
147
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 145
def time_created
get('time_created')
end
|
#tx_id ⇒ Object
113
114
115
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 113
def tx_id
get('tx_id')
end
|
#tx_type ⇒ Object
117
118
119
|
# File 'lib/telerivet/mobilemoneyreceipt.rb', line 117
def tx_type
get('tx_type')
end
|