ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Subscription Purchases

September 16, 2011 4:13pm

Subscribe [3]
  • #1 / Sep 16, 2011 4:13pm

    IOS Admin

    33 posts

    It seems that three of the main e-commerce add-ons don’t support fully subscriptions. :(

    I was surprised to notice that the built-in Simple E-Commerce module does support basic subscriptions with PayPal. That’s actually what I need.

    However as EE is not highly focused on this module (since all of EE’s needs are considered) I am afraid to use it fearing lack of support and further development or possible deprecation.

    Any other options or support for using the built-in module. I was really surprised that it seemed to do basically what I need.

  • #2 / Sep 17, 2011 10:26pm

    John St-Amand

    865 posts

    I’ve not used it, so please don’t consider it an endorsement, but what about the EE Suite?

  • #3 / Sep 18, 2011 2:52pm

    IOS Admin

    33 posts

    Haven’t looked at EE Suite yet, but the kind folks at Brilliant Retail pointed me to Membrr. Membrr is looking like a good option for us.

    FYI: Brilliant Retail said they were close to coming out with something for subscriptions.

  • #4 / Oct 23, 2011 12:33pm

    Euan

    214 posts

    IOS Admin - did BR give any timescale for the subscription add-on? It’s certainly something I would be interested in.

    I’ve looked at Membrr and it certainly seems the best option so far.

    EESuite I also looked at but no screenshots, demo is not online and support is for customers only - nothing available for pre-purchase which always makes me nervous.

  • #5 / Oct 24, 2011 7:07am

    IOS Admin

    33 posts

    I forget the details right now of which vendor is where. I ended up using Simple Commerce as a starting point and modified it to meet my needs. I haven’t gone into production with it yet, but it seems to be working fine.

    Hopefully the future will hold a better solution for completely hosted payment processing that allows for near seamless integration. I am hopeful.

  • #6 / Nov 21, 2011 7:16pm

    wildrock

    262 posts

    Could you provide us with a summary of what your final SCM mods look like, and maybe provide us with a copy of the final modified module?

    As I read it, one of your main mods was going to be allowing a member to cancel their subscription themselves within EE, instead of having to go to PayPal to do i?

    I’m prepping to update a site that the recurring subscriptions is exactly what I need. And the mod above would be the icing on the cake.

  • #7 / Nov 22, 2011 10:37am

    IOS Admin

    33 posts

    The “trick” to allowing users to cancel there subscriptions is to use the PayPal ManageRecurringPaymentsProfileStatus API. This is an API that is available to Website Payments Standard users but is not documented in any of the Website Payments Standard documentation. The API is part of a collection of APIs for Express Checkout and Payments Pro. I was made aware of the API by PayPal’s integration support staff.

    It is a very simple API that relies on the PayPal Profile ID which is in fact the PayPal subscr_id that IPN returns and the EE SCM module stores. You simple send a request to PayPal with this ID your credentials and the action to complete (CANCEL). That’s it.

    Here is my code for a Cancel Tag. It produces a conditional that I can use in my template to display success or failure. The code is very basic but it works.

    /** ----------------------------------------
     /**  Output Item Info for Cancel
     /** ----------------------------------------*/
     function cancel()
     {
      if (($paypal_subscriber_id = $this->EE->TMPL->fetch_param("paypal_subscriber_id")) === FALSE) return;
    
      $API_Username="******************";
      $API_Password="******************";
      $API_Signature="*******************";
      
      $nvpreq="METHOD=ManageRecurringPaymentsProfileStatus&VERSION=65.1&ACTION=cancel";
      $nvpreq.="&PWD;=".urlencode($API_Password)."&USER;=".urlencode($API_Username)."&SIGNATURE;=".urlencode($API_Signature);
      $nvpreq.="&PROFILEID;=".urlencode($paypal_subscriber_id);
      $nvpreq.="&NOTE;=".urlencode("Cancelled by user from MyPlace Profile.");
    
      if ($this->debug === TRUE){
       $API_Endpoint = ( ! function_exists('openssl_open')) ? 'http://api-3t.sandbox.paypal.com/nvp' :  'https://api-3t.sandbox.paypal.com/nvp';
      } else {
       $API_Endpoint = ( ! function_exists('openssl_open')) ? 'http://api-3t.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp';
      }
    
      $ch=curl_init(); 
      curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
      curl_setopt($ch,CURLOPT_URL,$API_Endpoint); 
      curl_setopt($ch,CURLOPT_POST,1); 
      curl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq); 
    
      // Start ob to prevent curl_exec from displaying stuff. 
      ob_start(); 
      curl_exec($ch);
    
      //Get contents of output buffer 
      $result=ob_get_contents(); 
      curl_close($ch);
    
      //End ob and erase contents.  
      ob_end_clean();
    
    //Debug Success Return Result
    //$result = "PROFILEID=I-3DVFD070GSGJ&TIMESTAMP=2011-11-15T22:23:26Z&CORRELATIONID=c88f57235d57f&ACK=Success&VERSION=65.1&BUILD=2230381";
    
      if(stristr($result,"ACK=Success")){
       $cond["cancel_success"] = true;
      } else {
       $cond["cancel_success"] = false;
      }
      
      $tagdata = $this->EE->functions->prep_conditionals($this->EE->TMPL->tagdata, $cond);
      
      return $tagdata;
    
     }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases