PayU Confirmation page not being called










0














EDIT: Using curl I found out the problem is echo... echo is for printing on screen and not for this use case.. the problem still persist how could I call javascript functions to update my firebase database



EDIT 2 : I just found out Cloud Functions may be the right fit for me, without having to install the firebase admin sdk. I will update with some answer when I learn how to use cloud functions. If anyone can give me an answer with cloud functions for my scenario I will gladly choose it as answer.



I have a problem with the PayU confirmation page. This is the info they provide in their website for integration.




The confirmation page lets you update the databases on your system. Because of this, it should not include HTML code and will never be visible to the buyer. This page is optional. When a transaction is complete (i.e. when approved, rejected or when it is canceled) our platform sends the variables via the HTTP POST method. In the confirmation page, you must capture the data that you want stored in the database. This capture will depend on the programming language used.




This is my code for capturing the information... Its even a copy of already working code but with the exception I use javascript to update my database, since I am using firebase.



<script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
<script>
// Initialize Firebase
var config =
apiKey: "apikey",
authDomain: "domain",
databaseURL: "database",
projectId: "poject",
storageBucket: "storage",
messagingSenderId: "123"
;
firebase.initializeApp(config);


function seachEnsayoIDSSC(identifier)

var updates = ;
updates['/recibido/' + identifier ] = 'funciono';

return firebase.database().ref().update(updates);

let ref = firebase.database().ref('ensayos').orderByChild('ensayoId');

ref.equalTo(identifier).on("value", function(snapshot)
console.log(snapshot.val());
snapshot.forEach(function(data)
console.log(data.key);
);
);

</script>


<?php

$to = "testing@gmail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@testing.com";

mail($to,$subject,$txt,$headers);



echo "<script>var updates = ;
updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

firebase.database().ref().update(updates);</script>";

if(isset($_REQUEST['sign']))
echo "<script>var updates = ;
updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

firebase.database().ref().update(updates);</script>";

$confirmationMD = $_REQUEST['sign'];
$merchantId = $_REQUEST["merchant_id"];
$state = $_REQUEST["state_pol"];
$ensayoIDSSC = $_REQUEST["reference_sale"];
$currency = $_REQUEST["currency"];
$valor = $_REQUEST["value"];

updateEnsayo();


if ($_SERVER["REQUEST_METHOD"] == "POST")
echo "<script>var updates = ;
updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

firebase.database().ref().update(updates);</script>";

$merchantId = $_POST["merchant_id"];
$state = $_POST["state_pol"];
$ensayoIDSSC = $_POST["reference_sale"];
$currency = $_POST["currency"];
$valor = $_POST["value"];
$confirmationMD = $_POST["sign"];

updateEnsayo();


function updateEnsayo()
echo "<script>seachEnsayoIDSSC(". $ensayoIDSSC .")</script>";

?>


This is the form that PayU receives to capture the payment (EXAMPLE)



<form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/">
<input name="merchantId" type="hidden" value="508029" >
<input name="accountId" type="hidden" value="512321" >
<input name="description" type="hidden" value="Test PAYU" >
<input name="referenceCode" type="hidden" value="TestPayU" >
<input name="amount" type="hidden" value="20000" >
<input name="tax" type="hidden" value="3193" >
<input name="taxReturnBase" type="hidden" value="16806" >
<input name="currency" type="hidden" value="COP" >
<input name="signature" type="hidden" value="7ee7cf808ce6a39b17481c54f2c57acc" >
<input name="test" type="hidden" value="1" >
<input name="buyerEmail" type="hidden" value="test@test.com" >
<input name="responseUrl" type="hidden" value="http://www.test.com/response" >
<input name="confirmationUrl" type="hidden" value="http://www.test.com/confirmation" >
<input name="Submit" type="submit" value="Enviar" >
</form>


In the input 'confirmationUrl' I have set my url with the code previously mentioned. The problem here is that for unknown reasons I am not getting any updates on my firebase database nor even an email from the mail code. Indeed I am using my own email not the one in the code, and I have tested the url with a post request even without post request to check if it was working, and it was.. Please help! Thanks!










