Help with Web Component POST

I have a PHP script of a payment gateway (Cashfree). In this script, there are some variables such as: appId, orderId, orderAmount, orderCurrency, etc and also the details of the customer who is paying money. I have uploaded this script into my server. Now I want to provide the data in all the variables from my app using Post Text. But I am not able to figure it out. Can someone help me with this?

Here is the script:

<!DOCTYPE html>
<html>
<head>
  <title>Cashfree - Signature Generator</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body onload="document.frm1.submit()">


<?php 
$mode = "TEST"; //<------------ Change to TEST for test server, PROD for production

extract($_POST);
  $secretKey = "TEST974175fd587548b3ff8a3b2648f6bf";
  $postData = array( 
  "appId" => $appId, 
  "orderId" => $orderId, 
  "orderAmount" => $orderAmount, 
  "orderCurrency" => $orderCurrency, 
  "orderNote" => $orderNote, 
  "customerName" => $customerName, 
  "customerPhone" => $customerPhone, 
  "customerEmail" => $customerEmail,
  "returnUrl" => $returnUrl, 
  "notifyUrl" => $notifyUrl,
);
ksort($postData);
$signatureData = "";
foreach ($postData as $key => $value){
    $signatureData .= $key.$value;
}
$signature = hash_hmac('sha256', $signatureData, $secretKey,true);
$signature = base64_encode($signature);

if ($mode == "PROD") {
  $url = "https://www.cashfree.com/checkout/post/submit";
} else {
  $url = "https://test.cashfree.com/billpay/checkout/post/submit";
}

?>
  <form action="<?php echo $url; ?>" name="frm1" method="post">
      <p>Please wait.......</p>
      <input type="hidden" name="signature" value='<?php echo $signature; ?>'/>
      <input type="hidden" name="orderNote" value='<?php echo $orderNote; ?>'/>
      <input type="hidden" name="orderCurrency" value='<?php echo $orderCurrency; ?>'/>
      <input type="hidden" name="customerName" value='<?php echo $customerName; ?>'/>
      <input type="hidden" name="customerEmail" value='<?php echo $customerEmail; ?>'/>
      <input type="hidden" name="customerPhone" value='<?php echo $customerPhone; ?>'/>
      <input type="hidden" name="orderAmount" value='<?php echo $orderAmount; ?>'/>
      <input type ="hidden" name="notifyUrl" value='<?php echo $notifyUrl; ?>'/>
      <input type ="hidden" name="returnUrl" value='<?php echo $returnUrl; ?>'/>
      <input type="hidden" name="appId" value='<?php echo $appId; ?>'/>
      <input type="hidden" name="orderId" value='<?php echo $orderId; ?>'/>
  </form>
</body>
</html>

Also, is the script setup properly?

you can post value like this /test/demo_form.php?name1=value1&name2=value2

1 Like

Thanks for replying. Can you show me this in blocks please? I am not able to understand

I have not used this in my application, I have used this in php script in to send notification and to add a dynamic link in notification

blocks(62)
I have also added the payment method in one my app, this will help u

1 Like

Searching now about This subject …
:eyes::mag:

+50 Results about …

Did You Search ?

There are many examples here in this amazing community .

Look :point_down:

https://community.kodular.io/search?context=topic&context_id=162866&q=POST%20web%20Component&skip_context=true

2 Likes

You are too good you learned me about api 1 year back :blush:

1 Like

@Rogerio_Rios you learned me an I tried a lot of api and now working on crypto app :sweat_smile:

Also if you learn me schema template it will be good