TagoStripe 0.1.0.16 → 0.1.0.17
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/PaymentLink.rb +47 -1
- data/lib/TagoStripe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ae064aac78a05ac8bec6b1bfd3b336f42de325aa4110fe43222eca34e30aaf
|
4
|
+
data.tar.gz: fdb692fca756bc0779db8429ef39634676fb4e4ca216310eeb553f678273a0a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddb7c8c8b9de66fa5bd94dcc74cbc3e236f1f50f7a7af647cb40dd9abe9ec7c61756bfd54b5b4a1dddbbf1c957136f241e4eecf785d1df14519012a93ed0328c
|
7
|
+
data.tar.gz: 0b59483838d200838e414a9ab5fd2b9d7f543705bd5603ac2ecc3d8ef4cb632973170afb39e3cdec70e190176f40946149ddf7fba1347c3f01428efa241ecaea
|
@@ -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({
|
data/lib/TagoStripe/version.rb
CHANGED