Module: LocalBitcoins::Contacts
- Included in:
- Client
- Defined in:
- lib/localbitcoins/client/contacts.rb
Instance Method Summary collapse
-
#active_contacts(contact_type = nil) ⇒ Object
Dashboard contact endpoints contact_type - optional filter ‘buyer’ or ‘seller’ [string].
- #cancel_contact(contact_id) ⇒ Object
- #canceled_contacts(contact_type = nil) ⇒ Object
- #closed_contacts(contact_type = nil) ⇒ Object
- #contact_info(contact_id) ⇒ Object
-
#contacts_info(contacts) ⇒ Object
contacts - comma separated list of contact ids [string].
- #create_contact(ad_id, amount, message = nil) ⇒ Object
- #dispute_contact(contact_id) ⇒ Object
- #fund_contact(contact_id) ⇒ Object
-
#mark_contact_as_paid(contact_id) ⇒ Object
Contact interaction endpoints contact_id - id number associated with the contact.
- #message_contact(contact_id, msg) ⇒ Object
- #messages_from_contact(contact_id) ⇒ Object
- #released_contacts(contact_type = nil) ⇒ Object
Instance Method Details
#active_contacts(contact_type = nil) ⇒ Object
Dashboard contact endpoints contact_type - optional filter ‘buyer’ or ‘seller’ [string]
46 47 48 49 |
# File 'lib/localbitcoins/client/contacts.rb', line 46 def active_contacts(contact_type = nil) contact_type<<'/' unless contact_type.nil? oauth_request(:get, "/api/dashboard/#{contact_type}").data end |
#cancel_contact(contact_id) ⇒ Object
22 23 24 |
# File 'lib/localbitcoins/client/contacts.rb', line 22 def cancel_contact(contact_id) oauth_request(:post, "/api/contact_cancel/#{contact_id}/").data end |
#canceled_contacts(contact_type = nil) ⇒ Object
56 57 58 59 |
# File 'lib/localbitcoins/client/contacts.rb', line 56 def canceled_contacts(contact_type = nil) contact_type<<'/' unless contact_type.nil? oauth_request(:get, "/api/dashboard/canceled/#{contact_type}").data end |
#closed_contacts(contact_type = nil) ⇒ Object
61 62 63 64 |
# File 'lib/localbitcoins/client/contacts.rb', line 61 def closed_contacts(contact_type = nil) contact_type<<'/' unless contact_type.nil? oauth_request(:get, "/api/dashboard/closed/#{contact_type}").data end |
#contact_info(contact_id) ⇒ Object
34 35 36 |
# File 'lib/localbitcoins/client/contacts.rb', line 34 def contact_info(contact_id) oauth_request(:get, "/api/contact_info/#{contact_id}/") end |
#contacts_info(contacts) ⇒ Object
contacts - comma separated list of contact ids [string]
39 40 41 |
# File 'lib/localbitcoins/client/contacts.rb', line 39 def contacts_info(contacts) oauth_request(:get, '/api/contact_info/', {:contacts=>contacts}).data end |
#create_contact(ad_id, amount, message = nil) ⇒ Object
30 31 32 |
# File 'lib/localbitcoins/client/contacts.rb', line 30 def create_contact(ad_id, amount, =nil) oauth_request(:post, "/api/contact_create/#{ad_id}/", {:amount=>amount, :message=>}) end |
#dispute_contact(contact_id) ⇒ Object
18 19 20 |
# File 'lib/localbitcoins/client/contacts.rb', line 18 def dispute_contact(contact_id) oauth_request(:post, "/api/contact_dispute/#{contact_id}/") end |
#fund_contact(contact_id) ⇒ Object
26 27 28 |
# File 'lib/localbitcoins/client/contacts.rb', line 26 def fund_contact(contact_id) oauth_request(:post, "/api/contact_fund/#{contact_id}/") end |
#mark_contact_as_paid(contact_id) ⇒ Object
Contact interaction endpoints contact_id - id number associated with the contact
6 7 8 |
# File 'lib/localbitcoins/client/contacts.rb', line 6 def mark_contact_as_paid(contact_id) oauth_request(:post, "/api/contact_mark_as_paid/#{contact_id}/") end |
#message_contact(contact_id, msg) ⇒ Object
14 15 16 |
# File 'lib/localbitcoins/client/contacts.rb', line 14 def (contact_id, msg) oauth_request(:post, "/api/contact_message_post/#{contact_id}/", {:msg=>msg}).data end |
#messages_from_contact(contact_id) ⇒ Object
10 11 12 |
# File 'lib/localbitcoins/client/contacts.rb', line 10 def (contact_id) oauth_request(:get, "/api/contact_messages/#{contact_id}/").data end |
#released_contacts(contact_type = nil) ⇒ Object
51 52 53 54 |
# File 'lib/localbitcoins/client/contacts.rb', line 51 def released_contacts(contact_type = nil) contact_type<<'/' unless contact_type.nil? oauth_request(:get, "/api/dashboard/released/#{contact_type}").data end |