Use PHP to hide the amount - Pinpayments
Get the solution ↓↓↓So, Pinpayments (which is a payment gateway) have a really really simple integration which is show below:
<script src="https://cdn.pinpayments.com/pin.v2.js"></script>
<a class="pin-payment-button" href="https://pay.pinpayments.com/rc3g/test?amount=13"><img src="https://pinpayments.com/pay-button.png" alt="Pay Now" width="86" height="38"></a>
What I'm struggling to do is pass the "amount" via PHP so it's not hardcoded in to the link, users could easily just change this value via inspect.
How do I do this with PHP?
Answer
Solution:
You can't really.
While you could store the value in, for example, a session and then use a 302 redirect to send the user's browser there, that would only be very slightly harder to change. You still need to give the value to the user and let them go to the payment service.
The proper way to solve this is to check that the amount you receive is correct before giving the user whatever it is they are paying for.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: closed without sending a request; it was probably just an unused speculative preconnection
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.