Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:labitat/labipay
Browse files Browse the repository at this point in the history
  • Loading branch information
elhaard committed Jan 29, 2011
2 parents 436e18b + 738ed9f commit be46b7f
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions terminal.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/perl -Tw

use strict;
use warnings;

use lib '.';

use Labipay::Funcs;

use CGI;
use JSON;

my $q = new CGI;
my $dbh = db_connect();
my $response = {};





print "Content-Type: application/json\n\n";
my $json = new JSON;
print $json->encode($response);

exit;




sub error {
my $response = shift || {};
my $status = shift || 'error';




}


sub add_checksum {
my $response = shift;
my $fields = shift;
my $secret = shift;

my $string = $response->{seed} = seed();
foreach my $field (@$fields) {
$string .= $response->{$field};
}
$string .= $secret;

$response->{checksum} = $string;

return $string;

}


sub seed {

my $length = 10;
my $seed = '';
for (my $i = 0; $i < $length; $i++) {
$seed .= 'g';
}


return $seed;
}

0 comments on commit be46b7f

Please sign in to comment.