Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8393305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:44:52+00:00 2026-06-09T19:44:52+00:00

I need help for my PHP script. I need to post certain fields like

  • 0

I need help for my PHP script. I need to post certain fields like invoiceid, firstname, email, etc in encrypted way. The formula for the checksum is

sha512 (key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||<SALT>)

I need to post the above variables via sha512. I am unable to do this. Please help with this. Im a learner and I am not good at PHP.

Here is the code. Im still getting checksum error.

<?php
function xxx_config() {

    $configarray = array(
     "FriendlyName" => array("Type" => "System", "Value"=>"XXX"),
     "alias" => array("FriendlyName" => "Merchant ID", "Type" => "text", "Size" => "20", ),
     "salt" => array("FriendlyName" => "SALT", "Type" => "text", "Size" => "20",),
     "mode" => array("FriendlyName" => "MODE", "Type" => "text", "Description" => "TEST or LIVE", ),

    );
    return $configarray;
}

function xxx_link($params) {


    # Gateway Specific Variables
    $key = $params['alias'];
    $gatewaymode = $params['mode'];
    $salt = $params['salt'];


    # Invoice Variables
    $txnid = $params['invoiceid'];
    $productinfo = $params["description"];
    $amount = $params['amount']; # Format: ##.##
    $currency = $params['currency']; # Currency Code

    # Client Variables
    $firstname = $params['clientdetails']['firstname'];
    $lastname = $params['clientdetails']['lastname'];
    $email = $params['clientdetails']['email'];
    $address1 = $params['clientdetails']['address1'];
    $address2 = $params['clientdetails']['address2'];
    $city = $params['clientdetails']['city'];
    $state = $params['clientdetails']['state'];
    $postcode = $params['clientdetails']['postcode'];
    $country = $params['clientdetails']['country'];
    $phone = $params['clientdetails']['phonenumber'];

    # System Variables
    $companyname = 'XXX';
    $systemurl = $params['systemurl'];
    $currency = $params['currency'];

        # Enter your code submit to the gateway...

$hashdata = ($key."|".$txnid."|".$amount."|".$productinfo."|".$firstname."|".$email."|"."|"."|"."|"."|"."|".$salt);

   $hash = hash("sha512", $hashdata);

$code = '<form method="post" action="https://secure.xxx.xxx" name="frmTransaction" id="frmTransaction" onSubmit="return validate()">
<input type="hidden" name="key" value="'.$key.'" />
<input type="hidden" name="mode" value="'.$gatewaymode.'" />
<input type="hidden" name="productinfo" value="'.$productinfo.'" />
<input type="hidden" name="txnid" value="'.$txnid.'" />
<input type="hidden" name="salt" value="'.$salt.'" />
<input type="hidden" name="name" value="'.$firstname.'" />
<input type="hidden" name="address" value="'.$address1.'" />
<input type="hidden" name="city" value="'.$city.'" />
<input type="hidden" name="state" value="'.$state.'" />
<input type="hidden" name="country" value="'.$country.'" />
<input type="hidden" name="postal_code" value="'.$postcode.'" />
<input type="hidden" name="ship_name" value="'.$firstname.'" />
<input type="hidden" name="ship_address" value="'.$address1.'" />
<input type="hidden" name="ship_city" value="'.$city.'" />
<input type="hidden" name="ship_state" value="'.$state.'" />
<input type="hidden" name="ship_country" value="'.$country.'" />
<input type="hidden" name="ship_postal_code" value="'.$postcode.'" />
<input type="hidden" name="ship_phone" value="'.$phone.'" />
<input type="hidden" name="email" value="'.$email.'" />
<input type="hidden" name="phone" value="'.$phone.'" />
<input type="hidden" name="amount" value="'.$amount.'" />
<input type="hidden" name="surl" value="https://xxx.xx/xxxx.php" />
<input type="hidden" name="furl" value="https://xxx.xx/xxx.php" />
<input type="hidden" name="Hash" value="'.$hash.'"/>
<input type="submit" value="Pay Now" />
</form>';

return $code;

}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:44:54+00:00Added an answer on June 9, 2026 at 7:44 pm

    the hash() function is what you are looking for. To create an sha512 hash call it as follows:

    hash('sha512', "the value to hash");
    

    to see what Hash-Algorithms else you could use take a look at the hash_algos() function

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need your help. I have a php script to send email to people
I need help with posting a value to a php script from a js
Ok, i have made a contact form. i need a php script to email
Please i need your help with my script. I'm trying to post comments to
I need help rewriting online.php to -> /users/online and profile.php?id=3426 to -> /users/3426 and
I need some help with PHP Class. I have limited knowledge about how it
I need help with includes in PHP. I have a group of files where
I need help with preg_match function in php. I have read a lot of
I need some help with some PHP and MySQL code. At the moment I
I need help to use jConfirm with this existing code (php & Jquery &

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.