cancel
Showing results for 
Search instead for 
Did you mean: 

Amount Update for ARB Subscription

Hi,

 

I am trying to update plan amount for one of the subscription ID i.e., for example user wanted to upgrade to advanced plan starting next month and he clicked on Update Subscription I would like to update the amount to 75$ from the current 50$.

 

I did call the ARBUpdateSubscription method with parameter as subscriptionID and the amount field in ARBSubscriptionType. Although I get the responseType as OK I do not see the amount getting updated in my subscription.

 

Please help!

 

Thanks,

Hemanth

1 ACCEPTED SOLUTION

Accepted Solutions

I figured out the issue i.e., whenever you are updating amount using Update Webmethod you also need to set subscription.AmountSpecified = true;

 

This resolved my problem.

 

Thanks,

Hemanth

View solution in original post

4 REPLIES 4

Post code, preferably in a code box (5th option from the left in Rich Text mode).

TJPride
Expert
public static bool UpdateSubscriptionPlan(long AuthsubscriptionID, decimal planAmount)
        {
            bool bResult = true;

            MerchantAuthenticationType authentication = PopulateMerchantAuthentication();

            ARBSubscriptionType subscription = new ARBSubscriptionType();
           
            UpdateSubscriptionforAmount(subscription, planAmount);

            ARBUpdateSubscriptionResponseType response;
            response = _webservice.ARBUpdateSubscription(authentication, AuthsubscriptionID, subscription);

            if (response.resultCode == MessageTypeEnum.Ok)
                bResult = true;
            else
                bResult = false;

            return bResult;
        }


 private static void UpdateSubscriptionforAmount(ARBSubscriptionType subscription, decimal planAmount)
        {
            subscription.amount = planAmount;
        }

 Please help!

Only the subscription ID is required, so it's possible something is going wrong with the amount assignment and then no amount is being passed and therefore nothing is being updated even though you get back a success code. My advice would be to do a dump of the data just before it's passed to Authorize.net and then a dump of what comes back, so you can take a look and be 100% sure you know what's going on.

I figured out the issue i.e., whenever you are updating amount using Update Webmethod you also need to set subscription.AmountSpecified = true;

 

This resolved my problem.

 

Thanks,

Hemanth