coinbase_commerce_client 0.1.0 → 0.2.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: b9a510d1becec57136692c56a98c2de295de90368ef7f293f8d0cc4bba601a45
4
+ data.tar.gz: 8e2c35f74a5414449ff9a8df15a69dc87609c94f60d93e502943f38403e2d598
5
5
  SHA512:
6
- metadata.gz: 29791b039fab0a91e23c3965bf0ed7c14fc90d921048355b8f58ba795a48ac989e43c43a6d12ab47c21a4592d40a7677fa9fbb6a098f1cb620312f5417582649
7
- data.tar.gz: e6fecf8770323a2270e6340a3a4a00939d435a784f13001a29f290ea662c1d85e2318cf2a809b4cc7053041fe05574068edc551072be6423a856b6be87a2e30f
6
+ metadata.gz: 3f1e618708f0b31d5016eb4635e067e64c5e28cc8dbe8aa1c81748092c18ce4e4956edc1b54ee9465adcc1dcd47ffb8303757c16b13ea0eea8cd32ac39b46071
7
+ data.tar.gz: d6c11deb7cb8a95030e3fe8cd1277d98bcc6b26ae44a38dcf53bde5ca7f4e505d8e2169335ed0e1d5de5a580a5f433d5e2612dbeda66e2e498233693ca32039d
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,12 @@ 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
+ ```
201
207
  ### Paging list iterations
202
208
  ```ruby
203
209
  client.charge.auto_paging do |charge|
@@ -259,7 +265,7 @@ end
259
265
  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
266
 
261
267
  # Install the requirements
262
- gem install coinbase_commerce
268
+ gem install coinbase_commerce_client
263
269
  rspec spec
264
270
 
265
271
  # 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.18%"><title>coverage: 89.18%</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.18%</text><text x="865" y="140" transform="scale(.1)" fill="#fff" textLength="430">89.18%</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
@@ -4,6 +4,8 @@ module CoinbaseCommerceClient
4
4
  extend Base::List
5
5
  extend Base::Create
6
6
 
7
+ include Base::Cancel
8
+
7
9
  OBJECT_NAME = 'charge'.freeze
8
10
  RESOURCE_PATH = 'charges'.freeze
9
11
  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.2.0'
5
5
  end
@@ -25,6 +25,7 @@ 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"
28
29
  require "coinbase_commerce_client/api_resources/base/save"
29
30
  require "coinbase_commerce_client/api_resources/base/list"
30
31
  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.2.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-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -107,6 +107,7 @@ 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