TagoStripe 0.1.0.1 → 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 +4 -4
- data/lib/TagoStripe/Product.rb +45 -1
- data/lib/TagoStripe/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40a4c77749893e9a84d546e6c308aa421081dd9f4fefdafe5b4c456c621c98ea
|
4
|
+
data.tar.gz: 8bc8a43b4b5c60e5bfda7e9de969ea41e664fbc9184bc70976609670ee8d8b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f7c098b6de322d33cbe8f9af3eb81ccd5f99bfdaa2ae82b7198e1b1ff543373517e95632f5bd6720e2270d90031806cd9a59e389cbf2a9bdec873c72c423ba8
|
7
|
+
data.tar.gz: 9a90c966631735dd69c0d0029d2640a961ed61ed2fa7d09c9dd73442f39e3124d029bd24100139bad8dc1681ea5b9b27197149bd3c51f5898c4c412ce6fdc92d
|
data/lib/TagoStripe/Product.rb
CHANGED
@@ -1,10 +1,54 @@
|
|
1
1
|
require 'stripe'
|
2
2
|
module TagoStripe
|
3
3
|
class Product
|
4
|
-
def
|
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
|
data/lib/TagoStripe/version.rb
CHANGED
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
|