TagoStripe 0.1.0.13 → 0.1.0.14

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: c93acbac2ac0658f6d1fb883b866c7b78a9ecab5f50b7dd2e5dea98cdd082fb1
4
- data.tar.gz: 5683facf260b89601395a35cae578c30cd6de93096e152cb1e0e6b9158e388d1
3
+ metadata.gz: 346feb0acf857c722a065cec46de3e918b169ab53f45d0262b553978c2d898c6
4
+ data.tar.gz: 6147040b3900b90d64aa8c69587601ecde1a162049385fd296c67ff8e7701fa6
5
5
  SHA512:
6
- metadata.gz: 493c37c63d57a8a796f33c1a6587f3e3a2959688be156023829f890cf4403fa1f42976f894e3104432976fddf03985fbf0e11545eea6e94a8b2fb667c9a1717a
7
- data.tar.gz: 0e0c1ce7c5d5a040a4209127cde0ad8df516685671814bdb1e4365fa23b34d4edec7f96a3a242cf6e44353b33f3e3e97c1881fa71777a36ba0cb7a0eb57380eb
6
+ metadata.gz: e3ff097a44872c3abc98bd5a437af89980b78505e2b3ce33206fa14a91f5e88f7ad3e30f153269dfb8037b4ae5b1bdddac6d642ab1231765bd52f16f13a8acf6
7
+ data.tar.gz: 0312350a28fe2220e18ebf10ede4878a12426dc5cdfa63de8f38843c35ce77b3837697fc4a594368f562e6e6542cc8b09285207bf8d97775c7bc916395e54aae
@@ -0,0 +1,51 @@
1
+ require 'stripe'
2
+ module TagoStripe
3
+ class PaymentLink
4
+ def self.set_api_key
5
+ Stripe.api_key = ENV['STRIPE_SECRET_KEY']
6
+ end
7
+
8
+ def self.list
9
+ set_api_key
10
+ payment_links = Stripe::PaymentLink.list()
11
+ return payment_links.data
12
+ end
13
+
14
+ def self.getOne(payment_link_id)
15
+ set_api_key
16
+ payment_link = Stripe::PaymentLink.retrieve(payment_link_id)
17
+ return payment_link
18
+ end
19
+
20
+ def self.create(price_id)
21
+ set_api_key
22
+ payment_link = Stripe::PaymentLink.create({
23
+ line_items: [
24
+ {
25
+ price: price_id,
26
+ quantity: 1,
27
+ },
28
+ ],
29
+ })
30
+ return payment_link
31
+ end
32
+
33
+ def self.update(payment_link_id, amount, currency, description, payment_method_types)
34
+ set_api_key
35
+ payment_link = Stripe::PaymentLink.update(payment_link_id, {
36
+ amount: amount,
37
+ currency: currency,
38
+ description: description,
39
+ payment_method_types: payment_method_types
40
+ })
41
+ return payment_link
42
+ end
43
+
44
+ def self.delete(payment_link_id)
45
+ set_api_key
46
+ payment_link = Stripe::PaymentLink.delete(payment_link_id)
47
+ return payment_link
48
+ end
49
+
50
+ end
51
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TagoStripe
4
- VERSION = "0.1.0.13"
4
+ VERSION = "0.1.0.14"
5
5
  end
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.13
4
+ version: 0.1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - manatago
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stripe
@@ -37,6 +37,7 @@ files:
37
37
  - lib/TagoStripe/CheckoutSession.rb
38
38
  - lib/TagoStripe/Common.rb
39
39
  - lib/TagoStripe/Customer.rb
40
+ - lib/TagoStripe/PaymentLink.rb
40
41
  - lib/TagoStripe/Price.rb
41
42
  - lib/TagoStripe/Product.rb
42
43
  - lib/TagoStripe/Subscription.rb