paypal-rest-api 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -25
- data/VERSION +1 -1
- data/lib/paypal-api/access_token.rb +16 -0
- data/lib/paypal-api/{collection.rb → api_collection.rb} +9 -1
- data/lib/paypal-api/{collections → api_collections}/authentication.rb +2 -2
- data/lib/paypal-api/api_collections/authorized_payments.rb +70 -0
- data/lib/paypal-api/api_collections/captured_payments.rb +48 -0
- data/lib/paypal-api/api_collections/catalog_products.rb +70 -0
- data/lib/paypal-api/api_collections/orders.rb +120 -0
- data/lib/paypal-api/api_collections/refunds.rb +30 -0
- data/lib/paypal-api/api_collections/shipment_tracking.rb +59 -0
- data/lib/paypal-api/api_collections/subscriptions.rb +213 -0
- data/lib/paypal-api/api_collections/webhooks.rb +206 -0
- data/lib/paypal-api/client.rb +86 -4
- data/lib/paypal-api/config.rb +27 -9
- data/lib/paypal-api/error.rb +94 -67
- data/lib/paypal-api/failed_request_error_builder.rb +21 -13
- data/lib/paypal-api/network_error_builder.rb +9 -1
- data/lib/paypal-api/request.rb +21 -1
- data/lib/paypal-api/request_executor.rb +8 -0
- data/lib/paypal-api/response.rb +25 -1
- data/lib/paypal-api.rb +90 -11
- metadata +12 -7
- data/lib/paypal-api/collections/orders.rb +0 -36
- data/lib/paypal-api/collections/payments.rb +0 -51
- data/lib/paypal-api/collections/webhooks.rb +0 -55
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module PaypalAPI
|
4
|
-
#
|
5
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/
|
6
|
-
#
|
7
|
-
class Webhooks < Collection
|
8
|
-
module APIs
|
9
|
-
#
|
10
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_post
|
11
|
-
#
|
12
|
-
def create(query: nil, body: nil, headers: nil)
|
13
|
-
client.post("/v1/notifications/webhooks", query: query, body: body, headers: headers)
|
14
|
-
end
|
15
|
-
|
16
|
-
#
|
17
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_delete
|
18
|
-
#
|
19
|
-
def delete(webhook_id, query: nil, body: nil, headers: nil)
|
20
|
-
client.delete("/v1/notifications/webhooks/#{webhook_id}", query: query, body: body, headers: headers)
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_list
|
25
|
-
#
|
26
|
-
def list(query: nil, body: nil, headers: nil)
|
27
|
-
client.get("/v1/notifications/webhooks", query: query, body: body, headers: headers)
|
28
|
-
end
|
29
|
-
|
30
|
-
#
|
31
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get
|
32
|
-
#
|
33
|
-
def show(webhook_id, query: nil, body: nil, headers: nil)
|
34
|
-
client.get("/v1/notifications/webhooks/#{webhook_id}", query: query, body: body, headers: headers)
|
35
|
-
end
|
36
|
-
|
37
|
-
#
|
38
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_update
|
39
|
-
#
|
40
|
-
def update(webhook_id, query: nil, body: nil, headers: nil)
|
41
|
-
client.patch("/v1/notifications/webhooks/#{webhook_id}", query: query, body: body, headers: headers)
|
42
|
-
end
|
43
|
-
|
44
|
-
#
|
45
|
-
# https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post
|
46
|
-
#
|
47
|
-
def verify(query: nil, body: nil, headers: nil)
|
48
|
-
client.post("/v1/notifications/verify-webhook-signature", query: query, body: body, headers: headers)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
include APIs
|
53
|
-
extend APIs
|
54
|
-
end
|
55
|
-
end
|