SpiceLogic Inc.
                                                                                                     SpiceLogic Inc. Home PageProductsJournalMy AccountHelp DeskContact Us
 
Knowledge base  : ASP.NET PayPal Control for Website Payments Standard    - Standard Edition
Welcome Guest   Login

Skip Navigation Links. ASP.NET PayPal Control for Website Payments Standard

Documentation  Documentation

Download   Download the latest version

Back to the home of knowledgebase forum Do you get IPN notification for cancelled subscriptions?

An user   8/30/2010 1:50:00 AM

Do you get IPN notification for cancelled subscriptions? Thanks Craig


Resolution:
- [SpiceLogic Support Technician]   8/30/2010 2:01:18 AM

Dear Craig,
Yes, whenever an user cancel subscription, an IPN is notified by PayPal and as soon as your website's Control hosting url is not changed, the control will capture the notification and fire IPN_Notified event. The event argument object will contain the information about this Cancellation event. Here is a sample code that illustrates this concept:
 
 
 protected void SubscriptionButton1_IPN_Notified(object sender, SubscriptionIPNNotifiedEventArgs e)
    {
        if(e.IPN.Status == PayPalIPN.StatusCodes.Verified)
        {
            // Verified... 
 
            if(e.TransactionType == TransactionTypes.Subscr_SignUp)
            {
                // New Subcription sign up.
                string subscriptionName = e.SubscriptionInfo.SubscriptionName;
                string subscriptionNumber = e.SubscriptionInfo.SubscriptionNumber;
                decimal trialAmount1 = e.SubscriptionInfo.TrialAmount1;
                decimal trialPeriod1 = e.SubscriptionInfo.TrialPeriod1;
                PeriodUnit trialPeriod1Unit = e.SubscriptionInfo.TrialPeriod1Unit;
 
                decimal regularRate = e.SubscriptionInfo.RegularRate;
                int regularBillingCycle = e.SubscriptionInfo.BillingCycle;
                PeriodUnit regularBillingCycleUnit = e.SubscriptionInfo.BillingCycleUnit;
                //etc.......
                // etc.......
 
            }
            else if (e.TransactionType == TransactionTypes.Subscr_Payment)
            {
                // A payment has been made by the subscription (subscription payment)
                decimal payment = e.PaymentInfo.McGross;
                if(e.PaymentInfo.PaymentStatus == IPNPDTPaymentInfo.PaymentStatusValues.Completed)
                {
                    // payment completed.
                    // Implement your business logic.
                }
            }
            else if (e.TransactionType == TransactionTypes.Subscr_Modify)
            {
                // Subscription modification.
            }
            else if (e.TransactionType == TransactionTypes.Subscr_Failed)
            {
                // Subscription payment failure.
            }
            else if(e.TransactionType == TransactionTypes.Subscr_Cancel)
            {
                // Subscription cancellation
            }
            else if(e.TransactionType == TransactionTypes.Subscr_EOT)
            {
                // Subscription’s end-of-term.
            }
            else
            {
                // Default Logic.
            }
        }
    }



Home  || Products  || Journal  || My Account  || HelpDesk  || Contact Us

Website and Software Copyright ©2010, SpiceLogic Inc., All Rights Reserved.