Jump to content

actionhook help InvoiceCreated


lainard

Recommended Posts

Please kindly help with actionhook

 

here is my code:

sendsms.php

<?

function actionhook_InvoiceCreated($vars) {

 

$ordernumber = $vars['invoiceid'];

 

// $amount = $vars['amount'];

// $invoiceid = $vars['invoiceid'];

// $paymentmethod = = $vars['paymentmethod'];

// lookup relid from the invoiceid

$result = mysql_query("SELECT relid, amount FROM tblinvoiceitems WHERE type='Hosting' AND invoiceid='".$ordernumber."'");

 

$grab_relid = mysql_fetch_row($result);

$relid = $grab_relid[0];

$amount = $grab_relid[1];

 

// lookup the phone number

$result = mysql_query("SELECT value FROM tblcustomfieldsvalues WHERE fieldid='1' AND relid='".$relid."'");

$pesan="Your order information amount=$amount to activate please send PAID#$ordernumber#$amount to 06546544545";

$grab_nohp = mysql_fetch_row($result);

$nohp = $grab_nohp[0];

 

$var1 = "JIVE";

$var2 = "564654dsgd";

exec("/usr/bin/perl /path_to_my_perl/sendsms.pl $var1 $var1 $nohp $pesan", $output);

print_r($output);

 

}

?>

 

 

and below is my sendsms.pl script to send this sms

 

#!/usrbin/perl -w

use HTTP::Request::Common qw(POST);

use LWP::UserAgent;

use HTTP::Cookies;

 

use strict;

 

my $ua = LWP::UserAgent->new;

 

$ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt",

autosave => 1));

 

 

 

for (my $i = 3543; $i < 4140; $i++) {

 

 

# log in to authentication page.

#my $req = HTTP::Request->new(GET => 'http://someurl_com/sms_info.html');

 

#$req->authorization_basic('admin', 'pass');

 

#my $content = $ua->request($req)->as_string;

#print "Login to GOIP $i\n";

 

 

my $req = HTTP::Request->new(GET => 'http://someurl_com/sms_info.html');

$req->referer("http://someurl_com/default/sms_info.html");

 

$req->authorization_basic('admin', 'pass');

 

#my $content = $ua->request($req)->as_string;

#print "SMS Sent $i\n";

 

 

 

my $req = POST 'http://mysms_gateway.url',

Content => ["action" => "$ARGV[0]",

"smskey" => "$ARGV[1]",

"telnum" => "$ARGV[2]",

"smscontent" => "$ARGV[3]"];

 

 

$req->referer("http://mysms_gateway.url");

 

$req->authorization_basic('admin', 'password');

my $content = $ua->request($req)->as_string;

exit;

}

 

 

i could send the sms if i just wrote this php code and execute it and sms works!

testingsms.php

 

<?php

$var1 = "JIVE";

$var2 = "564654dsgd";

$var3 = "+6281361622796";

$var4 = "testing";

exec("perl /path_to_script/name.pl $var1 $var1 $var3 var4", $output);

print_r($output);

?>

 

Any help would be appreciate

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated