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

  • SEARCH
  • Home
  • 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 4056792
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:52:19+00:00 2026-05-20T14:52:19+00:00

I have a problem that i seems can’t figure out properly. I got a

  • 0

I have a problem that i seems can’t figure out properly.
I got a website where you can pick some offer and buy it.
The steps for this procedure is:

1) Customer pick offer (index.php) he like and proceed to (buy.php) page

2) At (buy.php) page he selects quantity and payment method

3) When customer presses buy he is redirected to (payment.php) where all data is verified again and doing some database recording. Payment.php page processes user to selected payment gateway (out of my website).

So the problem is that i can swap $_POST data from buy.php page to payment.php and payment page would think that data is correct.

Before i was simply checking if price that comes to payment page is one of allowed prices in my $array and i had no problems with this. But now i offer a discounts and i can not tell if amount coming in is indeed correct.

How usually all this is processed? I’m new to working with payments.

Thanks.

  • 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-05-20T14:52:19+00:00Added an answer on May 20, 2026 at 2:52 pm

    The usual way payment providers do this, is the following.

    • You have a form that will result in a POST array.
    • add one field to this array with a hash. Make this hash from the string as follows:
      • Define a secret string (some sort of a ‘salt’, but different)
      • Sort all your POST keys alphabetically.
      • Make a string like this:
      • key=value.secretString.key2=value2.secretString … etc
      • hash the string and send it in the post.
      • (do NOT send, show or reveal your secret string, obviously)

    Now when you receive the POST, you can use your secret string to recreate the hash that should accompany it, and compare it to the hash you got (also in the post ofcourse, obviously don’t hash that too). If it is equal, the values where not tampered with. If it isn’t you should reject the payment.

    Because you also include a date, a user/orderID etc in your post, it cannot be changed for the post of another order. Changing one of the values in the post would also mean the HASH has to be changed, but as the user can’t create it, this will not do.

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

Sidebar

Related Questions

I have a problem that I can't figure out myself. I've tried using LEFT
I have a problem with character encoding in some HTML pages. It seems that
I have a problem that seems like its a result of a deadlock-situation. Whe
I have a problem that I have not faced before: It seems that the
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I have an issue that seems like very flaky behavour, is this a problem
This seems like a simple problem: I have a WF4 activity that guides the
I have the problem that an specific step in Ant can only be executed
I've got a problem that seems simple on the face of it but has
I have a problem that when a user times out on my site they

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.