Sunday, May 3, 2015

Updating the Recurring Subscription Order for AspDotNetStoreFront


I was recently working on a project whereby a delay in a shipment required all of the recurring subscriptions in Authorize.Net to be cancelled or postponed.

Unfortunately, there is no easy way within AspDotNetStoreFront to reconfigure existing orders within the system to sync up with the new Authorize.Net recurring subscriptions that needed to be created due to this shipment delay.

Well, after doing a bit of digging into the database and some validation/verification, we were able to come up with a SQL Script whereby we could update the existing AspDotNetStoreFront orders to be replaced with the new Authorize.Net recurring subscription IDs!!

First you need to get the corresponding order and existing Recurring Subscription ID from the AspDotNetStoreFront system:

SELECT c.FirstName, c.LastName, c.CustomerID, sc.RecurringSubscriptionID, sc.UpdatedOn
FROM ShoppingCart sc
INNER JOIN Customer c
ON sc.CustomerID = c.CustomerID
WHERE RecurringSubscriptionID IS NOT NULL
AND c.FirstName = 'John'

Once you have that information, you can then match up that user’s record to update his associated Recurring Subscription ID that will match up to his record in Authorize.Net:

UPDATE ShoppingCart
SET RecurringSubscriptionID = 11111111
WHERE RecurringSubscriptionID = 22222222
Once you have done that, all you need to do is wait until the Authorize.Net Recurring Subscription kicks into effect and now your AspDotNetStoreFront orders will be once again synced up with your Authorize.Net Recurring Subscriptions!!

No comments:

Post a Comment