ey_services_fake 0.3.15 → 0.3.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -151,7 +151,7 @@ module EyServicesFake
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def destroy_service_account
|
154
|
-
actor(:awsm).disable_service(service_account[:id])
|
154
|
+
actor(:awsm).disable_service(service[:id], service_account[:sso_account][:id], service_account[:id])
|
155
155
|
end
|
156
156
|
|
157
157
|
def app_deployment
|
@@ -122,7 +122,7 @@ module EyServicesFake
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
def disable_service(service_account_id)
|
125
|
+
def disable_service(service_id, sso_account_id, service_account_id)
|
126
126
|
service_account = ServiceAccount.get(service_account_id)
|
127
127
|
@connection.delete(service_account.url)
|
128
128
|
end
|
@@ -114,6 +114,27 @@ module EyServicesFake
|
|
114
114
|
{}.to_json
|
115
115
|
end
|
116
116
|
|
117
|
+
get '/api/1/partners/:partner_id/services/:service_id/service_accounts/:service_account_id/invoices' do |partner_id, service_id, service_account_id|
|
118
|
+
service_account = ServiceAccount.get!(service_account_id)
|
119
|
+
content_type :json
|
120
|
+
service_account.invoices.map do |invoice|
|
121
|
+
{"invoice" => {
|
122
|
+
'total_amount_cents' => invoice.total_amount_cents,
|
123
|
+
'line_item_description' => invoice.line_item_description,
|
124
|
+
'unique_id' => invoice.unique_id.to_s,
|
125
|
+
'url' => URL_GEN.invoice(service_account.service, service_account, invoice),
|
126
|
+
'status' => "pending",
|
127
|
+
}}
|
128
|
+
end.to_json
|
129
|
+
end
|
130
|
+
|
131
|
+
delete '/api/1/partners/:partner_id/services/:service_id/service_accounts/:service_account_id/invoices/:invoice_id' do |partner_id, service_id, service_account_id, invoice_id|
|
132
|
+
invoice = Invoice.get!(invoice_id)
|
133
|
+
invoice.destroy
|
134
|
+
content_type :json
|
135
|
+
{}.to_json
|
136
|
+
end
|
137
|
+
|
117
138
|
post '/api/1/partners/:partner_id/services/:service_id/service_accounts/:service_account_id/messages' do |partner_id, service_id, service_account_id|
|
118
139
|
message_params = JSON.parse(request.body.read)["message"]
|
119
140
|
message_type = message_params['message_type']
|
@@ -29,6 +29,10 @@ module EyServicesFake
|
|
29
29
|
"#{@base_url}/api/1/partners/#{service.partner_id}/services/#{service.id}/service_accounts/#{service_account.id}/invoices"
|
30
30
|
end
|
31
31
|
|
32
|
+
def invoice(service, service_account, invoice)
|
33
|
+
"#{@base_url}/api/1/partners/#{service.partner_id}/services/#{service.id}/service_accounts/#{service_account.id}/invoices/#{invoice.id}"
|
34
|
+
end
|
35
|
+
|
32
36
|
def partner_provisioned_service(service_account, provisioned_service)
|
33
37
|
"#{@base_url}/api/1/service_accounts/#{service_account.id}/provisioned_service/#{provisioned_service.id}"
|
34
38
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ey_services_fake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 16
|
10
|
+
version: 0.3.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jacob Burkhart & Josh Lane
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-11-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: sinatra
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements: []
|
110
110
|
|
111
111
|
rubyforge_project: ey_services_fake
|
112
|
-
rubygems_version: 1.8.
|
112
|
+
rubygems_version: 1.8.24
|
113
113
|
signing_key:
|
114
114
|
specification_version: 3
|
115
115
|
summary: A fake for use when writting tests against the ey_services_api
|