Why do I get a blank page on my shop after paying with Paypal? - paypal

When I make the payment with PayPal on my website prestashop, after Checkout Payment, the page turns white and stop working instead of come back to validate page of PayPal where we can find the opportunity to return to the store with the number of transaction and a confirmation message like "Payment Completed"
so I decided to reload the white page, and it came back to my website and it told me :
"Error occured : Merci de vous reférer aux logs :
1. PayPal response:
2. CHECKOUTSTATUS -> PaymentActionCompleted
3. TIMESTAMP -> 2012-12-08T22:35:15Z
4. EMAIL -> thomaslacroix149#me.com
5. PAYERID -> 6E5PYX5CHP6N6
6. PAYERSTATUS -> verified
7. FIRSTNAME -> Thomas
8. LASTNAME -> Lacroix
9. COUNTRYCODE -> FR
10. SHIPTONAME -> Thomas Lacroix
11. SHIPTOSTREET -> 5 Rue St Hermentaire
12. SHIPTOCITY -> Martigues
13. SHIPTOZIP -> 13500
14. SHIPTOCOUNTRYCODE -> FR
15. SHIPTOCOUNTRYNAME -> France
16. ADDRESSSTATUS -> Unconfirmed
17. CURRENCYCODE -> EUR
18. AMT -> 1.01
19. ITEMAMT -> 0.01
20. SHIPPINGAMT -> 1.00
21. HANDLINGAMT -> 0.00
22. TAXAMT -> 0.00
23. INSURANCEAMT -> 0.00
24. SHIPDISCAMT -> 0.00
25. L_NAME0 -> Divers
26. L_NUMBER0 -> 201
27. L_QTY0 -> 1
28. L_TAXAMT0 -> 0.00
29. L_AMT0 -> 0.01
30. L_DESC0 -> ...
31. L_ITEMWEIGHTVALUE0 -> 0.00000
32. L_ITEMLENGTHVALUE0 -> 0.00000
33. L_ITEMWIDTHVALUE0 -> 0.00000
34. L_ITEMHEIGHTVALUE0 -> 0.00000
35. PAYMENTREQUEST_0_CURRENCYCODE -> EUR
36. PAYMENTREQUEST_0_AMT -> 1.01
37. PAYMENTREQUEST_0_ITEMAMT -> 0.01
38. PAYMENTREQUEST_0_SHIPPINGAMT -> 1.00
39. PAYMENTREQUEST_0_HANDLINGAMT -> 0.00
40. PAYMENTREQUEST_0_TAXAMT -> 0.00
41. PAYMENTREQUEST_0_INSURANCEAMT -> 0.00
42. PAYMENTREQUEST_0_SHIPDISCAMT -> 0.00
43. PAYMENTREQUEST_0_TRANSACTIONID -> 2B4648015B651205G
44. PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED -> false
45. PAYMENTREQUEST_0_SHIPTONAME -> Thomas Lacroix
46. PAYMENTREQUEST_0_SHIPTOSTREET -> 5 Rue St Hermentaire
47. PAYMENTREQUEST_0_SHIPTOCITY -> Martigues
48. PAYMENTREQUEST_0_SHIPTOZIP -> 13500
49. PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE -> FR
50. PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME -> France
51. PAYMENTREQUEST_0_ADDRESSSTATUS -> Unconfirmed
52. L_PAYMENTREQUEST_0_NAME0 -> Divers
53. L_PAYMENTREQUEST_0_NUMBER0 -> 201
54. L_PAYMENTREQUEST_0_QTY0 -> 1
55. L_PAYMENTREQUEST_0_TAXAMT0 -> 0.00
56. L_PAYMENTREQUEST_0_AMT0 -> 0.01
57. L_PAYMENTREQUEST_0_DESC0 -> ...
58. L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0 -> 0.00000
59. L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0 -> 0.00000
60. L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0 -> 0.00000
61. L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0 -> 0.00000
62. PAYMENTREQUESTINFO_0_TRANSACTIONID -> 2B4648015B651205G
63. PAYMENTREQUESTINFO_0_ERRORCODE -> 0
64. Cart changed since the last checkout express, please make a new Paypal checkout payment
So I couldn't complete the payment method.
Does anyone know how to solve this problem?

