How command pool works? and How can we redirect to payment gateway? Magento 2

Do f-stop and exposure time perfectly cancel?

Could you please stop shuffling the deck and play already?

Declaring and defining template, and specialising them

How to secure an aircraft at a transient parking space?

What are the threaded holes in Manfrotto camera brackets?

Intuition behind counterexample of Euler's sum of powers conjecture

Are babies of evil humanoid species inherently evil?

Is it possible to avoid unpacking when merging Association?

Distinction between apt-cache and dpkg -l

How to draw cubes in a 3 dimensional plane

How can I ensure my trip to the UK will not have to be cancelled because of Brexit?

Plausibility of Mushroom Buildings

Can I pump my MTB tire to max (55 psi / 380 kPa) without the tube inside bursting?

Why does Captain Marvel assume the people on this planet know this?

Definition of Statistic

How to write ı (i without dot) character in pgf-pie

Difference on montgomery curve equation between EFD and RFC7748

Reversed Sudoku

Why doesn't this Google Translate ad use the word "Translation" instead of "Translate"?

UART pins to unpowered MCU?

meaning and function of 幸 in "则幸分我一杯羹"

Examples of a statistic that is not independent of sample's distribution?

They call me Inspector Morse

How to detect if C code (which needs 'extern C') is compiled in C++



How command pool works? and How can we redirect to payment gateway? Magento 2














0















I'm integrating a payment gateway using gateway command pool.



This is di.xml



<virtualType name="AuthorizeCommand" type="MagentoPaymentGatewayCommandGatewayCommand">
<arguments>
<argument name="requestBuilder" xsi:type="object">AuthorizationRequest</argument>
<argument name="transferFactory" xsi:type="object">InternationalSampleGatewayHttpTransferFactory</argument>
<argument name="client" xsi:type="object">InternationalSampleGatewayHttpClientClientMock</argument>
</arguments>
</virtualType>


This is TransferFactory.php



public function create(array $request) {

return $this->transferBuilder
->setBody($request)
->setMethod('Curl::POST')
->setHeaders(['Content-Type' => 'application/json'])
->setUri('https://api-gateway-sample-payments.com/transactions')
->build();
}


This is ClientMock.php



public function placeRequest(TransferInterface $transferObject)
{
//response
}


How to get CURL response in placeRequest?
How can we redirect to payment gateway page after this CURL operation?



Please advise, I have been in a circle for days, less sleep and its catching the dateline..



Thanks









share



























    0















    I'm integrating a payment gateway using gateway command pool.



    This is di.xml



    <virtualType name="AuthorizeCommand" type="MagentoPaymentGatewayCommandGatewayCommand">
    <arguments>
    <argument name="requestBuilder" xsi:type="object">AuthorizationRequest</argument>
    <argument name="transferFactory" xsi:type="object">InternationalSampleGatewayHttpTransferFactory</argument>
    <argument name="client" xsi:type="object">InternationalSampleGatewayHttpClientClientMock</argument>
    </arguments>
    </virtualType>


    This is TransferFactory.php



    public function create(array $request) {

    return $this->transferBuilder
    ->setBody($request)
    ->setMethod('Curl::POST')
    ->setHeaders(['Content-Type' => 'application/json'])
    ->setUri('https://api-gateway-sample-payments.com/transactions')
    ->build();
    }


    This is ClientMock.php



    public function placeRequest(TransferInterface $transferObject)
    {
    //response
    }


    How to get CURL response in placeRequest?
    How can we redirect to payment gateway page after this CURL operation?



    Please advise, I have been in a circle for days, less sleep and its catching the dateline..



    Thanks









    share

























      0












      0








      0








      I'm integrating a payment gateway using gateway command pool.



      This is di.xml



      <virtualType name="AuthorizeCommand" type="MagentoPaymentGatewayCommandGatewayCommand">
      <arguments>
      <argument name="requestBuilder" xsi:type="object">AuthorizationRequest</argument>
      <argument name="transferFactory" xsi:type="object">InternationalSampleGatewayHttpTransferFactory</argument>
      <argument name="client" xsi:type="object">InternationalSampleGatewayHttpClientClientMock</argument>
      </arguments>
      </virtualType>


      This is TransferFactory.php



      public function create(array $request) {

      return $this->transferBuilder
      ->setBody($request)
      ->setMethod('Curl::POST')
      ->setHeaders(['Content-Type' => 'application/json'])
      ->setUri('https://api-gateway-sample-payments.com/transactions')
      ->build();
      }


      This is ClientMock.php



      public function placeRequest(TransferInterface $transferObject)
      {
      //response
      }


      How to get CURL response in placeRequest?
      How can we redirect to payment gateway page after this CURL operation?



      Please advise, I have been in a circle for days, less sleep and its catching the dateline..



      Thanks









      share














      I'm integrating a payment gateway using gateway command pool.



      This is di.xml



      <virtualType name="AuthorizeCommand" type="MagentoPaymentGatewayCommandGatewayCommand">
      <arguments>
      <argument name="requestBuilder" xsi:type="object">AuthorizationRequest</argument>
      <argument name="transferFactory" xsi:type="object">InternationalSampleGatewayHttpTransferFactory</argument>
      <argument name="client" xsi:type="object">InternationalSampleGatewayHttpClientClientMock</argument>
      </arguments>
      </virtualType>


      This is TransferFactory.php



      public function create(array $request) {

      return $this->transferBuilder
      ->setBody($request)
      ->setMethod('Curl::POST')
      ->setHeaders(['Content-Type' => 'application/json'])
      ->setUri('https://api-gateway-sample-payments.com/transactions')
      ->build();
      }


      This is ClientMock.php



      public function placeRequest(TransferInterface $transferObject)
      {
      //response
      }


      How to get CURL response in placeRequest?
      How can we redirect to payment gateway page after this CURL operation?



      Please advise, I have been in a circle for days, less sleep and its catching the dateline..



      Thanks







      magento2 redirect payment-gateway curl





      share












      share










      share



      share










      asked 1 min ago









      Vinu SebastianVinu Sebastian

      1637




      1637






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2fmagento.stackexchange.com%2fquestions%2f265387%2fhow-command-pool-works-and-how-can-we-redirect-to-payment-gateway-magento-2%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 Magento Stack Exchange!


          • 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%2fmagento.stackexchange.com%2fquestions%2f265387%2fhow-command-pool-works-and-how-can-we-redirect-to-payment-gateway-magento-2%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







          Popular posts from this blog

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...