LibertyReserve money transfer API code -- Working Version !!!
Finally I got it to works, below is the sample code, work perfectly for me.
You ONLY need to modify the following variable:-- $APIname,$securityWord,$payerAcct,$payeeAcct,$amount,$memo,$isPrivate
And call the function "transferMoney()", and you are done !!!
Note: I use PHP version of SHA256 instead of mHash module so the code can be used without library and will work with PHP4.
I appreciate a donation of $0.01 if you ever use the code for transfer testing. The payee account set to mine, you can set to any other account you like..............
LibertyReserve Programmatic Autopay Script:--
<?php
require('sha256.inc.php');
function generateId() {
return time().rand(0,9999);
}
function createAuthToken($securityWord) {
$datePart = gmdate("Ymd");
$timePart = gmdate("H");
SHA256 PHP based version (safe the file as sha256.inc.php) :--
<?php
/************************************************** *****************************
*
* SHA256 static class for PHP4, debug output version
* implemented by feyd _at_ devnetwork .dot. net
* specification from http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
*
* Copyright 2005 Developer's Network. All rights reserved.
* This is licensed under the Lesser General Public License (LGPL)
*
* Thanks to CertainKey Inc. for providing some example outputs in Javascript
*
*----- Version 1.0.1 ----------------------------------------------------------
*
* Syntax:
* string SHA256::hash( string message[, string format ])
*
* Description:
* SHA256::hash() is a static function that must be called with `message`
* and optionally `format`. Possible values for `format` are:
* 'bin' binary string output
* 'hex' default; hexidecimal string output (lower case)
*
* Failures return FALSE.
*
* Usage:
* $hash = SHA256::hash('string to hash');
*
************************************************** ****************************/
// hashing class state and storage object. Abstract base class only.
class hashData
{
// final hash
var $hash = null;
}
// hashing class. Abstract base class only.
class hash
{
// The base modes are:
// 'bin' - binary output (most compact)
// 'bit' - bit output (largest)
// 'oct' - octal output (medium-large)
// 'hex' - hexidecimal (default, medium)
// perform a hash on a string
function hash($str, $mode = 'hex')
{
trigger_error('hash::hash() NOT IMPLEMENTED', E_USER_WARNING);
return false;
}
// chop the resultant hash into $length byte chunks
function hashChunk($str, $length, $mode = 'hex')
{
trigger_error('hash::hashChunk() NOT IMPLEMENTED', E_USER_WARNING);
return false;
}
// perform a hash on a file
function hashFile($filename, $mode = 'hex')
{
trigger_error('hash::hashFile() NOT IMPLEMENTED', E_USER_WARNING);
return false;
}
// chop the resultant hash into $length byte chunks
function hashChunkFile($filename, $length, $mode = 'hex')
{
trigger_error('hash::hashChunkFile() NOT IMPLEMENTED', E_USER_WARNING);
return false;
}
}
// ------------
class SHA256Data extends hashData
{
// buffer
var $buf = array();
// padded data
var $chunks = null;
function SHA256Data($str)
{
$M = strlen($str); // number of bytes
$L1 = ($M >> 28) & 0x0000000F; // top order bits
$L2 = $M << 3; // number of bits
$l = pack('N*', $L1, $L2);
// 64 = 64 bits needed for the size mark. 1 = the 1 bit added to the
// end. 511 = 511 bits to get the number to be at least large enough
Re: LibertyReserve money transfer API code -- Working Version !!!
Thank you for sharing!
__________________
Forex Accounts management.
Start from Only $5000 for limited time.
1-10% monthly returns. Tarek Forex Services
CTA, IB For Fxsol ( Open Real Forex Accont )
Re: LibertyReserve money transfer API code -- Working Version !!!
Quote:
Originally Posted by dr_goldgame
Do the scripts work for you ?
And I just safe you all something like $50 if you hire someone from scriptlance to code for you. Now you get this free from me !!!
Cheer..........
Didn't test it. I have PHP5 environment and no need for SHA256 file.
If you have PHP5 just use this $token = hash('sha256',$authString); to produce SHA256 token.
And for your code use this
$token = SHA256::hash($authString,'HEX');
This will give you upper case string, no need to use strtoupper.