invoicing_payments_processing 1.1.52 → 1.1.58
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/balance.rb +15 -8
- data/lib/bufferpaypalnotification.rb +1 -1
- data/lib/invoice.rb +1 -1
- data/lib/invoicing_payments_processing.rb +16 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffa569d58e22432b0ad9f214a6e83faef4f424c0
|
4
|
+
data.tar.gz: 2dc2ab0fc91b4b7350985678eefb3865bbba9e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd78f088152e5373a9eff70f66d7ab5629dd290349e84e8d9aa7c91ebb0ad3530ab2c97efda541ad0c56de463b932f05fa9f3f9f6f2231009779fe83ac940b7
|
7
|
+
data.tar.gz: 20252301b10406afce4d398ebf1e5bcd9965b985b84afcbd5be6b98519661ad97d7e42bdf9aeebbefa66845babd6197e56f3b4102aa94d66904329beae5acb5f
|
data/lib/balance.rb
CHANGED
@@ -10,14 +10,21 @@ module BlackStack
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def calculate()
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
if !self.up_time.nil?
|
14
|
+
q =
|
15
|
+
"select cast(sum(cast(amount as numeric(18,12))) as numeric(18,6)) as amount, sum(credits) as credits " +
|
16
|
+
"from movement with (nolock) " +
|
17
|
+
"where id_client='#{self.client.id}' " +
|
18
|
+
"and product_code='#{self.product_code}' " +
|
19
|
+
"and create_time < '#{self.up_time.to_time.to_sql}' "
|
20
|
+
else
|
21
|
+
q =
|
22
|
+
"select cast(sum(cast(amount as numeric(18,12))) as numeric(18,6)) as amount, sum(credits) as credits " +
|
23
|
+
"from stat_balance x with (nolock) " +
|
24
|
+
"where x.id_client='#{self.client.id}' " +
|
25
|
+
"and x.product_code='#{self.product_code}' "
|
26
|
+
end
|
27
|
+
|
21
28
|
row = DB[q].first
|
22
29
|
self.amount = row[:amount].to_f
|
23
30
|
self.credits = row[:credits].to_f
|
@@ -403,7 +403,7 @@ puts "self.invoice:#{self.invoice.to_s}:."
|
|
403
403
|
"SELECT TOP 1 i.id " +
|
404
404
|
"FROM buffer_paypal_notification b " +
|
405
405
|
"JOIN invoice i ON ( b.id=i.id_buffer_paypal_notification AND i.status=#{BlackStack::Invoice::STATUS_PAID.to_s} ) " +
|
406
|
-
"WHERE b.invoice='#{b.invoice
|
406
|
+
"WHERE b.invoice='#{b.invoice}' " +
|
407
407
|
"ORDER BY i.create_time DESC "
|
408
408
|
].first
|
409
409
|
if row.nil?
|
data/lib/invoice.rb
CHANGED
@@ -246,7 +246,7 @@ module BlackStack
|
|
246
246
|
end
|
247
247
|
|
248
248
|
# return url
|
249
|
-
"#{BlackStack::InvoicingPaymentsProcessing::
|
249
|
+
"#{BlackStack::InvoicingPaymentsProcessing::paypal_orders_url}/cgi-bin/webscr?" + URI.encode_www_form(values)
|
250
250
|
end
|
251
251
|
|
252
252
|
# retorna true si el estado de la factura sea NULL o UNPAID
|
@@ -13,10 +13,19 @@ module BlackStack
|
|
13
13
|
|
14
14
|
# static attributes
|
15
15
|
@@paypal_business_email = "sardi.leandro.daniel@gmail.com"
|
16
|
+
@@paypal_orders_url = BlackStack::InvoicingPaymentsProcessing::PAYPAL_ORDERS_URL
|
17
|
+
@@paypal_ipn_listener = "#{BlackStack::Pampa::api_url.to_s}/api1.3/accounting/paypal/notify_new_invoice.json"
|
18
|
+
|
16
19
|
@@products_descriptor = []
|
17
20
|
@@plans_descriptor = []
|
18
|
-
|
21
|
+
|
19
22
|
# getters & setters
|
23
|
+
def self.set_config(h)
|
24
|
+
@@paypal_business_email = h[:paypal_business_email]
|
25
|
+
@@paypal_orders_url = h[:paypal_orders_url]
|
26
|
+
@@paypal_ipn_listener = h[:paypal_ipn_listener]
|
27
|
+
end
|
28
|
+
|
20
29
|
def self.set_paypal_business_email(email)
|
21
30
|
@@paypal_business_email = email
|
22
31
|
end # def self.set_paypal_business_email
|
@@ -25,10 +34,14 @@ module BlackStack
|
|
25
34
|
@@paypal_business_email
|
26
35
|
end # def self.set_paypal_business_email
|
27
36
|
|
28
|
-
def self.
|
29
|
-
|
37
|
+
def self.paypal_orders_url()
|
38
|
+
@@paypal_orders_url
|
30
39
|
end
|
31
40
|
|
41
|
+
def self.paypal_ipn_listener()
|
42
|
+
@@paypal_ipn_listener
|
43
|
+
end
|
44
|
+
|
32
45
|
|
33
46
|
def self.set_products(h)
|
34
47
|
@@products_descriptor = h
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoicing_payments_processing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.58
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket
|