The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

subscription cancel

itisnot_meitisnot_me Member
in Help edited April 2010
ok i think that i am missing something. i have been to the subscription wiki and did a search on the forums but i am lost.

i have been working with the datafeed and subscription testing but i cant figure out how to cancel a subscription through the sub_token_url after i did activate it on foxy cart. i added sub_cancel=true to the url to cancel the subscription but when i make the quantity zero it just empties the cart and i cant move forward. but when i leave the amount the same and proceed and confirm the order it just post to the datafeed as it was a new transaction.

i am also confused about Future Subscriptions: -$5.00 added before the total.

HELP
Comments
  • brettbrett FoxyCart Team
    Sorry for the confusion. We're exploring ways of making sub management easier in the future.

    The thing with the sub_token and a cancellation is that you still have to go through checkout. This is partly to ensure that only an authenticated user can cancel a sub, and partly to ensure any past due amounts are paid. So you probably want to add a cart=checkout to the sub_token and sub_cancel=true in the URL. This'll go straight to checkout.

    Does that at least help conceptually a little bit?
  • so what you are saying is that is should add &cart=checkout and &sub_cancel=true to the url after sub_token so they go directly to the cancel checkout and not see the cart. if that is right then if they dont have an outstanding balance can i make it so that the credit cart info is not showing. to me it makes it look like they are making a payment. and if i think that then i know my customers would think that way.

    also i am looking at the data processed by the datafeed and it seems that it processed it as if they made a new purchase. i dont have the isset post data for subscriptions canceled but it still should not process it as a new purchase cause that will mess things up on my end of logins
  • brettbrett FoxyCart Team
    Good questions, and fwiw we're discussing improving this in our next release.

    Yes, you could hide the payment info, but it'd require just a little javascript. More info from this thread:
    http://forum.foxycart.com/comments.php?DiscussionID=2658&page=1
    with the relevant script:
    http://pastie.org/894785
    That script basically checks to see if you're canceling (based on the JSON's warning string) and if so, it does something. You'd want to replace the CSC bit with adding a .hide() on the payment fieldset... actually, not the whole fieldset, but the necessary credit card fields. Let us know if you need help on that.

    As far as the datafeed, it will come through in the normal datafeed, but you can add a check to see what the sub enddate and total values are, and skip it if it's a canceling sub. It'll also come through (the next day) in the sub XML:
    http://wiki.foxycart.com/docs:subscription_datafeed

    Worth noting is that you can immediately cancel a subscription using the API:
    http://wiki.foxycart.com/docs:api

    That's a very different approach, but it's possible and may be very desirable in some situations.

    Also worth noting, like I said, is that we're looking at improving this, so if you have ideas now's the time to share them. We're big on feedback.
  • itisnot_meitisnot_me Member
    edited April 2010
    thanks for the start on the jquery cc hide this is the modified code that i made
    if (fc_json.messages.warnings[0].search('You are about to set this subscription to end on') >= 0) {
    if (jQuery("#order_total").val() == "0.00"){
    jQuery("#fc_payment_list").hide();
    jQuery("#fc_payment_container h2").hide();
    }
    }
    

    maybe in the future version that could be a default thing. to hide the CC fields if there is not outstanding balance.

    ok so on the regular data feed i should check to see if subscription_end_date is set to 0000-00-00, and if it is then run my regular code, and if it is not then just return foxy and do nothing. then once i actually get my subscription data feed post code up it will send the next day saying that the account is canceled and i can then delete the users. Right?
  • brettbrett FoxyCart Team
    Sorry for the delayed response.

    As far as the enddate goes, you may need to confirm or take into account the possibility of an enddate being set but _not_ being today/tomorrow. For example, if you have an enddate for next month, you may need to take some action. It might make more sense to check the sub enddate and the order total before you just decide to do nothing with a transaction though.

    But yes, the subscription XML datafeed is probably what will be more useful. That'll tell you what's cancelled and you can take whatever action you'd like to there.

    Worth noting is that you can use the API to deactivate a subscription immediately, and that will _NOT_ send the subscription through in the sub XML datafeed. The logic is that if you're using the API then you already know that you're canceling it, and don't need FoxyCart to tell you what you already know you did on your end.

    Does that make sense? Let us know if anything is still unclear (and I apologize if that's the case).
  • well just based on what i have tested out that the end date will be the next day and i am fine with that. i dont have it so they can cancel there subscription a month in advance. that just does not make sense to me. and when it cancels it will be sent through FoxySubscriptionData and there i can modify there account with a script.

    i dont want to mess with an api. i want to use the cart as is unless it is jquery tweak.

    so just to ultra to the max confirm...haha...just look to see if there is no end date. if there is just return foxy but if there is none create the account...

    also i have a question beyond canceling. how would i go about updating a subscription amount per the customer. (example if they want to buy more users to there account). i was testing out the subtoken link to add more quantity but it was _NOT_ making it so that they will be charged now and then the updated amount will be charged on the next billing cycle. it was giving me this Future Subscriptions thing with a negative amount
  • brettbrett FoxyCart Team
    I'll let Luke chime in about the absolutely ultra to the super max confirmation, but for the sub_token stuff:

    What it _doesn't_ do is partial billing or anything based on the prices and the next bill dates, which sounds like what you're expecting? If you have a $20/mo subscription set to run on the 10th, and you load the sub_token up on the 20th, you can make changes but the next date will be the upcoming 10th (of the next month). It won't try to add a partial charge to cover any changes between the 20th and the next 10th, because that just gets way too much into business logic and would be kind of insane to automate. Some products you can't do partial billing, some might necessitate discounts or refunds, etc.

    So instead of that it just indicates that a certain amount will be charged in the future. We're definitely open to exploring ways to improve how this is communicated, so just let us know what you think about it all.
  • alright that makes sense. but from a business logic we kind of need that. we dont want the customer to find out that if they buy a certain amount of user logins then right away update there amount to more than that they have, and get a month of updated user logins for free. And if they catch on they can downgrade before there charge date then up it after. I like thinking like people that look for loop holes. it protects myself.

    Im thinking that the subscription part can be better improved (not saying that it is bad). Even if us as developers have to do some elbow grease to help it get improved. For example on my site they will have a secure login that has a page with there payment info. And if they want to upgrade the amount of users they have, they enter how many then press submit. I then can make a script that can calculate what the prorate for now until there next billing cycle is and then pass it off to foxycart in a link (which could be encrypted). which they then enter there email and password. confirm that they will be charged a prorate now and they next billing cycle there payment due will be *some number*.

    hey i would even pay a little extra for that feature seeing how i would be processing more payments than the average user. (statement not confirmed by anyone..lol)
  • lukeluke FoxyCart Team
    Stay tuned for our next release (061). It has a LOT of subscription improvements including the ability to modify the transaction template of the subscription directly via XML through the API (and the admin) so you could prorate and all kinds of things by adding line items as needed to the subscription template for one month. Anyway, stay tuned.
  • hey luke. i havent seen activity info on 6.1 when might we roughly see it?
  • lukeluke FoxyCart Team
    We don't usually give release dates because they can often create expectations and frustrations for people if we don't hit the date exactly and we'd rather have things "right" as opposed to rushing to meet a schedule. As to when... hopefully in the next couple months, but we're also finding and fixing small issues as they come up as well. The scope on 061 grew quite a bit from the original plan and now includes link form encryption, CDN integration and paypal express subscriptions (which we haven't started yet) so... no guarantees. We also want to make more improvements to the API (and the admin) for retrieving multiple transactions (instead of just a single get). Keep an eye on the forum and we'll announce when it's available for beta testing.
  • understandable. so in the mean time in the FoxyData post would i check to see if there is an end date (if they cancel it will end the next day) and if there is then return foxy? and if there is none i can run the other commands like creating the new user. Also how would i beable to distinguish between a brand new transaction and an updated one (either updated CC or address info to more user subscriptions added on)?
  • brettbrett FoxyCart Team
    Sorry, I should have mentioned that if you did want to do a prorated interim charge you could definitely pull that off like you're describing. Do the math and add the appropriate proration to the cart, direct to checkout, et viola. Ensuring that the proration doesn't get removed by a nefarious user is a little trickier, but at that point I'd say throw a quick bit of javascript in there to ensure that a subscription with a future start date is accompanied by an appropriate proration product (check against the JSON), but ultimately do a test in your XML datafeed processor to detect any foul play.

    You bring up good points, definitely.
  • ok cool. so what i would have to do is do my math then send it through the url. But what variable would i send it through in &price ? is there any documentation on this function.

    i think that if i send through a variable in the link that determines that it is a prorate and then i could use some javascript to check that there is a price and maybe encrypt (not really the word but some crazy string) the value of the prorate variable to also include the price and make sure that it matches up. What you think on that?
  • brettbrett FoxyCart Team
    It'd basically be 2 separate products: The subscription, future dated, and the prorated charge payable now.

    As far as encrypting, check the sticky post. That's coming in our next release. In the meantime the best thing to do would be:
    1) Javascript check on the checkout to ensure any future-dated subscriptions also have a prorated line-item one-time charge. If they don't perhaps automatically re-add it or disable checkout. Really though, you'd want...
    2) Check against the XML datafeed. If somebody does tamper with things, just check and shoot an email notification out alerting the store admin.

    Make sense? Not ideal, perhaps, but I'm still not sure how to handle prorations automatically in a way that'd be flexible enough for everybody.
  • long time no talk. man life is busy.

    well i still dont know how to push it to prorate to pay now and set the future subscription updated.

    on the automatically handle prorates could just be sent as a few variables in the link. (i am aware of ie retardedness in regards to url limit) like prorate=yes and prorateprice=48.00 then have it as subscriptionupdate=146.00. Or maybe just have us do a post to foxycart checkout like we do the cart. at a programming php stand point that is how i would think about doing it. you first run the prorate then the rest of cart functionality. but we would have to declare it as a prorate with a subscription update ammount or it returns error
  • brettbrett FoxyCart Team
    Hey @itisnot_me
    Can you clarify that a little? I think I get the gist, but I'm having difficulty understanding how you're putting the pieces together. I haven't been getting much sleep lately, so that's probably a contributing factor.
  • lack of sleep never helps.

    the bottom part of my message was me trying to help with automatic prorate payments with updated subscription amounts. from my stand point if we declare a variable to be prorate=yes and then have the prorateamount=amount. then declare the subscriptionamount=updated amount and the subscriptiondate=the date that went through the datafeed

    the first part was me not knowing how to send through prorate and make the subscription amount be updated like you said could be done.

    p.s. we need a better wiki. (not blaming you at all) but we need to spend some quality time on it
  • brettbrett FoxyCart Team
    I think maybe we should split this discussing in half. The first part would be how to achieve a proration at this point using existing functionality. Do you need that? Or are we just kind of brainstorming?

    The second part would be the brainstorming. I think before we approach how it'd be passed into the cart we should discuss how the pro-rated amounts would work. Is it something like you want to set the startdate to the first of each month, but you want people to be able to signup whenever? Or is it a different situation?
  • yes i still am lost on how to do a prorate
  • brettbrett FoxyCart Team
    Ok, so if you wanted to prorate, you'd use javascript or a server side language to determine the appropriate amount to bill. Then you'd just add that to the cart at the same time as the subscription. Then if you needed to you could make sure that one isn't removed without removing the other.

    Do you have a mockup or HTML that we can work with? It's easier to use a real example than something contrived.
Sign In or Register to comment.