TagoStripe 0.1.0.3 → 0.1.0.5

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: 40a4c77749893e9a84d546e6c308aa421081dd9f4fefdafe5b4c456c621c98ea
4
- data.tar.gz: 8bc8a43b4b5c60e5bfda7e9de969ea41e664fbc9184bc70976609670ee8d8b9f
3
+ metadata.gz: 938f0aafcf8e92bcbf241599507023f8fc93a7267d626d4a27e81b148170aadc
4
+ data.tar.gz: 76b7152265b16c030567fef20b0563b7562a92f4a778ec8fdf3c4208d960cfad
5
5
  SHA512:
6
- metadata.gz: 2f7c098b6de322d33cbe8f9af3eb81ccd5f99bfdaa2ae82b7198e1b1ff543373517e95632f5bd6720e2270d90031806cd9a59e389cbf2a9bdec873c72c423ba8
7
- data.tar.gz: 9a90c966631735dd69c0d0029d2640a961ed61ed2fa7d09c9dd73442f39e3124d029bd24100139bad8dc1681ea5b9b27197149bd3c51f5898c4c412ce6fdc92d
6
+ metadata.gz: 8540eca5fb3af68b80c8088097027579c034e1daa63642fe91d2c7a84a1ad3fedf5cd89bc4839e4b7dd8b72cde51cf04ec3db5f6197344cd2a00e4b817d3d942
7
+ data.tar.gz: 64e0110d375ceb60492dd0108b0afa1a6145d1e9ea21e4bc3f5e70de6e09c34de6bb8c9c71fb9908a77df0d859c2094fcaaef5cd0dee34dd639bd7873e2f519b
@@ -0,0 +1,54 @@
1
+ require 'stripe'
2
+ module TagoStripe
3
+ class Price
4
+ def initialize
5
+ Stripe.api_key = ENV['STRIPE_SECRET_KEY']
6
+ end
7
+
8
+ def list
9
+ prices = Stripe::Price.list()
10
+ return prices.data
11
+ end
12
+
13
+ def activeList
14
+ prices = Stripe::Price.list({active: true})
15
+ return prices.data
16
+ end
17
+
18
+ def getOne(price_id)
19
+ price = Stripe::Price.retrieve(price_id)
20
+ return price
21
+ end
22
+
23
+ def create(product_id, unit_amount, currency, recurring_interval, recurring_interval_count)
24
+ price = Stripe::Price.create({
25
+ product: product_id,
26
+ unit_amount: unit_amount,
27
+ currency: currency,
28
+ recurring: {
29
+ interval: recurring_interval,
30
+ interval_count: recurring_interval_count
31
+ }
32
+ })
33
+ return price
34
+ end
35
+
36
+ def update(price_id, unit_amount, currency, recurring_interval, recurring_interval_count)
37
+ price = Stripe::Price.update(price_id, {
38
+ unit_amount: unit_amount,
39
+ currency: currency,
40
+ recurring: {
41
+ interval: recurring_interval,
42
+ interval_count: recurring_interval_count
43
+ }
44
+ })
45
+ return price
46
+ end
47
+
48
+ def delete(price_id)
49
+ price = Stripe::Price.delete(price_id)
50
+ return price
51
+ end
52
+
53
+ end
54
+ end
@@ -5,26 +5,22 @@ module TagoStripe
5
5
  Stripe.api_key = ENV['STRIPE_SECRET_KEY']
6
6
  end
7
7
 
8
- def self.getList
9
-
8
+ def self.list
10
9
  products = Stripe::Product.list()
11
10
  return products.data
12
11
  end
13
12
 
14
- def self.getActiveList
15
-
13
+ def self.activeList
16
14
  products = Stripe::Product.list({active: true})
17
15
  return products.data
18
16
  end
19
17
 
20
18
  def self.getOne(product_id)
21
-
22
19
  product = Stripe::Product.retrieve(product_id)
23
20
  return product
24
21
  end
25
22
 
26
- def self.createProduct(name, description, unit_label)
27
-
23
+ def self.create(name, description, unit_label)
28
24
  product = Stripe::Product.create({
29
25
  name: name,
30
26
  description: description,
@@ -33,8 +29,7 @@ module TagoStripe
33
29
  return product
34
30
  end
35
31
 
36
- def self.updateProduct(product_id, name, description, unit_label)
37
-
32
+ def self.update(product_id, name, description, unit_label)
38
33
  product = Stripe::Product.update(product_id, {
39
34
  name: name,
40
35
  description: description,
@@ -43,12 +38,10 @@ module TagoStripe
43
38
  return product
44
39
  end
45
40
 
46
- def self.deleteProduct(product_id)
47
-
41
+ def self.delete(product_id)
48
42
  product = Stripe::Product.delete(product_id)
49
43
  return product
50
44
  end
51
-
52
45
  end
53
46
 
54
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TagoStripe
4
- VERSION = "0.1.0.3"
4
+ VERSION = "0.1.0.5"
5
5
  end
data/lib/TagoStripe.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "TagoStripe/version"
4
4
  require_relative "TagoStripe/Product"
5
+ require_relative "TagoStripe/Price"
5
6
 
6
7
  module TagoStripe
7
8
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TagoStripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.3
4
+ version: 0.1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - manatago
@@ -34,6 +34,7 @@ files:
34
34
  - README.md
35
35
  - Rakefile
36
36
  - lib/TagoStripe.rb
37
+ - lib/TagoStripe/Price.rb
37
38
  - lib/TagoStripe/Product.rb
38
39
  - lib/TagoStripe/version.rb
39
40
  - sig/TagoStripe.rbs