Class: Stripe::WebhookEndpointService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::WebhookEndpointService
- Defined in:
- lib/stripe/services/webhook_endpoint_service.rb
Defined Under Namespace
Classes: CreateParams, DeleteParams, ListParams, RetrieveParams, UpdateParams
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
A webhook endpoint must have a url and a list of enabled_events.
-
#delete(webhook_endpoint, params = {}, opts = {}) ⇒ Object
You can also delete webhook endpoints via the [webhook endpoint management](dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your webhook endpoints.
-
#retrieve(webhook_endpoint, params = {}, opts = {}) ⇒ Object
Retrieves the webhook endpoint with the given ID.
-
#update(webhook_endpoint, params = {}, opts = {}) ⇒ Object
Updates the webhook endpoint.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](dashboard.stripe.com/account/webhooks) section of the Dashboard.
102 103 104 105 106 107 108 109 110 |
# File 'lib/stripe/services/webhook_endpoint_service.rb', line 102 def create(params = {}, opts = {}) request( method: :post, path: "/v1/webhook_endpoints", params: params, opts: opts, base_address: :api ) end |
#delete(webhook_endpoint, params = {}, opts = {}) ⇒ Object
You can also delete webhook endpoints via the [webhook endpoint management](dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
113 114 115 116 117 118 119 120 121 |
# File 'lib/stripe/services/webhook_endpoint_service.rb', line 113 def delete(webhook_endpoint, params = {}, opts = {}) request( method: :delete, path: format("/v1/webhook_endpoints/%<webhook_endpoint>s", { webhook_endpoint: CGI.escape(webhook_endpoint) }), params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your webhook endpoints.
124 125 126 127 128 129 130 131 132 |
# File 'lib/stripe/services/webhook_endpoint_service.rb', line 124 def list(params = {}, opts = {}) request( method: :get, path: "/v1/webhook_endpoints", params: params, opts: opts, base_address: :api ) end |
#retrieve(webhook_endpoint, params = {}, opts = {}) ⇒ Object
Retrieves the webhook endpoint with the given ID.
135 136 137 138 139 140 141 142 143 |
# File 'lib/stripe/services/webhook_endpoint_service.rb', line 135 def retrieve(webhook_endpoint, params = {}, opts = {}) request( method: :get, path: format("/v1/webhook_endpoints/%<webhook_endpoint>s", { webhook_endpoint: CGI.escape(webhook_endpoint) }), params: params, opts: opts, base_address: :api ) end |
#update(webhook_endpoint, params = {}, opts = {}) ⇒ Object
Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
146 147 148 149 150 151 152 153 154 |
# File 'lib/stripe/services/webhook_endpoint_service.rb', line 146 def update(webhook_endpoint, params = {}, opts = {}) request( method: :post, path: format("/v1/webhook_endpoints/%<webhook_endpoint>s", { webhook_endpoint: CGI.escape(webhook_endpoint) }), params: params, opts: opts, base_address: :api ) end |