Payment Plugin With 3rd Party redirection Troubles

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi,

I'm developing a payement plugin. Everything is ok, till i try to redirect to Payment Gateway.
I've got a redirect url like : http://localhost/checkout/URLOFTHIRDParty

Any help?

10x at advance.
8 years ago
I've found the solution.
That was using URL.Encode method that causes the error.
I've just used simple URL without encoding and it works.
4 years ago
I am having trouble with redirecting to 3rd Party URL. It redirects to the cart url. Cant figure out why?

My code :

            

public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{

             var baseUrl = "https://example.com"
            _httpContextAccessor.HttpContext.Response.Redirect(baseUrl);

}

I would appreciate if anyone can help me.
4 years ago
How did you go ?
I add the code above to the top of the PayPalStandard Plugin (with a semicolon added ) as a test and it worked fine

        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {

            var baseUrl = "https://example.com";
            _httpContextAccessor.HttpContext.Response.Redirect(baseUrl);
            return;
3 years ago
Yidna wrote:
How did you go ?
I add the code above to the top of the PayPalStandard Plugin (with a semicolon added ) as a test and it worked fine

        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {

            var baseUrl = "https://example.com";
            _httpContextAccessor.HttpContext.Response.Redirect(baseUrl);
            return;



Please help my _httpContextAccessor is null
3 years ago
You'll have to injust _httpContextAccessor in the constructor.

// define the variable
private readonly IHttpContextAccessor _httpContextAccessor;

// instantiate
ctor(IHttpContextAccessor _httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
3 years ago
laazsx wrote:
You'll have to injust _httpContextAccessor in the constructor.

// define the variable
private readonly IHttpContextAccessor _httpContextAccessor;

// instantiate
ctor(IHttpContextAccessor _httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}


Thanks laazsx, I have looked at how the PayPalStandard plugin was written and done same. I have already defined and instantiated httpContextAccessor now I receive [quote]No constructor was found that had all the dependencies satisfied[/quote] error.

What did I do wrong?
3 years ago
Hutchful wrote:
You'll have to injust _httpContextAccessor in the constructor.

// define the variable
private readonly IHttpContextAccessor _httpContextAccessor;

// instantiate
ctor(IHttpContextAccessor _httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}

Thanks laazsx, I have looked at how the PayPalStandard plugin was written and done same. I have already defined and instantiated httpContextAccessor now I receive [quote]No constructor was found that had all the dependencies satisfied error.

What did I do wrong?


I have resolved my issue. I had to include NopStartup Infrastructure in plugin
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.