TagoStripe 0.1.0.1 → 0.1.0.4

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: c4c7aec4acdf80ad794e30daa469b73c9b802b0264b1d4ac0b7f04ce4b553a92
4
- data.tar.gz: 3984c71cc512d203e86e70237013e41718046fd9a414ef22cab8477dec7fdf42
3
+ metadata.gz: fe5900bc105d04d9d943377548744093e0741a244a4e1d1e941e9e3a4fe5dd89
4
+ data.tar.gz: 3797d072926c37cefaca56966890c808171366df6909e9952a395173f9cc38ca
5
5
  SHA512:
6
- metadata.gz: c65ac8aeffed2c8f869a6be32e0aafd3fbc2e693a5e1313fb676dbede0aa4a190577c0a0ecf65684b62ebc5144233fba7e0d9383234f771b37e9b1224e5e34e1
7
- data.tar.gz: fd5c0ab264093ee03c321c91e36714da9d3a3da3045f7bb955840d484068d4e6a4e35250f62ad68d780c48f849260bfcd7c5ba3f76500faf2336bd994abdea9d
6
+ metadata.gz: 042a11dbb5f3884acf89b37e06ad8dd36558dce0acf048f01c9ecaab91c0f3f808eb46c97d4112f9c61d01e17755815c2e9a96322e79f80da4bf80a341fa27d8
7
+ data.tar.gz: 9f8a045ba2f811fa6b4b3a9ea9ae3237393e79d267bbe69451decb4d61e0eb14d0e7d9cb489bd78241bf0f221c2c70c8a1fd344472519b8a6b13e5f5381c8b71
@@ -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
@@ -1,9 +1,46 @@
1
1
  require 'stripe'
2
2
  module TagoStripe
3
3
  class Product
4
- def self.getList
4
+ def initialize
5
5
  Stripe.api_key = ENV['STRIPE_SECRET_KEY']
6
+ end
7
+
8
+ def self.list
6
9
  products = Stripe::Product.list()
10
+ return products.data
11
+ end
12
+
13
+ def self.activeList
14
+ products = Stripe::Product.list({active: true})
15
+ return products.data
16
+ end
17
+
18
+ def self.getOne(product_id)
19
+ product = Stripe::Product.retrieve(product_id)
20
+ return product
21
+ end
22
+
23
+ def self.create(name, description, unit_label)
24
+ product = Stripe::Product.create({
25
+ name: name,
26
+ description: description,
27
+ unit_label: unit_label
28
+ })
29
+ return product
30
+ end
31
+
32
+ def self.update(product_id, name, description, unit_label)
33
+ product = Stripe::Product.update(product_id, {
34
+ name: name,
35
+ description: description,
36
+ unit_label: unit_label
37
+ })
38
+ return product
39
+ end
40
+
41
+ def self.delete(product_id)
42
+ product = Stripe::Product.delete(product_id)
43
+ return product
7
44
  end
8
45
  end
9
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TagoStripe
4
- VERSION = "0.1.0.1"
4
+ VERSION = "0.1.0.4"
5
5
  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.1
4
+ version: 0.1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - manatago
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2024-07-22 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: stripe
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: This is for easy use of Stripe API in TagoIO
14
28
  email:
15
29
  - satoshi@tagomori.biz
@@ -20,6 +34,7 @@ files:
20
34
  - README.md
21
35
  - Rakefile
22
36
  - lib/TagoStripe.rb
37
+ - lib/TagoStripe/Price.rb
23
38
  - lib/TagoStripe/Product.rb
24
39
  - lib/TagoStripe/version.rb
25
40
  - sig/TagoStripe.rbs