fsBuilds offloading WooCommerce Subscriptions and Checkouts (Video) (Video)

Feb 8, 2024

Offload the Complexities of Payments, Subscriptions, and Subscription Management off to

The task to complete: You want to make use of WooCommerce and WordPress as a CMS, but want to leverage an Merchant of Record to manage payments, subscriptions, and subscription management.

For this entry, we're featuring a build by Topher DeRosia that shows how you can easily use  the javascript library with  the webhooks of's in order to enable subscriptions after a purchase is made, or deactivate subscription access when a payment fails while still using WooCommerce as your CMS.

 Resources

Are you interested in trying it yourself? Here are all those resources featured in the video to assist you on your route.

 Add a Subscription to the Cart

PHP and Javascript    is_purchasable() && ( ! is_user_logged_in() || 'no' === wcs_get_product_limitation( $product ) ) )   return;   $user_id = get_current_user_id();  echo wp_kses_post( wc_get_stock_html( $product ) );  if ( $product->is_in_stock() ) : ?>       var QueryString = function ()   // This function is anonymous, is executed immediately and  // the return value is assigned to QueryString!  var query_string = ;  var query = window.location.search.substring(1);  var vars = query.split("&");  for (var i=0;i<vars.length;i++)   var pair = vars[i].split("=");  // If first entry with this name  if (typeof query_string[pair[0]] === "undefined")   query_string[pair[0]] = decodeURIComponent(pair[1]);  // If second entry with this name   else if (typeof query_string[pair[0]] === "string")   var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];  query_string[pair[0]] = arr;  // If third or later entry with this name   else   query_string[pair[0]].push(decodeURIComponent(pair[1]));      return query_string; ();     jQuery( document ).ready(function()    var s = ;   if(QueryString.product)   s =   'products' : [    'path':QueryString.product,  'quantity':1    ]       if(QueryString.email && QueryString.fname && QueryString.lname)   s.paymentContact = ;  s.paymentContact.email = QueryString.email;  s.paymentContact.firstName = QueryString.fname;  s.paymentContact.lastName = QueryString.lname;     if(QueryString.coupon)   s.coupon = QueryString.coupon;     if (s) .builder.push(s);  );           Subscribe Now With                 Expand

Subscription Creation through Webhook

PHP & Javascript                Expand

Developer Documentation

Braden Steel

Braden Steel   Braden is the Senior Product Marketing Manager at . When he's not bringing new products to market, he spends his time writing fantasy stories.