Module: PaypalAPI::Webhooks::APIs

Included in:
PaypalAPI::Webhooks, PaypalAPI::Webhooks
Defined in:
lib/paypal-api/api_collections/webhooks.rb

Overview

Common methods for PaypalAPI::Webhooks class and client.webhooks instance

Instance Method Summary collapse

Instance Method Details

#create(query: nil, body: nil, headers: nil) ⇒ Response

Create webhook

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



25
26
27
# File 'lib/paypal-api/api_collections/webhooks.rb', line 25

def create(query: nil, body: nil, headers: nil)
  client.post("/v1/notifications/webhooks", query: query, body: body, headers: headers)
end

#delete(webhook_id, query: nil, body: nil, headers: nil) ⇒ Response

Delete webhook

Parameters:

  • webhook_id (String)

    Webhook ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



72
73
74
# File 'lib/paypal-api/api_collections/webhooks.rb', line 72

def delete(webhook_id, query: nil, body: nil, headers: nil)
  client.delete("/v1/notifications/webhooks/#{encode(webhook_id)}", query: query, body: body, headers: headers)
end

#event_types(webhook_id, query: nil, body: nil, headers: nil) ⇒ Response

List event subscriptions for webhook

Parameters:

  • webhook_id (String)

    Webhook ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



84
85
86
# File 'lib/paypal-api/api_collections/webhooks.rb', line 84

def event_types(webhook_id, query: nil, body: nil, headers: nil)
  client.get("/v1/notifications/webhooks/#{encode(webhook_id)}/event-types", query: query, body: body, headers: headers)
end

#list(query: nil, body: nil, headers: nil) ⇒ Response

List webhooks

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



36
37
38
# File 'lib/paypal-api/api_collections/webhooks.rb', line 36

def list(query: nil, body: nil, headers: nil)
  client.get("/v1/notifications/webhooks", query: query, body: body, headers: headers)
end

#show(webhook_id, query: nil, body: nil, headers: nil) ⇒ Response

Show webhook details

Parameters:

  • webhook_id (String)

    Webhook ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



48
49
50
# File 'lib/paypal-api/api_collections/webhooks.rb', line 48

def show(webhook_id, query: nil, body: nil, headers: nil)
  client.get("/v1/notifications/webhooks/#{encode(webhook_id)}", query: query, body: body, headers: headers)
end

#update(webhook_id, query: nil, body: nil, headers: nil) ⇒ Response

Update webhook

Parameters:

  • webhook_id (String)

    Webhook ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



60
61
62
# File 'lib/paypal-api/api_collections/webhooks.rb', line 60

def update(webhook_id, query: nil, body: nil, headers: nil)
  client.patch("/v1/notifications/webhooks/#{encode(webhook_id)}", query: query, body: body, headers: headers)
end

#verify(query: nil, body: nil, headers: nil) ⇒ Response

Verify webhook signature

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



95
96
97
# File 'lib/paypal-api/api_collections/webhooks.rb', line 95

def verify(query: nil, body: nil, headers: nil)
  client.post("/v1/notifications/verify-webhook-signature", query: query, body: body, headers: headers)
end