share|improve this question




























    0














    EDIT: Using curl I found out the problem is echo... echo is for printing on screen and not for this use case.. the problem still persist how could I call javascript functions to update my firebase database



    EDIT 2 : I just found out Cloud Functions may be the right fit for me, without having to install the firebase admin sdk. I will update with some answer when I learn how to use cloud functions. If anyone can give me an answer with cloud functions for my scenario I will gladly choose it as answer.



    I have a problem with the PayU confirmation page. This is the info they provide in their website for integration.




    The confirmation page lets you update the databases on your system. Because of this, it should not include HTML code and will never be visible to the buyer. This page is optional. When a transaction is complete (i.e. when approved, rejected or when it is canceled) our platform sends the variables via the HTTP POST method. In the confirmation page, you must capture the data that you want stored in the database. This capture will depend on the programming language used.




    This is my code for capturing the information... Its even a copy of already working code but with the exception I use javascript to update my database, since I am using firebase.



    <script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
    <script>
    // Initialize Firebase
    var config =
    apiKey: "apikey",
    authDomain: "domain",
    databaseURL: "database",
    projectId: "poject",
    storageBucket: "storage",
    messagingSenderId: "123"
    ;
    firebase.initializeApp(config);


    function seachEnsayoIDSSC(identifier)

    var updates = ;
    updates['/recibido/' + identifier ] = 'funciono';

    return firebase.database().ref().update(updates);

    let ref = firebase.database().ref('ensayos').orderByChild('ensayoId');

    ref.equalTo(identifier).on("value", function(snapshot)
    console.log(snapshot.val());
    snapshot.forEach(function(data)
    console.log(data.key);
    );
    );

    </script>


    <?php

    $to = "testing@gmail.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@testing.com";

    mail($to,$subject,$txt,$headers);



    echo "<script>var updates = ;
    updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

    firebase.database().ref().update(updates);</script>";

    if(isset($_REQUEST['sign']))
    echo "<script>var updates = ;
    updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

    firebase.database().ref().update(updates);</script>";

    $confirmationMD = $_REQUEST['sign'];
    $merchantId = $_REQUEST["merchant_id"];
    $state = $_REQUEST["state_pol"];
    $ensayoIDSSC = $_REQUEST["reference_sale"];
    $currency = $_REQUEST["currency"];
    $valor = $_REQUEST["value"];

    updateEnsayo();


    if ($_SERVER["REQUEST_METHOD"] == "POST")
    echo "<script>var updates = ;
    updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

    firebase.database().ref().update(updates);</script>";

    $merchantId = $_POST["merchant_id"];
    $state = $_POST["state_pol"];
    $ensayoIDSSC = $_POST["reference_sale"];
    $currency = $_POST["currency"];
    $valor = $_POST["value"];
    $confirmationMD = $_POST["sign"];

    updateEnsayo();


    function updateEnsayo()
    echo "<script>seachEnsayoIDSSC(". $ensayoIDSSC .")</script>";

    ?>


    This is the form that PayU receives to capture the payment (EXAMPLE)



    <form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/">
    <input name="merchantId" type="hidden" value="508029" >
    <input name="accountId" type="hidden" value="512321" >
    <input name="description" type="hidden" value="Test PAYU" >
    <input name="referenceCode" type="hidden" value="TestPayU" >
    <input name="amount" type="hidden" value="20000" >
    <input name="tax" type="hidden" value="3193" >
    <input name="taxReturnBase" type="hidden" value="16806" >
    <input name="currency" type="hidden" value="COP" >
    <input name="signature" type="hidden" value="7ee7cf808ce6a39b17481c54f2c57acc" >
    <input name="test" type="hidden" value="1" >
    <input name="buyerEmail" type="hidden" value="test@test.com" >
    <input name="responseUrl" type="hidden" value="http://www.test.com/response" >
    <input name="confirmationUrl" type="hidden" value="http://www.test.com/confirmation" >
    <input name="Submit" type="submit" value="Enviar" >
    </form>


    In the input 'confirmationUrl' I have set my url with the code previously mentioned. The problem here is that for unknown reasons I am not getting any updates on my firebase database nor even an email from the mail code. Indeed I am using my own email not the one in the code, and I have tested the url with a post request even without post request to check if it was working, and it was.. Please help! Thanks!










    share|improve this question


























      0












      0








      0







      EDIT: Using curl I found out the problem is echo... echo is for printing on screen and not for this use case.. the problem still persist how could I call javascript functions to update my firebase database



      EDIT 2 : I just found out Cloud Functions may be the right fit for me, without having to install the firebase admin sdk. I will update with some answer when I learn how to use cloud functions. If anyone can give me an answer with cloud functions for my scenario I will gladly choose it as answer.



      I have a problem with the PayU confirmation page. This is the info they provide in their website for integration.




      The confirmation page lets you update the databases on your system. Because of this, it should not include HTML code and will never be visible to the buyer. This page is optional. When a transaction is complete (i.e. when approved, rejected or when it is canceled) our platform sends the variables via the HTTP POST method. In the confirmation page, you must capture the data that you want stored in the database. This capture will depend on the programming language used.




      This is my code for capturing the information... Its even a copy of already working code but with the exception I use javascript to update my database, since I am using firebase.



      <script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
      <script>
      // Initialize Firebase
      var config =
      apiKey: "apikey",
      authDomain: "domain",
      databaseURL: "database",
      projectId: "poject",
      storageBucket: "storage",
      messagingSenderId: "123"
      ;
      firebase.initializeApp(config);


      function seachEnsayoIDSSC(identifier)

      var updates = ;
      updates['/recibido/' + identifier ] = 'funciono';

      return firebase.database().ref().update(updates);

      let ref = firebase.database().ref('ensayos').orderByChild('ensayoId');

      ref.equalTo(identifier).on("value", function(snapshot)
      console.log(snapshot.val());
      snapshot.forEach(function(data)
      console.log(data.key);
      );
      );

      </script>


      <?php

      $to = "testing@gmail.com";
      $subject = "My subject";
      $txt = "Hello world!";
      $headers = "From: webmaster@testing.com";

      mail($to,$subject,$txt,$headers);



      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      if(isset($_REQUEST['sign']))
      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      $confirmationMD = $_REQUEST['sign'];
      $merchantId = $_REQUEST["merchant_id"];
      $state = $_REQUEST["state_pol"];
      $ensayoIDSSC = $_REQUEST["reference_sale"];
      $currency = $_REQUEST["currency"];
      $valor = $_REQUEST["value"];

      updateEnsayo();


      if ($_SERVER["REQUEST_METHOD"] == "POST")
      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      $merchantId = $_POST["merchant_id"];
      $state = $_POST["state_pol"];
      $ensayoIDSSC = $_POST["reference_sale"];
      $currency = $_POST["currency"];
      $valor = $_POST["value"];
      $confirmationMD = $_POST["sign"];

      updateEnsayo();


      function updateEnsayo()
      echo "<script>seachEnsayoIDSSC(". $ensayoIDSSC .")</script>";

      ?>


      This is the form that PayU receives to capture the payment (EXAMPLE)



      <form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/">
      <input name="merchantId" type="hidden" value="508029" >
      <input name="accountId" type="hidden" value="512321" >
      <input name="description" type="hidden" value="Test PAYU" >
      <input name="referenceCode" type="hidden" value="TestPayU" >
      <input name="amount" type="hidden" value="20000" >
      <input name="tax" type="hidden" value="3193" >
      <input name="taxReturnBase" type="hidden" value="16806" >
      <input name="currency" type="hidden" value="COP" >
      <input name="signature" type="hidden" value="7ee7cf808ce6a39b17481c54f2c57acc" >
      <input name="test" type="hidden" value="1" >
      <input name="buyerEmail" type="hidden" value="test@test.com" >
      <input name="responseUrl" type="hidden" value="http://www.test.com/response" >
      <input name="confirmationUrl" type="hidden" value="http://www.test.com/confirmation" >
      <input name="Submit" type="submit" value="Enviar" >
      </form>


      In the input 'confirmationUrl' I have set my url with the code previously mentioned. The problem here is that for unknown reasons I am not getting any updates on my firebase database nor even an email from the mail code. Indeed I am using my own email not the one in the code, and I have tested the url with a post request even without post request to check if it was working, and it was.. Please help! Thanks!










      share|improve this question















      EDIT: Using curl I found out the problem is echo... echo is for printing on screen and not for this use case.. the problem still persist how could I call javascript functions to update my firebase database



      EDIT 2 : I just found out Cloud Functions may be the right fit for me, without having to install the firebase admin sdk. I will update with some answer when I learn how to use cloud functions. If anyone can give me an answer with cloud functions for my scenario I will gladly choose it as answer.



      I have a problem with the PayU confirmation page. This is the info they provide in their website for integration.




      The confirmation page lets you update the databases on your system. Because of this, it should not include HTML code and will never be visible to the buyer. This page is optional. When a transaction is complete (i.e. when approved, rejected or when it is canceled) our platform sends the variables via the HTTP POST method. In the confirmation page, you must capture the data that you want stored in the database. This capture will depend on the programming language used.




      This is my code for capturing the information... Its even a copy of already working code but with the exception I use javascript to update my database, since I am using firebase.



      <script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
      <script>
      // Initialize Firebase
      var config =
      apiKey: "apikey",
      authDomain: "domain",
      databaseURL: "database",
      projectId: "poject",
      storageBucket: "storage",
      messagingSenderId: "123"
      ;
      firebase.initializeApp(config);


      function seachEnsayoIDSSC(identifier)

      var updates = ;
      updates['/recibido/' + identifier ] = 'funciono';

      return firebase.database().ref().update(updates);

      let ref = firebase.database().ref('ensayos').orderByChild('ensayoId');

      ref.equalTo(identifier).on("value", function(snapshot)
      console.log(snapshot.val());
      snapshot.forEach(function(data)
      console.log(data.key);
      );
      );

      </script>


      <?php

      $to = "testing@gmail.com";
      $subject = "My subject";
      $txt = "Hello world!";
      $headers = "From: webmaster@testing.com";

      mail($to,$subject,$txt,$headers);



      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      if(isset($_REQUEST['sign']))
      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      $confirmationMD = $_REQUEST['sign'];
      $merchantId = $_REQUEST["merchant_id"];
      $state = $_REQUEST["state_pol"];
      $ensayoIDSSC = $_REQUEST["reference_sale"];
      $currency = $_REQUEST["currency"];
      $valor = $_REQUEST["value"];

      updateEnsayo();


      if ($_SERVER["REQUEST_METHOD"] == "POST")
      echo "<script>var updates = ;
      updates['/estoseestaprobandoenpost/estamosmaso' ] = 'funciono';

      firebase.database().ref().update(updates);</script>";

      $merchantId = $_POST["merchant_id"];
      $state = $_POST["state_pol"];
      $ensayoIDSSC = $_POST["reference_sale"];
      $currency = $_POST["currency"];
      $valor = $_POST["value"];
      $confirmationMD = $_POST["sign"];

      updateEnsayo();


      function updateEnsayo()
      echo "<script>seachEnsayoIDSSC(". $ensayoIDSSC .")</script>";

      ?>


      This is the form that PayU receives to capture the payment (EXAMPLE)



      <form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/">
      <input name="merchantId" type="hidden" value="508029" >
      <input name="accountId" type="hidden" value="512321" >
      <input name="description" type="hidden" value="Test PAYU" >
      <input name="referenceCode" type="hidden" value="TestPayU" >
      <input name="amount" type="hidden" value="20000" >
      <input name="tax" type="hidden" value="3193" >
      <input name="taxReturnBase" type="hidden" value="16806" >
      <input name="currency" type="hidden" value="COP" >
      <input name="signature" type="hidden" value="7ee7cf808ce6a39b17481c54f2c57acc" >
      <input name="test" type="hidden" value="1" >
      <input name="buyerEmail" type="hidden" value="test@test.com" >
      <input name="responseUrl" type="hidden" value="http://www.test.com/response" >
      <input name="confirmationUrl" type="hidden" value="http://www.test.com/confirmation" >
      <input name="Submit" type="submit" value="Enviar" >
      </form>


      In the input 'confirmationUrl' I have set my url with the code previously mentioned. The problem here is that for unknown reasons I am not getting any updates on my firebase database nor even an email from the mail code. Indeed I am using my own email not the one in the code, and I have tested the url with a post request even without post request to check if it was working, and it was.. Please help! Thanks!







      firebase firebase-realtime-database woocommerce google-cloud-functions payu






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 23:30

























      asked Nov 12 '18 at 19:17









      Rialcom

      97112




      97112






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268690%2fpayu-confirmation-page-not-being-called%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268690%2fpayu-confirmation-page-not-being-called%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3