0

I have a E-Payment site .

For those personal info , I would like to save in my db through MYSQL. For the $Amount , I would like to send to the Epayment Gateway .

What should I do the adjustment ?

<form name="payFormCcard" action="<//?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">

for self-DB storage

<form name="payFormCcard" method="post" action=" E-Payment site..."> 

post to E-payment site

evabb
  • 405
  • 3
  • 21
  • like what i've said before in your other question, just process the form like you would normally do (using php), get the user inputs, name, address email address amount, and others, make your insertions and whatnot, then finally, make a curl request to the payment gateway sending parameters like merchantid and other sensitive stuff, and include along the amount. – Kevin Jun 22 '18 at 03:41
  • regarding your troubles in the payment request, on our end we can only guess (we don't know what payment gateway API service you're using), you'll need to consult their manual on how to make a POST request to them, their parameters they need and stuff and its up to you how you handle their response to your request – Kevin Jun 22 '18 at 03:42
  • their manual doesn't have the method of curl . It send to post the form to their gateway. – evabb Jun 22 '18 at 03:43
  • I don't know curl . Is it a method to pass the data ,that doesn't need the approval of curl from their side ? – evabb Jun 22 '18 at 03:45
  • i think you misunderstood me on the previous comments, fyi, there are several ways to create a POST request, not just a form, you can even create a POST request using `file_get_contents`, curl is a library in PHP that you can use to create HTTP requests. – Kevin Jun 22 '18 at 03:48
  • is this the manual of the payment gateway you're talking about? http://www.paydollar.com/pdf/paygate-integration-guide-3-2.pdf – Kevin Jun 22 '18 at 03:48
  • Yes , does it mention the post method of CURL ? – evabb Jun 22 '18 at 03:50
  • and to answer your question in the comments, no, they won't check if the way you requested was from cURL, from a simple form or `file_get_contents`, what matters is you made a POST request, thats the thing that they will handle on their end – Kevin Jun 22 '18 at 03:50
  • anyway, your question is too broad to be answered. by advice to you is first, handle everything in your form, get the inputs, save it in your DB, and please use PDO and utilize prepared statements, so at least you save yourself from sql injection attacks, then proceed in making POST requests to your payment gateway – Kevin Jun 22 '18 at 03:53
  • here's a starting point in the requests part: https://stackoverflow.com/a/2445332/3859027 or https://stackoverflow.com/a/2138534/3859027 – Kevin Jun 22 '18 at 03:54
  • For the POST request using the CURL , may I reference to this ?`https://stackoverflow.com/questions/2138527/php-curl-http-post-sample-code – evabb Jun 22 '18 at 04:06
  • yes, that should be sufficient enough to make a POST request using cURL in PHP, provide the url for the payment gateway API, and along with it the amount, merchantID, and everything that they require – Kevin Jun 22 '18 at 04:24

0 Answers0