How to check webhook in sandbox for squareup payment gateway










0














I am trying to implement webhook listener when a user make a payment using PHP CURL.
Here is my code



$ch = curl_init();
$data = array(
"["PAYMENT_UPDATED"]",
);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer sandbox-12346789899", "Content-type: application/jsonrn"));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_URL, "https://connect.squareup.com/v1/my_sandbox-location_id/webhooks");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);


But i am getting Sandbox is not supported for Connect V1 API endpoints error. Please help how i can test payment notification webhook using my sandbox account.










share|improve this question




























    0














    I am trying to implement webhook listener when a user make a payment using PHP CURL.
    Here is my code



    $ch = curl_init();
    $data = array(
    "["PAYMENT_UPDATED"]",
    );
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer sandbox-12346789899", "Content-type: application/jsonrn"));
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_URL, "https://connect.squareup.com/v1/my_sandbox-location_id/webhooks");
    //return the transfer as a string
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    // $output contains the output string
    $output = curl_exec($ch);


    But i am getting Sandbox is not supported for Connect V1 API endpoints error. Please help how i can test payment notification webhook using my sandbox account.










    share|improve this question


























      0












      0








      0







      I am trying to implement webhook listener when a user make a payment using PHP CURL.
      Here is my code



      $ch = curl_init();
      $data = array(
      "["PAYMENT_UPDATED"]",
      );
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer sandbox-12346789899", "Content-type: application/jsonrn"));
      curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
      curl_setopt($ch, CURLOPT_URL, "https://connect.squareup.com/v1/my_sandbox-location_id/webhooks");
      //return the transfer as a string
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      // $output contains the output string
      $output = curl_exec($ch);


      But i am getting Sandbox is not supported for Connect V1 API endpoints error. Please help how i can test payment notification webhook using my sandbox account.










      share|improve this question















      I am trying to implement webhook listener when a user make a payment using PHP CURL.
      Here is my code



      $ch = curl_init();
      $data = array(
      "["PAYMENT_UPDATED"]",
      );
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer sandbox-12346789899", "Content-type: application/jsonrn"));
      curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
      curl_setopt($ch, CURLOPT_URL, "https://connect.squareup.com/v1/my_sandbox-location_id/webhooks");
      //return the transfer as a string
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      // $output contains the output string
      $output = curl_exec($ch);


      But i am getting Sandbox is not supported for Connect V1 API endpoints error. Please help how i can test payment notification webhook using my sandbox account.







      api curl webhooks square-connect






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 18:25









      tiagoperes

      2,20521734




      2,20521734










      asked Nov 12 at 12:03









      mubashir

      3222623




      3222623






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. You can test them with fake cash payments with your production credentials however.






          share|improve this answer




















          • Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
            – mubashir
            Nov 12 at 16:41










          • Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
            – tristansokol
            Nov 12 at 17:01










          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%2f53261799%2fhow-to-check-webhook-in-sandbox-for-squareup-payment-gateway%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. You can test them with fake cash payments with your production credentials however.






          share|improve this answer




















          • Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
            – mubashir
            Nov 12 at 16:41










          • Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
            – tristansokol
            Nov 12 at 17:01















          0














          Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. You can test them with fake cash payments with your production credentials however.






          share|improve this answer




















          • Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
            – mubashir
            Nov 12 at 16:41










          • Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
            – tristansokol
            Nov 12 at 17:01













          0












          0








          0






          Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. You can test them with fake cash payments with your production credentials however.






          share|improve this answer












          Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. You can test them with fake cash payments with your production credentials however.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 at 16:29









          tristansokol

          3,2231724




          3,2231724











          • Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
            – mubashir
            Nov 12 at 16:41










          • Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
            – tristansokol
            Nov 12 at 17:01
















          • Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
            – mubashir
            Nov 12 at 16:41










          • Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
            – tristansokol
            Nov 12 at 17:01















          Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
          – mubashir
          Nov 12 at 16:41




          Thank you for the reply. Can you tell me how to make fake cash payments with production credentials.
          – mubashir
          Nov 12 at 16:41












          Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
          – tristansokol
          Nov 12 at 17:01




          Use a mobile device signed into the same square account and then take a cash payment. It will trigger the webhooks because it is a production payment.
          – tristansokol
          Nov 12 at 17:01

















          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%2f53261799%2fhow-to-check-webhook-in-sandbox-for-squareup-payment-gateway%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







          這個網誌中的熱門文章

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

          Node.js Script on GitHub Pages or Amazon S3

          Museum of Modern and Contemporary Art of Trento and Rovereto