There are two known issues related to this.
You need to add 755 rights on modules/paypal directory.
Maybe the tools/tcpdf/tcpdf.php file is corrupted and you need to get a new version of it (you can get it by downloading a fresh install of Prestashop).

Related

ESP32 kernel panic at random (network_event)

I'm working with an ESP at the moment and I have written alot of code that works on it's own, but once merged, it doesn't.
My code boots, but then I get the following;
09:00:18.780 -> Device is now in pay-mode
09:00:18.780 -> ETH Started
09:00:22.779 -> ETH Connected
09:00:22.812 -> ETH MAC: 3C:61:05:30:A9:7F, IPv4: 192.168.207.102, FULL_DUPLEX, 100Mbps
09:00:22.812 -> Registering Device
09:00:22.812 -> Just the main loop
09:00:23.798 -> Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception)
09:00:23.798 -> Debug exception reason: Stack canary watchpoint triggered (network_event)
09:00:23.832 -> Core 1 register dump:
09:00:23.832 -> PC : 0x4011ee2b PS : 0x00060e36 A0 : 0x801120df A1 : 0x3ffb8630
09:00:23.832 -> A2 : 0x3ffb8ca4 A3 : 0x3ffb8ca4 A4 : 0x3ffbc668 A5 : 0x3ffbc65c
09:00:23.832 -> A6 : 0x3ffbc6bc A7 : 0x00000000 A8 : 0xb9e3b68c A9 : 0x00000040
09:00:23.832 -> A10 : 0x7b8a813d A11 : 0x3ffbd650 A12 : 0x3ffb8ca4 A13 : 0x3ffd8ca4
09:00:23.866 -> A14 : 0x5d484383 A15 : 0x37ac32fc SAR : 0x00000010 EXCCAUSE: 0x00000001
09:00:23.866 -> EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0x00000000
09:00:23.866 ->
09:00:23.866 -> ELF file SHA256: 0000000000000000
09:00:23.866 ->
09:00:23.866 -> Backtrace: 0x4011ee2b:0x3ffb8630 0x401120dc:0x3ffb8ca0 0x40113175:0x3ffb8cd0 0x4011321b:0x3ffb8d00 0x40121b15:0x3ffb8d30 0x401115ff:0x3ffb8d70 0x401278e8:0x3ffb8d90 0x4012803b:0x3ffb8e20 0x401145f5:0x3ffb8e40 0x40114635:0x3ffb8e60 0x400d4871:0x3ffb8e80 0x400d426b:0x3ffb9100 0x400d4371:0x3ffb9130 0x400d2745:0x3ffb9150 0x400d2ad3:0x3ffb9400 0x400d396a:0x3ffb9470 0x400d3a74:0x3ffb9560 0x40089996:0x3ffb9590
09:00:23.899 ->
09:00:23.899 -> Rebooting...
I have no idea what is going on here, or why I'm getting this error. after a couple of minutes, the main loop just runs (so I get the whole time "Just the main loop" in my console.
I'm using an ETH module and I do some API calls. Can this be that the ESP looses power or doesn't get enough power or so? I'm kinda at a loss why I'm getting this error.
The line "Stack canary watchpoint triggered (network_event)" is your cue. It means the stack overrun detection triggered. One of the tasks (named "network_event") has used more stack that it's been allocated. Give it more.

How to setup I2C on NodeMCU?

I'm trying to get a LIDAR-Sensor (VL53L1X) working. I connected the Clk-Pin and the SDA-Pin to my Arduino. Then I run the example script (this one). This worked perfectly fine. Then I tried this on my NodeMCU. I connected D1 with CLK and D2 with SDA. I added the Pins in the Wire.begin() line:
Wire.begin(D2, D1);
Now I got this error message:
19:36:40.889 -> load 0x4010f000, len 1384, room 16
19:36:40.889 -> tail 8
19:36:40.889 -> chksum 0x2d
19:36:40.889 -> csum 0x2d
19:36:40.889 -> v8b899c12
19:36:40.889 -> ~ld
19:36:40.957 -> Failed to detect and initialize sensor!
What I'm doing wrong?
I found out that my NodeMCU was broken

