TagoStripe 0.1.0.16 → 0.1.0.18

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: b88b43b1a139ec39d729d355a4b7405155b04d1303ead723374c2b40952bd505
4
- data.tar.gz: 2644a21464f75fa4a104cfc80cff1ba8e95c56cad675e3497e655deb698048b7
3
+ metadata.gz: 29fc309b2093207ce87ada590787f9af9ff81599a31fc9bd0db5d64511f778a5
4
+ data.tar.gz: 9e8d7a7134dbfb20deebe8dd4ad5e3477fe81c5ba9be894cd10acba8599742d2
5
5
  SHA512:
6
- metadata.gz: 1a6945bbe5918bcdfd880792742aa66dcaf6a3b73581e824c6d600d4aa8752fda077b7a253e820fdc4c3cde1fc216df10674bf3419dea4b30cdd41facfce0549
7
- data.tar.gz: b65a2b98d974d20938df0a861fd69f51de78b51ca2330ffcd6a27e391cc288240fea0173f77e649f7034c12adfd28c7c48c991ff47660d8a5f5de85fe534cb6a
6
+ metadata.gz: c4368e5800e8a5cbd59e367fa0e6f3e7bec01f8305783e04366b9276271da8c79900179560ff46b2ad0bd24f9e033a6dfc829553868c84a651ec5c95d9a3e51b
7
+ data.tar.gz: 666031256959086854ca6aa329bdca816ecd1d26ff603e2a70f71f37d4a8f62b7bb28913e87f622d79bd42a4cc7ce373c98aa1b743cfa05464ebda564ffee769
@@ -18,7 +18,6 @@ module TagoStripe
18
18
  end
19
19
 
20
20
 
21
-
22
21
  def self.getOne(payment_link_id)
23
22
  set_api_key
24
23
  payment_link = Stripe::PaymentLink.retrieve(payment_link_id)
@@ -33,6 +32,53 @@ module TagoStripe
33
32
  return payment_link
34
33
  end
35
34
 
35
+
36
+ def self.getOneWithPriceAndProduct(payment_link_id)
37
+ set_api_key
38
+ payment_link = Stripe::PaymentLink.retrieve(payment_link_id)
39
+ payment_link_line_items = Stripe::PaymentLink.list_line_items(payment_link_id)
40
+ payment_link.price = payment_link_line_items.data[0].price
41
+ product = Stripe::Product.retrieve(payment_link.price.product)
42
+ payment_link.product = product
43
+ payment_link
44
+ end
45
+
46
+ def self.listWithPriceAndProduct()
47
+ set_api_key
48
+ payment_links = Stripe::PaymentLink.list()
49
+ result=[]
50
+ payment_links.data.each do |payment_link|
51
+ result.push(getOneWithPriceAndProduct(payment_link.id))
52
+ end
53
+ return result
54
+ end
55
+
56
+
57
+
58
+ def self.list_line_items(payment_link_id)
59
+ set_api_key
60
+ payment_link_line_items = Stripe::PaymentLink.list_line_items(payment_link_id)
61
+ return payment_link_line_items.data
62
+ end
63
+
64
+ def self.list_line_items_by_payment_link(payment_link)
65
+ set_api_key
66
+ payment_link_line_items = Stripe::PaymentLink.list_line_items(payment_link.id)
67
+ return payment_link_line_items.data
68
+ end
69
+
70
+ def self.create(amount, currency, description, payment_method_types)
71
+ set_api_key
72
+ payment_link = Stripe::PaymentLink.create({
73
+ amount: amount,
74
+ currency: currency,
75
+ description: description,
76
+ payment_method_types: payment_method_types
77
+ })
78
+ return payment_link
79
+ end
80
+
81
+
36
82
  def self.create(price_id)
37
83
  set_api_key
38
84
  payment_link = Stripe::PaymentLink.create({
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TagoStripe
4
- VERSION = "0.1.0.16"
4
+ VERSION = "0.1.0.18"
5
5
  end
data/lib/TagoStripe.rb CHANGED
@@ -7,6 +7,7 @@ require_relative "TagoStripe/Customer"
7
7
  require_relative "TagoStripe/Common"
8
8
  require_relative "TagoStripe/Subscription"
9
9
  require_relative "TagoStripe/PaymentLink"
10
+ require_relative "TagoStripe/CheckoutSession"
10
11
 
11
12
 
12
13
  module TagoStripe
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TagoStripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.16
4
+ version: 0.1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - manatago
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-10 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stripe
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.4.1
68
+ rubygems_version: 3.5.22
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: This is for easy use of Stripe API in TagoIO