Adyen GetWidget


I have installed the Adyen addon to support swish payments. I used the downloadable files from the documentation to implement the addon functionality.

The GetWidget method in AdyenPaymenyWidgetController.cs requires a Controller object as an argument. Our paymentmethodviewmodelbuilder does not pass a controller object to this method, only the current ordercarrier and paymentinfo.

The adyen getwidget looks like this:

My question is:

Can I get the required Origin property value (as seen in the image above) without the controller object? Or do I have to somehow refactor the call to getwidget to include it?

Thank you!

Litium version: 7

1 Like

This code is for previous to V7, as reference to KlarnaPaymentWidgetV2 or V3 you do not use Controller as parameter.

var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
var channelUri = new Uri(_urlService.GetUrl(_requestModelAccessor.RequestModel.ChannelModel.Channel, new ChannelUrlArgs() { AbsoluteUrl = true }));
1 Like


I encountered a follow up issue after your code above worked well.

The adyen api seems to expect the PaymentProviderName to be “SE AdyenCheckout”, when it is, in fact “SE AdyenPayment”, leading to the following error when the code is trying to call adyenApi.CreateOrUpdateOrderCarrier(orderCarrier);

The call throws:

“Payment info was not found. Expected PaymentProviderName = Adyen, PaymentMethodName=SE AdyenCheckout”

I checked the paymentprovidername and it is “SE AdyenPayment”.

I’m a bit at a loss on this. Is it a bug or am I missing something?

// Victor

Have you enabled the SDK checkout in the config file?

If HPP is enabled, you can select SE AdyenPayment as a payment option for the channel.
If SDK is enabled, you can select SE AdyenCheckout.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.