How to Redirect from PaymentService file to My Controller in shopware6

Hello Michael,

Thanks for the reference you are provided it’s really helpful. As you said I have got the return_URL from the AsyncPaymentTransactionStruct object. I have the Following questions based on generating the URL?

  1. I have created the sample URL by analyzing the PayPal module, I don’t know if it’s right are not?

    $url = $this->router->generate(‘custom.plugins.sample.test’,[‘sw-token’ => $this->shopToken],UrlGeneratorInterface::ABSOLUTE_URL);

  my module name " swag-sample" controller name " test" and action name " refund"

  1. And then forward to the generated URL by using this? 

    $this->forwardToRoute($url);

Please guide me to proceed further, I would be very grateful

Best Regards,

Charles