Class: PrestoAPI::Client
- Inherits:
-
Object
- Object
- PrestoAPI::Client
- Defined in:
- lib/presto_api.rb
Instance Method Summary collapse
- #card_status_with_number(card_number) ⇒ Object
- #card_status_with_username_password(username, password) ⇒ Object
- #load_registered_card(username, password, email, amount, credit_card) ⇒ Object
- #load_unregistered_card(card_number, email, amount, credit_card) ⇒ Object
- #transaction_history_with_username_password(username, password) ⇒ Object
- #user_with_username_password(username, password) ⇒ Object
Instance Method Details
#card_status_with_number(card_number) ⇒ Object
83 84 85 |
# File 'lib/presto_api.rb', line 83 def card_status_with_number(card_number) card_status_from_page(login_with_card_number(card_number)) end |
#card_status_with_username_password(username, password) ⇒ Object
79 80 81 |
# File 'lib/presto_api.rb', line 79 def card_status_with_username_password(username, password) card_status_from_page(login_with_username_password(username, password)) end |
#load_registered_card(username, password, email, amount, credit_card) ⇒ Object
87 88 89 90 |
# File 'lib/presto_api.rb', line 87 def load_registered_card(username, password, email, amount, credit_card) login_with_username_password(username, password) load_card(amount, email, credit_card) end |
#load_unregistered_card(card_number, email, amount, credit_card) ⇒ Object
92 93 94 95 |
# File 'lib/presto_api.rb', line 92 def load_unregistered_card(card_number, email, amount, credit_card) login_with_card_number(card_number) load_card(amount, email, credit_card) end |
#transaction_history_with_username_password(username, password) ⇒ Object
74 75 76 77 |
# File 'lib/presto_api.rb', line 74 def transaction_history_with_username_password(username, password) login_with_username_password(username, password) transaction_history_from_page(agent.get('https://www.prestocard.ca/en-US/Pages/TransactionalPages/TransactionHistory.aspx')) end |
#user_with_username_password(username, password) ⇒ Object
67 68 69 70 71 72 |
# File 'lib/presto_api.rb', line 67 def user_with_username_password(username, password) card_number = card_number_from_page(login_with_username_password(username, password)) user = user_from_page(agent.get('https://www.prestocard.ca/en-US/Pages/TransactionalPages/ViewUpdateRegistration.aspx')) user.card_number = card_number user end |