Hello,
So I'm trying to add a payment gateway for Liberty Reserve to my 4.1.4 developer. I'm listing below all what I did so far & information I gathered (please ask if you want more details), any help or clues appreciated especially that my knowledge in PHP is very limited
Editing config.php was rather simple:
PHP Code:
<?php
$data['gateway']['name'] = "libertyreserve";
$data['gateway']['displayname'] = "Liberty Reserve";
$data['gateway']['showas'] = "Liberty Reserve USD";
$data['gateway']['version'] = "v1";
$data['gateway']['extraTxt'] = "Account Number";
$data['gateway']['extra2Txt'] = "Leave Blank";
$data['gateway']['cconsite'] = 'N';
?>
The N in the end is fine I guess,
or better put Y ?
Now to the sr.php file, following
instructions for SCI on LR website, I edited the forms this way:
PHP Code:
function libertyreserve_createForm($params)
{
$libertyreserveurl="https://sci.libertyreserve.com";
$output = '<form name="final" action="'.$libertyreserveurl.'" method="GET">';
$output.= '<input type="hidden" name="lr_acc" value="'.$params['extra'].'">';
$output.= '<input type="hidden" name="lr_store" value="My Store">';
$output.= '<input type="hidden" name="lr_amnt" value="'.$params['oTotal'].'">';
$output.= '<input type="hidden" name="lr_currency" value="LRUSD">';
return $output;
}
I tested the form & it works fine but I'm not sure
if 68classifieds needs to send more data? Also the bigger headache is getting data back after payment is made.
I can add store data in my LR account (whose ID is in the extra field), the interface looks like this:
I think my Success URL should be
http://domain.com/thanks.php?gateway=libertyreserve is it the same as the Fail URL ?
Status URL is the page (or email) that will receive data from LR to allow merchant
verify SCI server's data, data contains among other fields, 2
HASH SHA256 strings in fields called
lr_encrypted &
lr_encrypted2 , for example you can read this about verification via
lr_encrypted:
Quote:
1. By concatenating information you will receive a string that looks like: lr_paidto:lr_paidby:lr_store:lr_amnt:lr_transfer:l r_currency:secret word. You will need to use form data contained in hidden fields and security word to successfully complete this step.
2. You then will need to HASH this string via SHA256
3. Compare the received HASH string with the string contained in hidden field lr_encrypted. Both strings should be identical. If they are not, you CAN NOT TRUST any information received from server
|
OK,
I don't have a clue how to implement this in 68, LR offer a sample SCI script you can
download from here. I'm attaching to this post the
status page I found in that sample.
Thanks for your attention!