Post by luke213 » Wed Aug 02, 2017 9:42 am

So I'm wondering if anyone has had any luck with the new built in square payment extension working?

I've set it up on the square site, created an app which I'm assuming is the path forward. Then used the credentials to fill the fields to setup the plugin. Once I click connect it pulls this error:

I removed the IP's from the following error, though they aren't xx's on my actual screen so to speak.

Code: Select all

An error was encountered while refreshing the token: CURL error. Info: Array ( [url] => https://connect.squareup.com/oauth2/token [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 1 [redirect_count] => 0 [total_time] => 9.237982 [namelookup_time] => 0.028329 [connect_time] => 0.069302 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => xx.xxx.xxx.xxx [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => xx.xxx.xxx.xx [local_port] => 39428 ) 
It also lists an error:

Code: Select all

Your Square access token has expired or has been revoked! Click here to re-authorize the Square extension. 
I tried the click here to re-authorize and no luck same issue. Also tried connect and had the same errors. From what I can guess it looks like it's not pulling the token for some reason from square.

Mostly I'm curious if I'm dumb and can't make it work or if the extension is actually broken and I just haven't read of anyone else with issues. So if you've got it working I'd love to hear it:) Otherwise I'm gonna assume it's broken somehow.

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by Johnathan » Thu Aug 03, 2017 3:52 am

I haven't tested the new Square extension myself, but given that it's brand new, I wouldn't be surprised if there were some bugs in it. It will likely be more stable in future versions, as bugs are reported and fixed in the core. If anyone HAS gotten it working, hopefully they'll post here.

Just to note: if you do need to accept payments via Square and can't get the new built-in version working, my Square Payment Gateway works with OpenCart 3.0.2.0.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by luke213 » Thu Aug 03, 2017 3:58 am

Thanks I do appreciate that, I do a fair amount of payments through square. I'm a custom maker, as a result my lead time on projects is around 10+ weeks from the point the order is taken. So typically in the past because I couldn't find a payment module that wouldn't charge up front, I went ahead and manually processed the payment off site after around 8 weeks. But now I'm changing policy on my site and taking payments up front which of course makes it easy from a payment module standpoint because I'm back in what is considered "normal" behavior that things are setup for.

None the less I'm still deciding whether or not I'd like to completely automate the payment or do it manually just as the first step in the process rather than a later point.

Either way I'll keep that in mind, since this was a new change on my site and this module popped up I thought it would be nice to have the option, but I haven't quite decided if I'm up for spending money on a module or not. No knock against you by any stretch, I just haven't had much luck in the past with modules I've purchased. The vast majority of the time I've more less had either bad luck or no luck at all then ended up manually editing files and such to get the desired result. Of course that's not your extensions other developers but it turned me off to a certain degree on relying on outside extensions bar what's shipping with OC. But if I decide to automate and can't get the stock extension working you'll be my first point of contact;)

Take care!
Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by Johnathan » Fri Aug 04, 2017 11:18 pm

No worries, just wanted to let you know it's available. It doesn't support delayed or recurring payments at this time (like the new built-in one does) but I may add that in the future if there are requests for it. It all depends on how people like the built-in version, and if mine has anything to offer beyond that.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by OpenCart_Support » Mon Aug 07, 2017 6:27 pm

I've passed this thread over to our Square liaison, once I've got an update I'll update you further.

Cheers,

- OpenCart Community Cheerleader -


User avatar
Administrator

Posts

Joined
Mon Apr 10, 2017 5:16 pm
Location - OpenCart UK Office

Post by luke213 » Mon Aug 07, 2017 11:02 pm

Thanks so much I will test another theory as time permits and post it here as well, my site is an upgrade and it's possible something didn't go well(granted I don't have any bugs currently I'm aware of). But after my email notification thread, and realizing I was missing the event table in the database causing the issue I can't make any guarantee that this isn't the same type of issue. So I'll do a fresh install later with basically a couple fake products and try linking it to square and see if it works, I suspect though it's not that but at this point just not sure;)

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Tue Aug 08, 2017 1:00 am

Just a note I did install a completely new cart installation got it setup for a friends store and did the same steps to do square and came up with the same error. So best I can tell this isn't related to my old database or the upgrade since this was a fresh 3.0.2.0 install that should work with this. I also enabled SSL etc so I do believe it's something up with the extension rather than my install.

Take care!

Luke

EDIT: I also noticed there was some patching done to the files on github related to square, basically bug squashing. I went ahead and put those together in a package and replaced my square files across the server with them. I ended up with the same error or very close to it. So I suspect whatever I'm running into here hasn't been patched out of the current dev channel plugin. Or at least that's my best guess, was hoping in the patch they had squashed this thing but no such luck.

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by iSenseLabs » Tue Aug 08, 2017 4:13 pm

