Start a new topic
Answered

Custom Klarna Payment method

I am making a payment module. To do this I copied the Klarna Euro module, and modified it for the latest Klarna Checkout API version. I have stepped through the ProcessPayment method, and that looks very good.


On the client side this exception appears:

 VirtoCommerce.Client.Client.ApiException: Missing required parameter 'bankCardInfo' when calling OrderModuleProcessOrderPayments

 

I am using PaymentMethodType.PreparedForm and PaymentMethodGroupType.Alternative.

 

Do I need to insert an empty bankCardInfo somewhere, as this payment method do not use any card details?


Best Answer

For now (v2.9) you should pass an empty bankCardInfo.

In the next release (v2.10) this parameter will be optional since there are payment methods which do not require a bank card.


It might be versions mismatch.

What is your VirtoCommerce Manger version and VirtoCommerce.Client version?

I don’t know the version, but I dowloaded it all in one go from gitHub on March 18th.


I looked in the current master as well, and found this:

In the cart controller, PaymentForm this line is used

var processingResult = await _orderApi.OrderModuleProcessOrderPaymentsAsync(null, order.Id, incomingPayment.Id);

Always null for the cardInfo.

In the OrderModuleApi.cs OrderModuleProcessOrderPaymentsAsync does this check

if (bankCardInfo == null) throw new ApiException(400, "Missing required parameter 'bankCardInfo' when calling OrderModuleProcessOrderPayments");

Meaning it will always throw in my opinion.


I am very new to this platform, so I may of course be totally wrong.

Answer

For now (v2.9) you should pass an empty bankCardInfo.

In the next release (v2.10) this parameter will be optional since there are payment methods which do not require a bank card.


1 person likes this
Login or Signup to post a comment