TagoStripe 0.1.0.5 → 0.1.0.7
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/Common.rb +12 -0
- data/lib/TagoStripe/Customer.rb +42 -0
- data/lib/TagoStripe/Price.rb +6 -6
- data/lib/TagoStripe/Product.rb +2 -1
- data/lib/TagoStripe/version.rb +1 -1
- data/lib/TagoStripe.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1dc2bf5b78b9d3a24d16a813e1050121cb09edd568ff0d9ca934c1fb7412298
|
4
|
+
data.tar.gz: 4b588967358b116efe46ae7fb23511d07868c3b3c5d5677096be4c9b77739cd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105d1560076acc93cdf4448038c077874465670fdea73b7de0fbcee1ca81fb5b40d7614413843302ca5d270bda919503e745f0ed6c3eeb068db7f71175c6c8c4
|
7
|
+
data.tar.gz: dbf3bdb3916c86c4d0f0e640a4e8b7d1ee40224118528025dd3b68d93821e51d4cf4d8e59c1c347113ae4c237357d8c913f1cb0ebc6301583cce5904ed7baf91
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'stripe'
|
2
|
+
module TagoStripe
|
3
|
+
class Customer
|
4
|
+
def initialize
|
5
|
+
Stripe.api_key = ENV['STRIPE_SECRET_KEY']
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.list
|
9
|
+
customers = Stripe::Customer.list()
|
10
|
+
return customers.data
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.getOne(customer_id)
|
14
|
+
customer = Stripe::Customer.retrieve(customer_id)
|
15
|
+
return customer
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.create(email, name , metaData={})
|
19
|
+
customer = Stripe::Customer.create({
|
20
|
+
email: email,
|
21
|
+
name: name,
|
22
|
+
metadata: metaData
|
23
|
+
})
|
24
|
+
return customer
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.update(customer_id, email, name, metaData={})
|
28
|
+
customer = Stripe::Customer.update(customer_id, {
|
29
|
+
email: email,
|
30
|
+
name: name,
|
31
|
+
metadata: metaData
|
32
|
+
})
|
33
|
+
return customer
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.delete(customer_id)
|
37
|
+
customer = Stripe::Customer.delete(customer_id)
|
38
|
+
return customer
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
data/lib/TagoStripe/Price.rb
CHANGED
@@ -5,22 +5,22 @@ module TagoStripe
|
|
5
5
|
Stripe.api_key = ENV['STRIPE_SECRET_KEY']
|
6
6
|
end
|
7
7
|
|
8
|
-
def list
|
8
|
+
def self.list
|
9
9
|
prices = Stripe::Price.list()
|
10
10
|
return prices.data
|
11
11
|
end
|
12
12
|
|
13
|
-
def activeList
|
13
|
+
def self.activeList
|
14
14
|
prices = Stripe::Price.list({active: true})
|
15
15
|
return prices.data
|
16
16
|
end
|
17
17
|
|
18
|
-
def getOne(price_id)
|
18
|
+
def self.getOne(price_id)
|
19
19
|
price = Stripe::Price.retrieve(price_id)
|
20
20
|
return price
|
21
21
|
end
|
22
22
|
|
23
|
-
def create(product_id, unit_amount, currency, recurring_interval, recurring_interval_count)
|
23
|
+
def self.create(product_id, unit_amount, currency, recurring_interval, recurring_interval_count)
|
24
24
|
price = Stripe::Price.create({
|
25
25
|
product: product_id,
|
26
26
|
unit_amount: unit_amount,
|
@@ -33,7 +33,7 @@ module TagoStripe
|
|
33
33
|
return price
|
34
34
|
end
|
35
35
|
|
36
|
-
def update(price_id, unit_amount, currency, recurring_interval, recurring_interval_count)
|
36
|
+
def self.update(price_id, unit_amount, currency, recurring_interval, recurring_interval_count)
|
37
37
|
price = Stripe::Price.update(price_id, {
|
38
38
|
unit_amount: unit_amount,
|
39
39
|
currency: currency,
|
@@ -45,7 +45,7 @@ module TagoStripe
|
|
45
45
|
return price
|
46
46
|
end
|
47
47
|
|
48
|
-
def delete(price_id)
|
48
|
+
def self.delete(price_id)
|
49
49
|
price = Stripe::Price.delete(price_id)
|
50
50
|
return price
|
51
51
|
end
|
data/lib/TagoStripe/Product.rb
CHANGED
data/lib/TagoStripe/version.rb
CHANGED
data/lib/TagoStripe.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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- manatago
|
@@ -34,6 +34,8 @@ files:
|
|
34
34
|
- README.md
|
35
35
|
- Rakefile
|
36
36
|
- lib/TagoStripe.rb
|
37
|
+
- lib/TagoStripe/Common.rb
|
38
|
+
- lib/TagoStripe/Customer.rb
|
37
39
|
- lib/TagoStripe/Price.rb
|
38
40
|
- lib/TagoStripe/Product.rb
|
39
41
|
- lib/TagoStripe/version.rb
|