We have tested the Square extension on several web servers with different PHP versions, but we have never encountered this error. The only information we have about the issue is the error you reported, and it does not give enough information. This error could be (not necessarily) related to:

Possible cause 1) Forbidden access to curl_exec function (configured in php.ini)
Possible cause 2) Your web server cannot do requests to https://connect.squareup.com/oauth2/token
- there could be name resolution (DNS) issues
- or some kind of security software blocking the requests (firewall for example)
- something else of which we are not aware

The issue could be somewhere else, but we cannot be sure because we are not familiar with your network setup and environment.

To test if CURL is working properly, you may do this:

Create a new PHP file with the following contents:

Code: Select all

<?php
$url = 'https://connect.squareup.com/oauth2/token';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
$error_number = curl_errno($curl);
$error_text = curl_error($curl);
$curl_info = curl_getinfo($curl);
curl_close($curl);

echo '<h1>DATA:</h1>';
echo '<pre>' . htmlentities($data) . '</pre>';
echo '<h1>ERROR (' . $error_number . '):</h1>';
echo '<pre>' . $error_text . '</pre>';
echo '<h1>INFO:</h1>';
echo '<pre>'; print_r($curl_info); echo '</pre>';
?>
Upload the file to your web server and access it from a web browser.

If everything is fine, the result will look like this:

============
DATA:

{
"message": "NotFound",
"type": "not_found"
}
ERROR (0):

INFO:

Array
(
[url] => https://connect.squareup.com/oauth2/token
[content_type] => application/json
[http_code] => 404
[header_size] => 552
[request_size] => 71
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.977268
[namelookup_time] => 3.9E-5
[connect_time] => 0.190473
[pretransfer_time] => 0.784074
[size_upload] => 0
[size_download] => 51
[speed_download] => 52
[speed_upload] => 0
[download_content_length] => 51
[upload_content_length] => -1
[starttransfer_time] => 0.977238
[redirect_time] => 0
[certinfo] => Array
(
)

[primary_ip] => xxx.xxx.xxx.xxx
[primary_port] => 443
[local_ip] => xxx.xxx.xxx.xxx
[local_port] => 39024
[redirect_url] =>
)

============

You may set a different value for the $url variable and see if you will be able to access other URL's, for example yahoo.com

This extension was developed by iSenseLabs. You may try contacting them on sales@isenselabs.com and get support.

Premium OpenCart Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Sat May 19, 2012 7:41 pm

Post by luke213 » Tue Aug 08, 2017 10:45 pm

Thanks so much for the reply. I did realize it was Isenselabs that did it, I was trying not to bother you guys with a community request through business channels if I could help it but that I will try as soon as I have some time;)

I did that upload with php and got back:

Code: Select all

DATA:

ERROR (35):

Unknown SSL protocol error in connection to connect.squareup.com:443 

INFO:

