Page 5 of 11

Re: Future store updates planned (backend)

Posted: Wed Aug 28, 2019 9:19 pm
by exxos
Sidestepped again back to payaservices. I got a reply form tech support about the issue I had and now its solved.. and...

pc.png
pc.png (17.39 KiB) Viewed 1636 times


I'm going to finish the payaservices checkout, at least I will then have fall-back plan if sage is going to drag on for a bit.

Re: Future store updates planned (backend)

Posted: Thu Aug 29, 2019 10:28 am
by exxos
More chaos. Overall, it seems payment systems don't do what I want exactly (or at least how things are running now on my live store). I have to moved to more complicated systems which require PCI compliance..

to which I got back..
If you're using shared hosting, I don't believe it's possible to get PCI compliance, as the PCI compliance requires isolation of data, and as you can imagine, with other sites outside of your control being on the same server, then there is always the possibility that this data may be breached from other sites.
I just got a email from Worldpay saying I am getting billed £4.99 a month, WTF ? Had to email Sage and ask WTF is going on. As I would be paying fees per month with Sage, plus 1.5% transaction fess, plus Worldpay fees...

I just seem to be going around in ever increasing circles :( This is all getting very tiresome :(

Re: Future store updates planned (backend)

Posted: Thu Aug 29, 2019 5:07 pm
by exxos
Rang up Sage earlier. After a hour, basically they don't know what the problem is either. They were supposed to be ringing me back, but that was 3 hours ago now :roll:

I may ring them up again on Monday, but when their own tech support doesn't know what the problem is with their own system, how am I supposed to solve it ?! Apparently they never had the issue I am having , figures :roll: .

Re: Future store updates planned (backend)

Posted: Thu Aug 29, 2019 10:21 pm
by exxos
No call from Sage :( I mean I have been trying for days to get it working already and I just see nothing wrong. Spent endless hours on google where there seems to be near zero people even asking about sage issues. I managed to tag onto a post on stackoverflow about issues, but I think it's not going to help. I think its pretty conclusive I will just have to give up with thier system :roll:

I have asked payacard if they are supporting 3DS V1 & V2, if yes, I will start coding for their system. If not, then I don't have a PLAN D: :(

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 1:45 pm
by exxos
Got a call from Sage accounts, my account is setup <sarcasm> Yippie! </sarcasm>

The first line of code pretty much is...

Code: Select all

  CURLOPT_POSTFIELDS => '{ "vendorName": "sandbox" }',
Which I change to my vendor name..

Code: Select all

  CURLOPT_POSTFIELDS => '{ "vendorName": "exxos" }',
So what happens ?


Uncaught Error: API parameters invalid
- Merchant session key does not have a valid format


I have also tried various combinations of everything I can think of... it just doesn't work :roll:


EDIT:

OK what seems to be very unclear is where it has

Code: Select all

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://pi-test.sagepay.com/api/v1/merchant-session-keys",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '{ "vendorName": "sandbox" }',
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic aEpZeHN3N0hMYmo0MGNCOHVkRVM4Q0RSRkxodUo4RzU0TzZyRHBVWHZFNmhZRHJyaWE6bzJpSFNyRnliWU1acG1XT1FNdWhzWFA1MlY0ZkJ0cHVTRHNocktEU1dzQlkxT2lONmh3ZDlLYjEyejRqNVVzNXU=",
    "Cache-Control: no-cache",
    "Content-Type: application/json"
  ),
));
Authorization: Basic, what it fails to explain is that its supposed to be generated from what it says here https://test.sagepay.com/documentation/#authentication

So the code would actually be more like...

Code: Select all

$_SESSION['AUTH'] = base64_encode($integrationKey . ":" . $integrationPassword) ;
The something like

Code: Select all

"Authorization: Basic ".$_SESSION['AUTH'].",

Now to see why php has died running it all... :roll:

EDIT2:

OK its all those quotations messing it up, so now its just...

Code: Select all

"Authorization: Basic $AUTH",
So now I have to go and change all the other code with those lines in now :roll:

EDIT3:

yay a new error :roll:
4020
Information received from an Invalid IP address.
It seems I have to put the IP of my server into Sage to allow payments from my server only.. which I did.. and still same problem :pullhair:

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 3:15 pm
by exxos
I found this page

https://stackoverflow.com/questions/176 ... d-ip-addre

Basically..
The issue here was that the IP address of the web server (www.mysite.com), being on a VPS, turned out to not be the same address as the one used when curl requests were made.
So I found this page..

http://nenuno.co.uk/php/get-ip-address-by-curl-in-php/

Where I ran this...

Code: Select all

$url = 'http://php.net/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);       
curl_exec($ch);
$info  = curl_getinfo($ch);  
curl_close($ch);  
echo $info['primary_ip'];
Which gave me a totally different IP address..which I added to Sage.. then does it work now ?
4020
Information received from an Invalid IP address.
Nope :roll:

EDIT:
Now I realised I forgot to charge the $URL :lol: So I changed it , and just got back my server IP , so still no help :roll:

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 4:12 pm
by derkom
Wait, if you're running that php snippet, with your own URL in there, it's certainly going to return the IP of your own site, which may not be the one for outbound stuff.

Look at the Stackoverflow thread you linked, and do what was suggested in the answer there. If you run "curl icanhazip.com" from the shell on your VPS, you'll get back the IP address that's being used for outbound connections.

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 4:14 pm
by exxos
derkom wrote:
Fri Aug 30, 2019 4:12 pm
Look at the Stackoverflow thread you linked, and do what was suggested in the answer there. If you run "curl icanhazip.com" from the shell on your VPS, you'll get back the IP address that's being used for outbound connections.
Get the same IP...

1.jpg
1.jpg (5.49 KiB) Viewed 1550 times
EDIT:

I even emailed my web host, and they say there is only that 1 IP in use.

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 4:18 pm
by derkom
Got me stumped then. :-?

Re: Future store updates planned (backend)

Posted: Fri Aug 30, 2019 4:23 pm
by derkom
Oh, the Sagepay docs say to zero-pad the IP (for some reason). Have you tried putting 081.004.101.012 in the Sage control panel?

Edit: Subnet mask apparently also needs to be zero-padded (although if you're allowing from only one IP, this'll be 255.255.255.255 regardless).