pr-pin 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +55 -55
- data/lib/pr/pin/relations/charges.rb +4 -0
- data/lib/pr/pin/relations/ledger.rb +2 -2
- data/lib/pr/pin/relations/refunds.rb +2 -2
- data/lib/pr/pin/repositories/charges.rb +9 -0
- data/lib/pr/pin/repositories/ledger.rb +2 -2
- data/lib/pr/pin/repositories/refunds.rb +4 -4
- data/lib/pr/pin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5c46e7b7fb9f7caf1043adf2acb0d7d65d361dd1a92eb94ab6a883ca038c2c2
|
4
|
+
data.tar.gz: 247e327a750a9502459c5cf9d79f893eccded38bb092c8338de84ee4e238163f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fe319516a83e0034ab58cb27e050e442767ddef0edba2afbac269fbaac2c66e9444604f3bccfeac8dfa4522b9faf96c75d849dc30e3d8baea530b3397218107
|
7
|
+
data.tar.gz: c05ca50f8ab613b86f97b294da0dc73b0b2a02fa077385cb422d0f826edb1e89ea7975fc3ed3fe72998cfa7886a20ee44850c85b2bfc32b8352bf7c13c541605
|
data/README.md
CHANGED
@@ -141,61 +141,61 @@ Coverage of https://pinpayments.com/developers/api-reference
|
|
141
141
|
|
142
142
|
| Relation | Endpoint | Description | Docs | Implemented |
|
143
143
|
|--|--|--|--|--|
|
144
|
-
| Balance | GET /balance | Returns the current balance of your Pin Payments account | [:link:](https://pinpayments.com/developers/api-reference/balance) | :x: |
|
145
|
-
| Bank Accounts | POST /bank_accounts | Creates a bank account token | [:link:](https://pinpayments.com/developers/api-reference/bank-accounts) | :x: |
|
146
|
-
| Cards | POST /cards | Securely stores a card's details | [:link:](https://pinpayments.com/developers/api-reference/cards) | :x: |
|
147
|
-
| Charges | POST /charges | Creates a new charge | [:link:](https://pinpayments.com/developers/api-reference/charges#post-charges) | :heavy_check_mark: |
|
148
|
-
| Charges | PUT /charges
|
149
|
-
| Charges | GET /charges | Returns a paginated list of all charges | [:link:](https://pinpayments.com/developers/api-reference/charges#get-charges) | :heavy_check_mark: |
|
150
|
-
| Charges | GET /charges/search | Returns a paginated list of charges matching the search criteria | [:link:](https://pinpayments.com/developers/api-reference/charges#search-charges) | :heavy_check_mark: |
|
151
|
-
| Charges | GET /charges
|
152
|
-
| Customers | POST /customers | Creates a new customer | [:link:](https://pinpayments.com/developers/api-reference/customers#post-customers) | :heavy_check_mark: |
|
153
|
-
| Customers | GET /customers | Returns a paginated list of all customers | [:link:](https://pinpayments.com/developers/api-reference/customers#get-customers) | :heavy_check_mark: |
|
154
|
-
| Customers | GET /customers
|
155
|
-
| Customers | PUT /customers
|
156
|
-
| Customers | DELETE /customers
|
157
|
-
| Customers | GET /customers
|
158
|
-
| Customers | GET /customers
|
159
|
-
| Customers | POST /customers
|
160
|
-
| Customers | DELETE /customers
|
161
|
-
| Customers | GET /customers
|
162
|
-
| Events | GET /events | Returns a paginated list of all events | [:link:](https://pinpayments.com/developers/api-reference/events#get-events) | :x: |
|
163
|
-
| Events | GET /events
|
164
|
-
| Plans | POST /plans | Creates a new plan | [:link:](https://pinpayments.com/developers/api-reference/plans#post-plans) | :heavy_check_mark: |
|
165
|
-
| Plans | GET /plans | Returns a paginated list of all plans | [:link:](https://pinpayments.com/developers/api-reference/plans#get-plans) | :heavy_check_mark: |
|
166
|
-
| Plans | GET /plans
|
167
|
-
| Plans | PUT /plans
|
168
|
-
| Plans | DELETE /plans
|
169
|
-
| Plans | POST /plans
|
170
|
-
| Plans | GET /plans
|
171
|
-
| Subscriptions | POST /subscriptions | Activate a new subscription and returns its details | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#post-subscriptions) | :heavy_check_mark: |
|
172
|
-
| Subscriptions | GET /subscriptions | Returns a paginated list of all subscriptions | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#get-subscriptions) | :heavy_check_mark: |
|
173
|
-
| Subscriptions | GET /subscriptions
|
174
|
-
| Subscriptions | PUT /subscriptions
|
175
|
-
| Subscriptions | DELETE /subscriptions
|
176
|
-
| Subscriptions | PUT /subscriptions
|
177
|
-
| Subscriptions | GET /subscriptions
|
178
|
-
| Recipients | POST /recipients | Creates a new recipient | [:link:](https://pinpayments.com/developers/api-reference/recipients#post-recipients) | :x: |
|
179
|
-
| Recipients | GET /recipients | Returns a paginated list of all recipients | [:link:](https://pinpayments.com/developers/api-reference/recipients#get-recipients) | :x: |
|
180
|
-
| Recipients | GET /recipients
|
181
|
-
| Recipients | PUT /recipients
|
182
|
-
| Recipients | GET /recipients
|
183
|
-
| Refunds | GET /refunds | Returns a paginated list of all refunds | [:link:](https://pinpayments.com/developers/api-reference/refunds#get-refunds) | :heavy_check_mark: |
|
184
|
-
| Refunds | GET /refunds
|
185
|
-
| Refunds | POST /charges
|
186
|
-
| Refunds | GET /charges
|
187
|
-
| Transfers | POST /transfers | Creates a new transfer | [:link:](https://pinpayments.com/developers/api-reference/transfers#post-transfers) | :x: |
|
188
|
-
| Transfers | GET /transfers | Returns a paginated list of all transfers | [:link:](https://pinpayments.com/developers/api-reference/transfers#get-transfers) | :x: |
|
189
|
-
| Transfers | GET /transfers/search | Returns a paginated list of transfers matching the search criteria | [:link:](https://pinpayments.com/developers/api-reference/transfers#search-transfers) | :x: |
|
190
|
-
| Transfers | GET /transfers
|
191
|
-
| Transfers | GET /transfers
|
192
|
-
| Webhook Endpoints | POST /webhook_endpoints | Creates a new webhook endpoint | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#post-webhook_endpoints) | :x: |
|
193
|
-
| Webhook Endpoints | GET /webhook_endpoints | Returns a paginated list of all webhook endpoints | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#get-webhook_endpoints) | :x: |
|
194
|
-
| Webhook Endpoints | GET /webhook_endpoints
|
195
|
-
| Webhook Endpoints | DELETE /webhook_endpoints
|
196
|
-
| Webhooks | GET /webhooks | Returns a paginated list of all webhooks | [:link:](https://pinpayments.com/developers/api-reference/webhooks#get-webhooks) | :x: |
|
197
|
-
| Webhooks | GET /webhooks
|
198
|
-
| Webhooks | PUT /webhooks
|
144
|
+
| Balance | `GET /balance` | Returns the current balance of your Pin Payments account | [:link:](https://pinpayments.com/developers/api-reference/balance) | :x: |
|
145
|
+
| Bank Accounts | `POST /bank_accounts` | Creates a bank account token | [:link:](https://pinpayments.com/developers/api-reference/bank-accounts) | :x: |
|
146
|
+
| Cards | `POST /cards` | Securely stores a card's details | [:link:](https://pinpayments.com/developers/api-reference/cards) | :x: |
|
147
|
+
| Charges | `POST /charges` | Creates a new charge | [:link:](https://pinpayments.com/developers/api-reference/charges#post-charges) | :heavy_check_mark: |
|
148
|
+
| Charges | `PUT /charges/#{charge-token}/capture` | Captures a previously authorised charge | [:link:](https://pinpayments.com/developers/api-reference/charges#put-charges) | :x: |
|
149
|
+
| Charges | `GET /charges` | Returns a paginated list of all charges | [:link:](https://pinpayments.com/developers/api-reference/charges#get-charges) | :heavy_check_mark: |
|
150
|
+
| Charges | `GET /charges/search` | Returns a paginated list of charges matching the search criteria | [:link:](https://pinpayments.com/developers/api-reference/charges#search-charges) | :heavy_check_mark: |
|
151
|
+
| Charges | `GET /charges/#{charge-token}` | Returns the details of a charge | [:link:](https://pinpayments.com/developers/api-reference/charges#get-charge) | :heavy_check_mark: |
|
152
|
+
| Customers | `POST /customers` | Creates a new customer | [:link:](https://pinpayments.com/developers/api-reference/customers#post-customers) | :heavy_check_mark: |
|
153
|
+
| Customers | `GET /customers` | Returns a paginated list of all customers | [:link:](https://pinpayments.com/developers/api-reference/customers#get-customers) | :heavy_check_mark: |
|
154
|
+
| Customers | `GET /customers/#{customer-token}` | Returns the details of a customer | [:link:](https://pinpayments.com/developers/api-reference/customers#get-customer) | :heavy_check_mark: |
|
155
|
+
| Customers | `PUT /customers/#{customer-token}` | Updates the details of a customer | [:link:](https://pinpayments.com/developers/api-reference/customers#put-customer) | :heavy_check_mark: |
|
156
|
+
| Customers | `DELETE /customers/#{customer-token}` | Deletes a customer and all of its cards | [:link:](https://pinpayments.com/developers/api-reference/customers#delete-customer) | :x: |
|
157
|
+
| Customers | `GET /customers/#{customer-token}/charges` | Returns a paginated list of a customer's charges | [:link:](https://pinpayments.com/developers/api-reference/customers#get-customers-charges) | :heavy_check_mark: |
|
158
|
+
| Customers | `GET /customers/#{customer-token}/cards` | Returns a paginated list of a customer's cards | [:link:](https://pinpayments.com/developers/api-reference/customers#get-customers-cards) | :x: |
|
159
|
+
| Customers | `POST /customers/#{customer-token}/cards` | Creates an additional card for the specified customer | [:link:](https://pinpayments.com/developers/api-reference/customers#post-customers-cards) | :x: |
|
160
|
+
| Customers | `DELETE /customers/#{customer-token}/cards/#{card-token}` | Deletes a customer's non-primary card | [:link:](https://pinpayments.com/developers/api-reference/customers#delete-customers-card) | :x: |
|
161
|
+
| Customers | `GET /customers/#{customer-token}/subscriptions` | Retrieves the specified customer's subscriptions | [:link:](https://pinpayments.com/developers/api-reference/customers#customers-subscriptions) | :x: |
|
162
|
+
| Events | `GET /events` | Returns a paginated list of all events | [:link:](https://pinpayments.com/developers/api-reference/events#get-events) | :x: |
|
163
|
+
| Events | `GET /events/#{event-token}` | Returns the details of the specified event | [:link:](https://pinpayments.com/developers/api-reference/events#get-event) | :x: |
|
164
|
+
| Plans | `POST /plans` | Creates a new plan | [:link:](https://pinpayments.com/developers/api-reference/plans#post-plans) | :heavy_check_mark: |
|
165
|
+
| Plans | `GET /plans` | Returns a paginated list of all plans | [:link:](https://pinpayments.com/developers/api-reference/plans#get-plans) | :heavy_check_mark: |
|
166
|
+
| Plans | `GET /plans/#{plan-token}` | Returns the details of a specified plan | [:link:](https://pinpayments.com/developers/api-reference/plans#get-plan) | :heavy_check_mark: |
|
167
|
+
| Plans | `PUT /plans/#{plan-token}` | Update the specified plan | [:link:](https://pinpayments.com/developers/api-reference/plans#put-plan) | :heavy_check_mark: |
|
168
|
+
| Plans | `DELETE /plans/#{plan-token}` | Deletes a plan and all of its subscriptions | [:link:](https://pinpayments.com/developers/api-reference/plans#delete-plan) | :x: |
|
169
|
+
| Plans | `POST /plans/#{plan-token}/subscriptions` | Creates a new subscription to the specified plan | [:link:](https://pinpayments.com/developers/api-reference/plans#create-plan-subscription) | :x: |
|
170
|
+
| Plans | `GET /plans/#{plan-token}/subscriptions` | Returns a paginated list of subscriptions for a plan | [:link:](https://pinpayments.com/developers/api-reference/plans#get-plan-subscriptions) | :x: |
|
171
|
+
| Subscriptions | `POST /subscriptions` | Activate a new subscription and returns its details | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#post-subscriptions) | :heavy_check_mark: |
|
172
|
+
| Subscriptions | `GET /subscriptions` | Returns a paginated list of all subscriptions | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#get-subscriptions) | :heavy_check_mark: |
|
173
|
+
| Subscriptions | `GET /subscriptions/#{sub-token}` | Returns the details of the subscription identified by subscription token | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#get-subscription) | :heavy_check_mark: |
|
174
|
+
| Subscriptions | `PUT /subscriptions/#{sub-token}` | Updates the card associated with a subscription identified by subscription token | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#update-subscription) | :heavy_check_mark: |
|
175
|
+
| Subscriptions | `DELETE /subscriptions/#{sub-token}` | Cancels the subscription identified by subscription token | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#delete-subscription) | :x: |
|
176
|
+
| Subscriptions | `PUT /subscriptions/#{sub-token}/reactivate` | Reactivates the subscription identified by subscription token | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#reactivate-subscription) | :x: |
|
177
|
+
| Subscriptions | `GET /subscriptions/#{sub-token}/ledger` | Fetch the ledger entries relating to a subscription identified by subscription token | [:link:](https://pinpayments.com/developers/api-reference/subscriptions#ledger-subscription) | :heavy_check_mark: |
|
178
|
+
| Recipients | `POST /recipients` | Creates a new recipient | [:link:](https://pinpayments.com/developers/api-reference/recipients#post-recipients) | :x: |
|
179
|
+
| Recipients | `GET /recipients` | Returns a paginated list of all recipients | [:link:](https://pinpayments.com/developers/api-reference/recipients#get-recipients) | :x: |
|
180
|
+
| Recipients | `GET /recipients/#{recipient-token}` | Returns the details of a recipient | [:link:](https://pinpayments.com/developers/api-reference/recipients#get-recipient) | :x: |
|
181
|
+
| Recipients | `PUT /recipients/#{recipient-token}` | Updates the details of a recipient | [:link:](https://pinpayments.com/developers/api-reference/recipients#put-recipient) | :x: |
|
182
|
+
| Recipients | `GET /recipients/#{recipient-token}/transfers` | Returns a paginated list of a recipient's transfers | [:link:](https://pinpayments.com/developers/api-reference/recipients#get-recipients-transfers) | :x: |
|
183
|
+
| Refunds | `GET /refunds` | Returns a paginated list of all refunds | [:link:](https://pinpayments.com/developers/api-reference/refunds#get-refunds) | :heavy_check_mark: |
|
184
|
+
| Refunds | `GET /refunds/#{refund-token}` | Returns the details of the specified refund | [:link:](https://pinpayments.com/developers/api-reference/refunds#get-refund) | :heavy_check_mark: |
|
185
|
+
| Refunds | `POST /charges/#{charge-token}/refunds` | Creates a new refund and returns its details | [:link:](https://pinpayments.com/developers/api-reference/refunds#post-refunds) | :heavy_check_mark: |
|
186
|
+
| Refunds | `GET /charges/#{charge-token}/refunds` | Returns a list of all refunds for the specified charge | [:link:](https://pinpayments.com/developers/api-reference/refunds#get-token-refunds) | :heavy_check_mark: |
|
187
|
+
| Transfers | `POST /transfers` | Creates a new transfer | [:link:](https://pinpayments.com/developers/api-reference/transfers#post-transfers) | :x: |
|
188
|
+
| Transfers | `GET /transfers` | Returns a paginated list of all transfers | [:link:](https://pinpayments.com/developers/api-reference/transfers#get-transfers) | :x: |
|
189
|
+
| Transfers | `GET /transfers/search` | Returns a paginated list of transfers matching the search criteria | [:link:](https://pinpayments.com/developers/api-reference/transfers#search-transfers) | :x: |
|
190
|
+
| Transfers | `GET /transfers/#{transfer-token}` | Returns the details of the specified transfer | [:link:](https://pinpayments.com/developers/api-reference/transfers#get-transfer) | :x: |
|
191
|
+
| Transfers | `GET /transfers/#{transfer-token}/line_items` | Returns a paginated list of line items associated with the specified transfer | [:link:](https://pinpayments.com/developers/api-reference/transfers#get-transfer-line-items) | :x: |
|
192
|
+
| Webhook Endpoints | `POST /webhook_endpoints` | Creates a new webhook endpoint | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#post-webhook_endpoints) | :x: |
|
193
|
+
| Webhook Endpoints | `GET /webhook_endpoints` | Returns a paginated list of all webhook endpoints | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#get-webhook_endpoints) | :x: |
|
194
|
+
| Webhook Endpoints | `GET /webhook_endpoints/#{webhook-endpoint-token}` | Returns the details of the specified webhook endpoint | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#get-webhook_endpoints-token) | :x: |
|
195
|
+
| Webhook Endpoints | `DELETE /webhook_endpoints/#{webhook-endpoint-token}` | Deletes a webhook endpoint and all of its webhook requests | [:link:](https://pinpayments.com/developers/api-reference/webhook-endpoints#delete-webhook_endpoints) | :x: |
|
196
|
+
| Webhooks | `GET /webhooks` | Returns a paginated list of all webhooks | [:link:](https://pinpayments.com/developers/api-reference/webhooks#get-webhooks) | :x: |
|
197
|
+
| Webhooks | `GET /webhooks/#{webhook-token}` | Returns the details of a webhook | [:link:](https://pinpayments.com/developers/api-reference/webhooks#get-webhook) | :x: |
|
198
|
+
| Webhooks | `PUT /webhooks/#{webhook-token}/replay` | Replays a webhook | [:link:](https://pinpayments.com/developers/api-reference/webhooks#put-webhook-replay) | :x: |
|
199
199
|
|
200
200
|
## Development
|
201
201
|
|
@@ -10,8 +10,8 @@ module PR
|
|
10
10
|
attribute :created_at, Types::JSON::DateTime
|
11
11
|
end
|
12
12
|
|
13
|
-
def for_subscription(
|
14
|
-
with_base_path("/subscriptions/#{
|
13
|
+
def for_subscription(subscription_token)
|
14
|
+
with_base_path("/subscriptions/#{subscription_token}/ledger")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -32,6 +32,15 @@ module PR
|
|
32
32
|
relation.paginate
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
def for_customer(customer_token, page: 1, per_page: nil)
|
37
|
+
relation = root.for_customer(customer_token).with_params(
|
38
|
+
page: page,
|
39
|
+
per_page: per_page
|
40
|
+
)
|
41
|
+
|
42
|
+
API::PaginatedResult.wrap(relation) { relation.paginate }
|
43
|
+
end
|
35
44
|
end
|
36
45
|
end
|
37
46
|
end
|
@@ -4,8 +4,8 @@ module PR
|
|
4
4
|
class Ledger < ROM::Repository[:ledger]
|
5
5
|
struct_namespace PR::Pin::Struct
|
6
6
|
|
7
|
-
def for_subscription(
|
8
|
-
relation = root.for_subscription(
|
7
|
+
def for_subscription(subscription_token, page: 1, per_page: nil)
|
8
|
+
relation = root.for_subscription(subscription_token).with_params(
|
9
9
|
page: page,
|
10
10
|
per_page: per_page
|
11
11
|
)
|
@@ -19,16 +19,16 @@ module PR
|
|
19
19
|
API::Result.wrap(relation) { relation.one }
|
20
20
|
end
|
21
21
|
|
22
|
-
def create_for_charge(
|
23
|
-
relation = root.for_charge(
|
22
|
+
def create_for_charge(charge_token, *args)
|
23
|
+
relation = root.for_charge(charge_token)
|
24
24
|
|
25
25
|
API::Result.wrap(relation) do
|
26
26
|
relation.command(:create).call(*args)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def for_charge(
|
31
|
-
relation = root.for_charge(
|
30
|
+
def for_charge(charge_token, page: 1, per_page: nil)
|
31
|
+
relation = root.for_charge(charge_token).with_params(
|
32
32
|
page: page,
|
33
33
|
per_page: per_page
|
34
34
|
)
|
data/lib/pr/pin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pr-pin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AMHOL
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|