espago 0.0.9 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Gemfile.lock +14 -1
- data/Guardfile +1 -0
- data/README.md +118 -6
- data/espago.gemspec +6 -1
- data/lib/espago.rb +4 -3
- data/lib/espago/api_connection.rb +16 -7
- data/lib/espago/api_connection/{post_clients.rb → api.rb} +1 -5
- data/lib/espago/api_connection/api_delete.rb +9 -0
- data/lib/espago/api_connection/api_get.rb +13 -0
- data/lib/espago/api_connection/api_post.rb +9 -0
- data/lib/espago/api_connection/api_put.rb +9 -0
- data/lib/espago/api_connection/charges_complete_post.rb +9 -0
- data/lib/espago/api_connection/charges_delete.rb +9 -0
- data/lib/espago/api_connection/charges_get.rb +9 -0
- data/lib/espago/api_connection/charges_post.rb +9 -0
- data/lib/espago/api_connection/{post_charges_refund.rb → charges_refund_post.rb} +1 -5
- data/lib/espago/api_connection/clients_authorize_post.rb +9 -0
- data/lib/espago/api_connection/clients_delete.rb +9 -0
- data/lib/espago/api_connection/clients_get.rb +9 -0
- data/lib/espago/api_connection/clients_invoices_get.rb +9 -0
- data/lib/espago/api_connection/clients_post.rb +9 -0
- data/lib/espago/api_connection/clients_put.rb +9 -0
- data/lib/espago/api_connection/clients_subscriptions_get.rb +9 -0
- data/lib/espago/api_connection/complete_post.rb +14 -0
- data/lib/espago/api_connection/invoice_items_delete.rb +9 -0
- data/lib/espago/api_connection/invoice_items_get.rb +9 -0
- data/lib/espago/api_connection/invoice_items_post.rb +9 -0
- data/lib/espago/api_connection/invoices_get.rb +9 -0
- data/lib/espago/api_connection/line_items_get.rb +9 -0
- data/lib/espago/api_connection/plans_delete.rb +9 -0
- data/lib/espago/api_connection/plans_get.rb +9 -0
- data/lib/espago/api_connection/plans_post.rb +9 -0
- data/lib/espago/api_connection/plans_put.rb +9 -0
- data/lib/espago/api_connection/subscriptions_delete.rb +9 -0
- data/lib/espago/api_connection/subscriptions_get.rb +9 -0
- data/lib/espago/api_connection/subscriptions_post.rb +9 -0
- data/lib/espago/api_connection/tokens_get.rb +9 -0
- data/lib/espago/api_connection/{post_tokens.rb → tokens_post.rb} +2 -2
- data/lib/espago/back_request.rb +33 -0
- data/lib/espago/client.rb +12 -3
- data/lib/espago/router.rb +1 -1
- data/lib/espago/version.rb +1 -1
- data/spec/espago/api_connection_spec.rb +4 -3
- data/spec/espago/back_request_spec.rb +33 -0
- data/spec/espago/client_spec.rb +3 -2
- data/spec/espago/router_spec.rb +2 -2
- data/spec/features/apis_spec.rb +21 -0
- data/spec/features/charges_spec.rb +79 -0
- data/spec/features/clients_spec.rb +100 -0
- data/spec/features/error_spec.rb +28 -0
- data/spec/features/invoice_items_spec.rb +37 -0
- data/spec/features/invoices_spec.rb +24 -0
- data/spec/features/line_items_spec.rb +17 -0
- data/spec/features/plans_spec.rb +61 -0
- data/spec/features/subscriptions_spec.rb +43 -0
- data/spec/features/tokens_spec.rb +40 -0
- data/spec/fixtures/cassettes/api_2.yml +68 -0
- data/spec/fixtures/cassettes/api_3.yml +68 -0
- data/spec/fixtures/cassettes/charges_complete.yml +48 -0
- data/spec/fixtures/cassettes/charges_complete_deprecation.yml +48 -0
- data/spec/fixtures/cassettes/charges_destroy.yml +46 -0
- data/spec/fixtures/cassettes/charges_get.yml +67 -0
- data/spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml +46 -0
- data/spec/fixtures/cassettes/charges_post.yml +48 -0
- data/spec/fixtures/cassettes/charges_refund.yml +48 -0
- data/spec/fixtures/cassettes/clients_authorize.yml +48 -0
- data/spec/fixtures/cassettes/clients_delete.yml +42 -0
- data/spec/fixtures/cassettes/clients_get.yml +46 -0
- data/spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml +46 -0
- data/spec/fixtures/cassettes/clients_invoices.yml +46 -0
- data/spec/fixtures/cassettes/clients_post.yml +48 -0
- data/spec/fixtures/cassettes/clients_put.yml +48 -0
- data/spec/fixtures/cassettes/clients_subscriptions.yml +46 -0
- data/spec/fixtures/cassettes/error_400.yml +46 -0
- data/spec/fixtures/cassettes/error_401.yml +46 -0
- data/spec/fixtures/cassettes/error_500.yml +46 -0
- data/spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml +42 -0
- data/spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml +47 -0
- data/spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml +49 -0
- data/spec/fixtures/cassettes/invoices_get.yml +46 -0
- data/spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml +46 -0
- data/spec/fixtures/cassettes/line_items_get.yml +47 -0
- data/spec/fixtures/cassettes/plans_delete.yml +42 -0
- data/spec/fixtures/cassettes/plans_get.yml +46 -0
- data/spec/fixtures/cassettes/plans_get_pl_12345.yml +46 -0
- data/spec/fixtures/cassettes/plans_post.yml +48 -0
- data/spec/fixtures/cassettes/plans_put.yml +44 -0
- data/spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml +42 -0
- data/spec/fixtures/cassettes/subscriptions_get.yml +46 -0
- data/spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml +46 -0
- data/spec/fixtures/cassettes/subscriptions_post.yml +48 -0
- data/spec/fixtures/cassettes/tokens_get.yml +46 -0
- data/spec/fixtures/cassettes/tokens_post.yml +54 -0
- data/spec/spec_helper.rb +30 -0
- metadata +197 -37
- data/lib/espago/api_connection/delete_charges.rb +0 -13
- data/lib/espago/api_connection/delete_clients.rb +0 -13
- data/lib/espago/api_connection/get_charges.rb +0 -17
- data/lib/espago/api_connection/get_clients.rb +0 -17
- data/lib/espago/api_connection/get_tokens.rb +0 -13
- data/lib/espago/api_connection/post_charges.rb +0 -13
- data/lib/espago/api_connection/post_clients_authorize.rb +0 -13
- data/lib/espago/api_connection/post_complete.rb +0 -13
- data/lib/espago/api_connection/put_clients.rb +0 -13
@@ -1,17 +0,0 @@
|
|
1
|
-
module Espago
|
2
|
-
class ApiConnection
|
3
|
-
class GetCharges
|
4
|
-
def initialize(connection)
|
5
|
-
@connection = connection
|
6
|
-
end
|
7
|
-
|
8
|
-
def request(params = {})
|
9
|
-
if params[:charge_id]
|
10
|
-
@connection.get "charges/#{params[:charge_id]}"
|
11
|
-
else
|
12
|
-
@connection.get "charges", params
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Espago
|
2
|
-
class ApiConnection
|
3
|
-
class GetClients
|
4
|
-
def initialize(connection)
|
5
|
-
@connection = connection
|
6
|
-
end
|
7
|
-
|
8
|
-
def request(params = {})
|
9
|
-
if params[:client_id]
|
10
|
-
@connection.get "clients/#{params[:client_id]}"
|
11
|
-
else
|
12
|
-
@connection.get "clients", params
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|