Using rpy2 in Jupyter/IPython run_line_magic error

In the IPython and Jupyter documentation it says that get_ipython().magic() is deprecated. But when I changed my code to use run_line_magic it is failing to push to R (see below). Might be related to this problem
https://bitbucket.org/rpy2/rpy2/issues/184/valueerror-call-stack-is-not-deep-enough
I'm on Mac Yosemite, using Anaconda with Python 2.7. I just updated both Anaconda and rpy2 yesterday. The code below is from a Jupyter notebook.
%load_ext rpy2.ipython
import pandas as pd
'''Two test functions with rpy2.
The only difference between them is that
rpy2fun_magic uses 'magic' to push variable to R and
rpy2fun_linemagic uses 'run_line_magic' to push variable.
'magic' works fine. 'run_line_magic' returns an error.'''
def rpy2fun_magic(df):
get_ipython().magic('R -i df')
get_ipython().run_line_magic('R','df_cor <- cor(df)')
get_ipython().run_line_magic('R','-o df_cor')
return (df_cor)
def rpy2fun_linemagic(df):
get_ipython().run_line_magic('R','-i df')
get_ipython().run_line_magic('R','df_cor <- cor(df)')
get_ipython().run_line_magic('R','-o df_cor')
return (df_cor)
dataframetest = pd.DataFrame([[1,2,3,4],[6,3,4,5],[9,1,7,3]])
df_cor_magic = rpy2fun_magic(dataframetest)
print 'Using magic to push variable works fine\n'
print df_cor_magic
print '\nBut using run_line_magic returns an error\n'
df_cor_linemagic = rpy2fun_linemagic(dataframetest)
Using magic to push variable works fine
[[ 1. -0.37115374 0.91129318 -0.37115374]
[-0.37115374 1. -0.72057669 1. ]
[ 0.91129318 -0.72057669 1. -0.72057669]
[-0.37115374 1. -0.72057669 1. ]]
But using run_line_magic returns an error
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-e418b72a8621> in <module>()
28 print '\nBut using run_line_magic returns an error\n'
29
---> 30 df_cor_linemagic = rpy2fun_linemagic(dataframetest)
<ipython-input-1-e418b72a8621> in rpy2fun_linemagic(df)
15
16 def rpy2fun_linemagic(df):
---> 17 get_ipython().run_line_magic('R','-i df')
18 get_ipython().run_line_magic('R','df_cor <- cor(df)')
19 get_ipython().run_line_magic('R','-o df_cor')
/Users/alexmillner/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2255 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2256 with self.builtin_trap:
-> 2257 result = fn(*args,**kwargs)
2258 return result
2259
/Users/alexmillner/anaconda/lib/python2.7/site-packages/rpy2/ipython/rmagic.pyc in R(self, line, cell, local_ns)
/Users/alexmillner/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/Users/alexmillner/anaconda/lib/python2.7/site-packages/rpy2/ipython/rmagic.pyc in R(self, line, cell, local_ns)
657 val = self.shell.user_ns[input]
658 except KeyError:
--> 659 raise NameError("name '%s' is not defined" % input)
660 if args.converter is None:
661 ro.r.assign(input, self.pyconverter(val))
NameError: name 'df' is not defined
Some discussion of the same issue with %timeit first, followed by workaround answers at the bottom. I'm using IPython 3.1.0 with Anaconda 2.7.10, so my observations below could be different based on version differences alone.
This is not unique to the R extension, you can reproduce this with something simpler like %timeit:
In [47]: dfrm
Out[47]:
A B C
0 0.690466 0.370793 0.963782
1 0.478427 0.358897 0.689173
2 0.189277 0.268237 0.570624
3 0.735665 0.342549 0.509810
4 0.929736 0.090079 0.384444
5 0.210941 0.347164 0.852408
6 0.241940 0.187266 0.961489
7 0.768143 0.548450 0.604004
8 0.055765 0.842224 0.668782
9 0.717827 0.047011 0.948673
In [48]: def run_timeit(df):
get_ipython().run_line_magic('timeit', 'df.sum()')
....:
In [49]: run_timeit(dfrm)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-49-1e62302232b6> in <module>()
----> 1 run_timeit(dfrm)
<ipython-input-48-0a3e09ec1e0c> in run_timeit(df)
1 def run_timeit(df):
----> 2 get_ipython().run_line_magic('timeit', 'df.sum()')
3
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2226 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2227 with self.builtin_trap:
-> 2228 result = fn(*args,**kwargs)
2229 return result
2230
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, line, cell)
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, line, cell)
1034 number = 1
1035 for _ in range(1, 10):
-> 1036 time_number = timer.timeit(number)
1037 worst_tuning = max(worst_tuning, time_number / number)
1038 if time_number >= 0.2:
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, number)
130 gc.disable()
131 try:
--> 132 timing = self.inner(it, self.timer)
133 finally:
134 if gcold:
<magic-timeit> in inner(_it, _timer)
NameError: global name 'df' is not defined
The issue is that the line magics are set to look for variable names at global scope, not at function scope. If the argument to your function rpy2fun_linemagic happened to coincide with a global variable name, the interior code would pick that up, for example:
In [52]: def run_timeit(dfrm):
get_ipython().run_line_magic('timeit', 'dfrm.sum()')
....:
In [53]: run_timeit(dfrm)
The slowest run took 5.67 times longer than the fastest. This could mean that an intermediate result is being cached
10000 loops, best of 3: 99.1 µs per loop
But this only works by accident, because the interior string passed to run_line_magic contains a name that is found globally.
However, I do get the same error even if using the plain magic function:
In [58]: def run_timeit(df):
get_ipython().magic('timeit df.sum()')
....:
In [59]: run_timeit(dfrm)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-59-1e62302232b6> in <module>()
----> 1 run_timeit(dfrm)
<ipython-input-58-e98c720ea7e8> in run_timeit(df)
1 def run_timeit(df):
----> 2 get_ipython().magic('timeit df.sum()')
3
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2305 magic_name, _, magic_arg_s = arg_s.partition(' ')
2306 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2307 return self.run_line_magic(magic_name, magic_arg_s)
2308
2309 #-------------------------------------------------------------------------
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2226 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2227 with self.builtin_trap:
-> 2228 result = fn(*args,**kwargs)
2229 return result
2230
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, line, cell)
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, line, cell)
1034 number = 1
1035 for _ in range(1, 10):
-> 1036 time_number = timer.timeit(number)
1037 worst_tuning = max(worst_tuning, time_number / number)
1038 if time_number >= 0.2:
/home/ely/anaconda/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, number)
130 gc.disable()
131 try:
--> 132 timing = self.inner(it, self.timer)
133 finally:
134 if gcold:
<magic-timeit> in inner(_it, _timer)
NameError: global name 'df' is not defined
One (super bad) way to get around this is to use globals to locate the item that is the same as the argument that was passed to your function, and then you'll have a global name for it.
For example:
In [68]: def run_timeit(df):
for var_name, var_val in globals().iteritems():
if df is var_val:
get_ipython().run_line_magic('timeit', '%s.sum()'%(var_name))
break
....:
In [69]: run_timeit(dfrm)
The slowest run took 5.72 times longer than the fastest. This could mean that an intermediate result is being cached
10000 loops, best of 3: 99.2 µs per loop
But this is very unstable, since it relies on pass-by-name in Python. If I passed an object like an integer or string, I would have to check whether it was interned or something, but otherwise couldn't find it "by name" in the global namespace.
Another way to do it that might be slightly better is to use the user_ns namespace dict that IPython stores. Then at least you're not looking at globals, and there is more stability over specific variables that have been named when assigned by the user in IPython:
In [71]: def run_timeit(df):
....: g = get_ipython()
....: for var_name, var_val in g.user_ns.iteritems():
....: if df is var_val:
....: g.run_line_magic('timeit', '%s.sum()'%(var_name))
....: break
....:
In [72]: run_timeit(dfrm)
The slowest run took 5.58 times longer than the fastest. This could mean that an intermediate result is being cached
10000 loops, best of 3: 99 µs per loop
In the case of your specific R function call, I would try:
def rpy2fun_linemagic(df):
g = get_ipython()
for var_name, var_val in g.user_ns.iteritems():
if df is var_val:
g.run_line_magic('R', '-i %s'%(var_name))
g.run_line_magic('R', 'df_cor <- cor(%s)'%(var_name))
g.run_line_magic('R', '-o df_cor')
return df_cor
You might also have to be careful on the return statement. You might need to use return g.user_ns['df_cor'] or something if the result of the output conversion back to Python is to create the variable at global scope as well, rather than function scope. Or, if that variable gets created as a side effect, you may not want to return anything at all. I'm not a big fan of relying on implicit mutation like that, but it could work for you.
I suspect that the code example you are providing is there only to demonstrate the issue with run_line_magic(), but for reference I am adding a way to do the same without ipython being involved.
from rpy2.robjects import globalenv
def rpy2cor(df):
fun = globalenv.get('cor', wantfun=True)
df_cor = fun(df)
return df_cor

