TagoStripe 0.1.0 → 0.1.0.3

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: 2e5ab8de71cb4308fedb8916866d3aec214b5ba520c71b9cbfada39ce3c16a3b
4
- data.tar.gz: 55e1df0a78ad65f0e5cffc05a6b555edf2b8981b2864d74a8b29dec612f1e281
3
+ metadata.gz: 40a4c77749893e9a84d546e6c308aa421081dd9f4fefdafe5b4c456c621c98ea
4
+ data.tar.gz: 8bc8a43b4b5c60e5bfda7e9de969ea41e664fbc9184bc70976609670ee8d8b9f
5
5
  SHA512:
6
- metadata.gz: 4a50b0770e08e40695e25b5a3ee367ddb14a4c7e9ceb5aee7d2236ef65e8c8d547a436e4fa0249779836d09422a7b285cd5606aaad384f4239b827cf73ad5249
7
- data.tar.gz: 3c2e6dcf306714ee3d0bf75e5a860e628a01069c89042fff4f1eb8b02d6818cb1a9082bd6838cb103dc53b86f41c933ec448ac67459ea7f837e8f286c38618ad
6
+ metadata.gz: 2f7c098b6de322d33cbe8f9af3eb81ccd5f99bfdaa2ae82b7198e1b1ff543373517e95632f5bd6720e2270d90031806cd9a59e389cbf2a9bdec873c72c423ba8
7
+ data.tar.gz: 9a90c966631735dd69c0d0029d2640a961ed61ed2fa7d09c9dd73442f39e3124d029bd24100139bad8dc1681ea5b9b27197149bd3c51f5898c4c412ce6fdc92d
@@ -1,10 +1,54 @@
1
1
  require 'stripe'
2
2
  module TagoStripe
3
3
  class Product
4
- def getList
4
+ def initialize
5
5
  Stripe.api_key = ENV['STRIPE_SECRET_KEY']
6
+ end
7
+
8
+ def self.getList
9
+
6
10
  products = Stripe::Product.list()
11
+ return products.data
12
+ end
13
+
14
+ def self.getActiveList
15
+
16
+ products = Stripe::Product.list({active: true})
17
+ return products.data
18
+ end
19
+
20
+ def self.getOne(product_id)
21
+
22
+ product = Stripe::Product.retrieve(product_id)
23
+ return product
24
+ end
25
+
26
+ def self.createProduct(name, description, unit_label)
27
+
28
+ product = Stripe::Product.create({
29
+ name: name,
30
+ description: description,
31
+ unit_label: unit_label
32
+ })
33
+ return product
34
+ end
35
+
36
+ def self.updateProduct(product_id, name, description, unit_label)
37
+
38
+ product = Stripe::Product.update(product_id, {
39
+ name: name,
40
+ description: description,
41
+ unit_label: unit_label
42
+ })
43
+ return product
44
+ end
45
+
46
+ def self.deleteProduct(product_id)
47
+
48
+ product = Stripe::Product.delete(product_id)
49
+ return product
7
50
  end
51
+
8
52
  end
9
53
 
10
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TagoStripe
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.0.3"
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
4
+ version: 0.1.0.3
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