invoicing_payments_processing 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bufferpaypalnotification.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05607ccf6270087041f4204da5d1175f4cbb69ad
|
4
|
+
data.tar.gz: 178616b62e1baf3a71a768f03050219f28dcc019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59d53d7c5420dd4b7faefa1cc9e97a53672d46fd9520e9403026487577bab9dff54bd1341a2f5910e1d9f0096d87e197945bb9b7649e6516c5e71643055d8f99
|
7
|
+
data.tar.gz: 394faf0fa9d17fd5a317505077923f25eb426e4c13be69334fc65b52568faa2ca32a77ab4b5c184c3b76423c1eeba67acec75950e2554856ccc0282a5768ae8f
|
@@ -363,6 +363,19 @@ module BlackStack
|
|
363
363
|
raise 'Invoice already exists.'
|
364
364
|
end
|
365
365
|
|
366
|
+
# obtengo la ultima factura pagada, vinculada a un IPN con el mismo codigo invoice
|
367
|
+
row = DB[
|
368
|
+
"SELECT TOP 1 i.id " +
|
369
|
+
"FROM buffer_paypal_notification b " +
|
370
|
+
"JOIN invoice i ON ( b.id=i.id_buffer_paypal_notification AND i.status=#{BlackStack::Invoice::STATUS_PAID.to_s} ) " +
|
371
|
+
"WHERE b.invoice='#{b.invoice}' " +
|
372
|
+
"ORDER BY i.create_time DESC "
|
373
|
+
].first
|
374
|
+
if row.nil?
|
375
|
+
raise 'Previous Paid Invoice not found.'
|
376
|
+
end
|
377
|
+
k = BlackStack::Invoice.where(:id=>row[:id]).first
|
378
|
+
|
366
379
|
# creo la factura por el reembolso
|
367
380
|
i = BlackStack::Invoice.new()
|
368
381
|
i.id = guid()
|
@@ -378,7 +391,7 @@ module BlackStack
|
|
378
391
|
i.save()
|
379
392
|
|
380
393
|
# parseo el reeembolso - creo el registro contable
|
381
|
-
i.setup_refund(payment_gross,
|
394
|
+
i.setup_refund(payment_gross, k.id)
|
382
395
|
|
383
396
|
end
|
384
397
|
else
|