How to get the exact, full version number of Perl that's installed?

I know I've got Perl 5.20.1.1 installed. But can I determine that programmatically?
$] only gives the revision, version and sub-version, i.e. 5.020001 for me, meaning 5.20.1.
The Config module (documented here) doesn't seem to give anything deeper than that. For me:
perl -MConfig -e 'foreach (sort keys %Config) { print "$_ -> $Config{$_}\n" if /version|revision/io; }'
gives:
PERL_API_REVISION -> 5
PERL_API_SUBVERSION -> 0
PERL_API_VERSION -> 20
PERL_REVISION -> 5
PERL_SUBVERSION -> 1
PERL_VERSION -> 20
Revision -> $Revision
SUBVERSION -> 1
api_revision -> 5
api_subversion -> 0
api_version -> 20
api_versionstring -> 5.20.0
ccversion ->
d_inc_version_list ->
d_libm_lib_version ->
db_version_major -> 0
db_version_minor -> 0
db_version_patch -> 0
gccversion -> 4.8.3
gnulibc_version ->
ignore_versioned_solibs ->
inc_version_list ->
inc_version_list_init -> 0
revision -> 5
subversion -> 1
version -> 5.20.1
version_patchlevel_string -> version 20 subversion 1
versiononly ->
I don't think there's anything in there that gives any more information, but it probably doesn't help that in my case the sub-version number is the same as the sub-sub-version number!
Is there anywhere else I can look? Or have I perhaps missed something in %Config?
Official Perl releases only have three parts. "5" is the language, "20" is the major version and "1" is the minor version. Anything more than that was added by someone else (at a guess, whoever packaged the Perl you're using), so you probably will not find it from inside Perl.

subtraction between two columns with awk or sed

I have some text files. I need to do the subtraction between second and fourth columns in each file. The subtracted values should print to the original files as fifth column. How can I do this with awk or sed?
HII 62.0 HII 35.1
MEE 21.3 MEE 21.3
GLL 42.3 GLL 18.5
ASS 105.9 ASS 105.9
RRG 65.6
GLL 48.3
SES 83.5
Desired output
HII 62.0 HII 35.1 26.9
MEE 21.3 MEE 21.3 0
GLL 42.3 GLL 18.5 23.8
ASS 105.9 ASS 105.9 0
RRG 65.6
GLL 48.3
SES 83.5
If the third and fourth columns are blank, no need to subtract.
awk 'NF == 2 { print }
NF == 4 { print $0, $2 - $4 }'
That could all be fitted onto one line, but it clearer what it is doing when it is spread over two lines.
If you want more control over the format, you can use printf() instead of just print.
After sanitizing trailing spaces in the data, it produces:
HII 62.0 HII 35.1 26.9
MEE 21.3 MEE 21.3 0
GLL 42.3 GLL 18.5 23.8
ASS 105.9 ASS 105.9 0
RRG 65.6
GLL 48.3
SES 83.5
This might work for you (GNU sed & Bash):
sed -ri '/^\S+\s+(\S+)\s+\S+\s+(\S+)/s//echo "&\t$(echo \1-\2|bc)"/e' file