コード例 #1
0
        public Boolean Suspend(string profileId)
        {
            Boolean result = false;
            if (!String.IsNullOrEmpty(profileId))
            {
                NvpManageRecurringPaymentsProfileStatus action = new NvpManageRecurringPaymentsProfileStatus();
                SetDefaults(action);

                action.Add(NvpManageRecurringPaymentsProfileStatus.Request.PROFILEID, profileId);
                action.Add(NvpManageRecurringPaymentsProfileStatus.Request.ACTION, NvpStatusChangeActionType.Suspend);
                result = action.Post();
                if (!result)
                    throw PaypalException.GenerateException(action);
            }

            return result;
        }
コード例 #2
0
        public Boolean Cancel(string profileId)
        {
            Boolean result = true;
            if (!String.IsNullOrEmpty(profileId))
            {
                //Make sure the profile isn't already cancelled...
                PaypalProfileInfo info = GetProfileInfo(profileId);
                if (!info.IsCancelled)
                {
                    NvpManageRecurringPaymentsProfileStatus action = new NvpManageRecurringPaymentsProfileStatus();
                    SetDefaults(action);

                    action.Add(NvpManageRecurringPaymentsProfileStatus.Request.PROFILEID, profileId);
                    action.Add(NvpManageRecurringPaymentsProfileStatus.Request.ACTION, NvpStatusChangeActionType.Cancel);
                    result = action.Post();
                    if (!result)
                        throw PaypalException.GenerateException(action);
                }
            }

            return result;
        }