coinbase_commerce_client 0.1.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9f34093c391c693ffc11f40d67a89b2f2401c2156144d5b8c1808e92482d656
4
- data.tar.gz: f14707f0574281bfebe9d4ed929b16c1e0da0988da2253afb391b0daefd35678
3
+ metadata.gz: 0c4adff7d11dee8fb401c917dcccc4a1d571af2a26f833b9931ee3f13315199e
4
+ data.tar.gz: 4b46f2cd7f8050a20b6e5763396b6e058fe387fb18e81797509472adcd749f64
5
5
  SHA512:
6
- metadata.gz: 29791b039fab0a91e23c3965bf0ed7c14fc90d921048355b8f58ba795a48ac989e43c43a6d12ab47c21a4592d40a7677fa9fbb6a098f1cb620312f5417582649
7
- data.tar.gz: e6fecf8770323a2270e6340a3a4a00939d435a784f13001a29f290ea662c1d85e2318cf2a809b4cc7053041fe05574068edc551072be6423a856b6be87a2e30f
6
+ metadata.gz: 14cc887e20de18fe1b667d29eaa2c014f539e656535243dc9910696403b1ab029eae4d8199b572469368302317c1517a9b9931cd3825bf635f3e7dd1aebcec5a
7
+ data.tar.gz: 6c9c4806f579bc6fc638bc45513d3d2bae10ca03474317cc3d21cc61f45b95edd2b9e1a592e9594617c33a93d779f4203d504558e56af4045130e579287e8716
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coinbase_commerce_client (0.1.0)
4
+ coinbase_commerce_client (0.2.0)
5
5
  faraday (~> 2.6)
6
6
  multipart-post (~> 2.0)
7
7
 
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </p>
5
5
 
6
6
  # Coinbase Commerce Client
7
- > <sub>This gem is completely inspired by official Coinbase gem [coinbase-commerce-ruby](coinbase-commerce-ruby), unfortunately the oficial gem actually is deprecated, and my motivation is to continue support for this gem</sub>
7
+ > <sub>This gem is completely inspired by official Coinbase gem [coinbase-commerce-ruby](https://github.com/coinbase/coinbase-commerce-ruby), unfortunately the oficial gem actually is deprecated, and my motivation is to continue support for this gem</sub>
8
8
 
9
9
  Coinbase Commerce Client Ruby Gem
10
10
 
@@ -106,7 +106,7 @@ gem install coinbase_commerce_client
106
106
 
107
107
  ## Usage
108
108
  ```ruby
109
- require 'coinbase_commerce'
109
+ require 'coinbase_commerce_client'
110
110
  client = CoinbaseCommerceClient::Client.new(api_key: 'your_api_key')
111
111
  ```
112
112
  ## Checkouts
@@ -198,6 +198,20 @@ charge = client.charge.create(:name=>'The Sovereign Individual',
198
198
  ```ruby
199
199
  charges_list = client.charge.list
200
200
  ```
201
+ ### Cancel
202
+ ```ruby
203
+ charge = client.charge.retrieve <charge_id>
204
+
205
+ charge.cancel
206
+ ```
207
+
208
+ ### Resolve
209
+ ```ruby
210
+ charge = client.charge.retrieve <charge_id>
211
+
212
+ charge.resolve
213
+ ```
214
+
201
215
  ### Paging list iterations
202
216
  ```ruby
203
217
  client.charge.auto_paging do |charge|
@@ -259,7 +273,7 @@ end
259
273
  Any and all contributions are welcome! The process is simple: fork this repo, make your changes, add tests, run the test suite, and submit a pull request. Tests are run via rspec. To run the tests, clone the repository and then:
260
274
 
261
275
  # Install the requirements
262
- gem install coinbase_commerce
276
+ gem install coinbase_commerce_client
263
277
  rspec spec
264
278
 
265
279
  # or via Bundle
data/badge.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="114" height="20" role="img" aria-label="coverage: 88.92%"><title>coverage: 88.92%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="114" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="53" height="20" fill="#97ca00"/><rect width="114" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">coverage</text><text aria-hidden="true" x="865" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">88.92%</text><text x="865" y="140" transform="scale(.1)" fill="#fff" textLength="430">88.92%</text></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="114" height="20" role="img" aria-label="coverage: 89.44%"><title>coverage: 89.44%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="114" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="53" height="20" fill="#97ca00"/><rect width="114" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">coverage</text><text aria-hidden="true" x="865" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">89.44%</text><text x="865" y="140" transform="scale(.1)" fill="#fff" textLength="430">89.44%</text></g></svg>
@@ -0,0 +1,13 @@
1
+ module CoinbaseCommerceClient
2
+ module APIResources
3
+ module Base
4
+ module Cancel
5
+ def cancel
6
+ resp = @client.request(:post, "#{self.class::RESOURCE_PATH}/#{self[:id]}/cancel", self)
7
+ initialize_from(resp.data)
8
+ self
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module CoinbaseCommerceClient
2
+ module APIResources
3
+ module Base
4
+ module Resolve
5
+ def resolve
6
+ resp = @client.request(:post, "#{self.class::RESOURCE_PATH}/#{self[:id]}/resolve", self)
7
+ initialize_from(resp.data)
8
+ self
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -4,6 +4,9 @@ module CoinbaseCommerceClient
4
4
  extend Base::List
5
5
  extend Base::Create
6
6
 
7
+ include Base::Cancel
8
+ include Base::Resolve
9
+
7
10
  OBJECT_NAME = 'charge'.freeze
8
11
  RESOURCE_PATH = 'charges'.freeze
9
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoinbaseCommerceClient
4
- VERSION = '0.1.0'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -25,6 +25,8 @@ require "coinbase_commerce_client/api_resources/base/api_resource"
25
25
  # api base operations
26
26
  require "coinbase_commerce_client/api_resources/base/create"
27
27
  require "coinbase_commerce_client/api_resources/base/update"
28
+ require "coinbase_commerce_client/api_resources/base/cancel"
29
+ require "coinbase_commerce_client/api_resources/base/resolve"
28
30
  require "coinbase_commerce_client/api_resources/base/save"
29
31
  require "coinbase_commerce_client/api_resources/base/list"
30
32
  require "coinbase_commerce_client/api_resources/base/delete"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinbase_commerce_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinicius Borges
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-14 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -107,9 +107,11 @@ files:
107
107
  - lib/coinbase_commerce_client/api_errors.rb
108
108
  - lib/coinbase_commerce_client/api_resources/base/api_object.rb
109
109
  - lib/coinbase_commerce_client/api_resources/base/api_resource.rb
110
+ - lib/coinbase_commerce_client/api_resources/base/cancel.rb
110
111
  - lib/coinbase_commerce_client/api_resources/base/create.rb
111
112
  - lib/coinbase_commerce_client/api_resources/base/delete.rb
112
113
  - lib/coinbase_commerce_client/api_resources/base/list.rb
114
+ - lib/coinbase_commerce_client/api_resources/base/resolve.rb
113
115
  - lib/coinbase_commerce_client/api_resources/base/save.rb
114
116
  - lib/coinbase_commerce_client/api_resources/base/update.rb
115
117
  - lib/coinbase_commerce_client/api_resources/charge.rb