Array
(
    [url] => https://connect.squareup.com/oauth2/token
    [content_type] => 
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 1
    [redirect_count] => 0
    [total_time] => 10.238828
    [namelookup_time] => 0.028297
    [connect_time] => 0.128432
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => -1
    [upload_content_length] => -1
    [starttransfer_time] => 0
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => xxx.xxx.xxx.xxx
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => xxx.xxx.xxx.xxx
    [local_port] => 49608
Which sounds an awful lot like it's related to my SSL being rejected or something on that end. Since my php.ini is stock and doesn't mention curl from what I understand it would only be a problem if it were disabled there. On SSL it's something I've got very limited experience with, and since my site hasn't taken payments over the years I've always run them manually off line, I never had SSL enabled until this recent build of the site. So I had signed up for the most basic of basic SSL certificates from my host 1and1 and now I'm thinking that could be related here.

So I'll do some research into their SSL setups and inform myself a bit more on SSL across the board and see if I can't find what is causing the failure. I'm just glad to hear it's functional on someone else's server then at least I know it's not a code issue more than likely a configuration issue at my host or on my install. Again I really appreciate the reply and help, been banging around on this for a few days at least and any pointers are always appreciated.

Also should mention I'd be happy to give any data that would help, logs etc. Though I'd need to know what you're hunting for or rather where the log is located etc. Since while I've been using OC for years I haven't had huge need to dig around the logs etc for fixing things, it's generally worked after my initial installation.

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Wed Aug 09, 2017 8:57 am

I did some reading and testing, looks like my site is running TLS 1.2 currently and the lower versions as well, so I don't believe that should be a problem. I can't seem to find a link that says what version on openssl or TLS is required to talk to the square API, if anyone knows I'd appreciate it. From the looks of it it's something on 1and1 causing this, which isn't a huge surprise nor the first time it's happened.

I should also mention I'm running the Starter SSL package of sorts, rather than the fancier packages, but I don't see anything listed that says hey I need something more at this stage. But if I'm incorrect there, please feel free to correct me I'm fairly new to working with ssl in general and learning as I go.

Other test scripts or things I can test would be as always appreciated. I did send off an email to isenselabs, and hopefully they will be able to be of some help as well. Thanks though for all the help thus far it's certainly appreciated.

Luke

EDIT: Forgot to mention I'm running the stock php.ini as well as PHP version 7 currently on the site, so I don't believe I've got any issues with curl from what I've read with that version of php. Most of the issues I saw seemed to be 5.6 and earlier, but I do have 7.1 as an option though I haven't tried that. I did drop to 5.6 at one point to try that but no dice same issues.

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Thu Aug 10, 2017 12:37 am

For anyone watching this thread with the same issue. I don't have an answer yet Isenselabs is working with me to try and solve it. Currently it looks like it's either something on the backend of square(unlikely IMHO), or something on the host side(much more likely). I'm running the site through 1and1 on a shared server and according to them that's causing the issue, however I'm not sure it's not related to the version of curl etc.

So more testing but hopefully I'll have an answer before too long and be able to post a fix for other guys running into this issue.

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Thu Aug 10, 2017 7:16 am

And it's working. I'm not sure what changed on which end either square or 1and1 but either way one of them fixed the issue at least on my server and it's functional. So if someone else has this issue probably worth posting just to say it happened.

Take care!

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by iSenseLabs » Thu Aug 10, 2017 1:43 pm

The issue has been resolved. If anyone has connectivity issue on 1AND1 hosting with Square — please run the script above to check if you are successfully connecting and if not, feel free to post the error you are having on this forum thread. You can also bring the result to 1AND1's support team by providing them the isolated PHP script example with the result.

Premium OpenCart Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Sat May 19, 2012 7:41 pm

Post by luke213 » Sat Aug 12, 2017 7:32 am

Just a note to guys who may be reading and not posting. The extension went down again, well it's not connecting. Isense and I have been talking about it and I do want to say it doesn't look at all like it's their code. Rather it's either something on 1and1 or square causing the issue in the way they talk. So right now it's down again, not sure when/if it will get fixed again;) Since we're not sure what happened in the first place on which end to have them start communicating properly.

So I'll update when it goes back to working and hopefully this time we'll know what caused it and that it's a permanent change rather than something temporary;)

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by shulmax » Fri Aug 18, 2017 9:47 am

Thanks a lot for the info contained in this thread! I'm also unable to connect to square successfully. I'm running opencart 2.3.0.2 - i ran the CURL php script and received the following output (same error 35 as listed further up in this thread). If anybody can shed more light on getting the issue fixed it would be much appreciated.

DATA:

ERROR (35):

Unknown SSL protocol error in connection to connect.squareup.com:443
INFO:

Array
(
[url] => https://connect.squareup.com/oauth2/token
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 1
[redirect_count] => 0
[total_time] => 10.23879
[namelookup_time] => 0.028362
[connect_time] => 0.128539
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => xx.xxx.xxx.xxx
[certinfo] => Array
(
)

[primary_port] => xxx
[local_ip] => xx.xxx.xxx.xxx
[local_port] => xxxxx
)

User avatar
Newbie

Posts

Joined
Mon Apr 18, 2016 10:37 am

Post by iSenseLabs » Fri Aug 18, 2017 2:42 pm

@shulmax: Can you share which one is your hosting provider? There is currently a known issue with 1and1 and Square is working with them to resolve it.

Premium OpenCart Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Sat May 19, 2012 7:41 pm

Post by ScottDellinger » Sun Aug 27, 2017 10:43 am

I'm also encountering this exact issue, on 1and1.com. Any update on this at all?


Posts

Joined
Sun Aug 27, 2017 4:31 am

Post by ScottDellinger » Mon Aug 28, 2017 3:11 am

I've spent a good chunk of today speaking to techs at 1and1, and basically they told me they have no idea why the issue is happening, but they know it's happening. They cannot provide any ETA on it.

I've contacted Square as well, but have not yet heard back. I'll post again when I have more info.


Posts

Joined
Sun Aug 27, 2017 4:31 am

Post by luke213 » Mon Aug 28, 2017 3:19 am

I forgot to mention but basically that's what I've heard from I sense via email as well. It's funny because they had it working for 24 hours there wish someone at square or 1and1 knew what they did during that stretch to get it back working ;)

Take care

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by luke213 » Wed Oct 04, 2017 3:13 am

So just an update for others in the same boat, as of right now it's back to communicating properly on my site. I don't know when it started, I've been checking my script every few weeks and hadn't had any results until just now. I'm waiting for word about whether this is temporary like last time or fixed, but let's hope that it's fixed and running properly;)

Luke

New member

Posts

Joined
Thu Jul 08, 2010 2:35 am

Who is online

Users browsing this forum: No registered users and 50 guests