Posted on 09/02/2023 07:41:13
Hi Imar,
Well, I don't think that I am really good in AltaPay, but I will try to help.
Could you please describe the problem step by step to help me reproduce it on my local solution?
So, you use SubscriptionAndCharge, and then create the reccuring order, right?
From which moment do you have a problem? I need to understand the situation to reproduce it somehow and probably find the way to fix it.
These are all existed payment methods in AltaPay: https://documentation.altapay.com/Content/Ecom/Reference/Payment%20request%20type.htm
About the SubscriptionAndCharge payment method.
It looks like that we planned to introduce it somehow, but in fact it probably doesn't work as intended. Nicolai is right that this payment method need to set the agreement, but it is not mandatory. According to documentation, it sets the agreement type to recurring if nothing was passed from the request.
Looks like that the functionality of this command is to automate the subscribtion (we can set the interval and the expire date - much like we do for recurring orders in Dynamicweb. But we already have such functionality in our Dynamicweb implementation, so we don't need it).
-----
The IRecurring.Recurring of our AltaPay provider works differently. It does the charge subscription request (see: https://documentation.altapay.com/Content/Ecom/API/API%20Methods/chargeSubscription.htm)
In the code we set the amount to capture which is equal to the total order price:
And if result is ok, than we mark the order as captured, because we captured the full order price. It's totally ok. It works as intended.
So first we call the createPaymentRequest command with SubscriptionAndCharge type agrument, and then we call chargeSubscription for each of recurring orders.
Maybe the problem in the SubscriptionAndCharge. I recommend to use another payment type:
If we set payment type to be a "subscription", then we need to manually call "chargeSubscription" requests for each recurring orders - as we already do. So I believe that it will work ok with this type of setting.
Please try to use it, maybe it fix your problem.
Maybe I don't understand your situation, so I still need an additional information to reproduce the problem. Sorry if I didn't help you, but I will try again when I have some data to analyze.
Kind regards.