<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chris Monnat &#187; Programming</title>
	<atom:link href="http://www.christophermonnat.com/topics/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christophermonnat.com</link>
	<description>Programmer Extraordinaire</description>
	<lastBuildDate>Thu, 26 Aug 2010 14:21:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates</title>
		<link>http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/</link>
		<comments>http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 10:00:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=1009</guid>
		<description><![CDATA[OK let&#8217;s recap. So far in this guide I&#8217;ve covered: creating your Spreedly account, setting up your subscription plans and (most recently) linking your applications sign-up process to your Spreedly account. The elephant in the room at this point is managing updates and allowing Spreedly to notify our application when users make modifications to their [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif"><img class="alignright size-full wp-image-776" title="spreedly-logo" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif" alt="" width="160" height="90" /></a>OK let&#8217;s recap. So far in this guide I&#8217;ve covered: <a href="http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/">creating your Spreedly account</a>, <a href="http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/">setting up your subscription plans</a> and (most recently) <a href="http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/">linking your applications sign-up process to your Spreedly account</a>. The elephant in the room at this point is managing updates and allowing Spreedly to notify our application when users make modifications to their subscription/billing settings or when something goes wrong: like when a credit card expires or a transaction can&#8217;t be processed. In this final post I will review how to open the lines of communication between your Spreedly account (a.k.a. your billing system) and your application.<br />
<span id="more-1009"></span></p>
<h2>Why is this important?</h2>
<p>Some of you may be asking yourselves &#8220;what is Chris talking about? I&#8217;ve linked up my sign-up form so I&#8217;m done, right?&#8221; Unfortunately no, your not quite finished. The thing to keep in mind, when working with any kind of third party billing service, is that we&#8217;re talking about 2 separate and distinct systems. Your application is not aware of any changes/updates made in the billing system and vice verse.  This is a problem because if a users credit card expires in your billing system you need some way of notifying your application so you can suspend access. Or if your customer cancels their account in your application you need to be sure to update your billing system so they don&#8217;t continue to get charged.</p>
<p>This is the same concept when working with PayPal or any other 3rd party payment processor where the transaction takes place on their servers. We need a method for identifying accounts that have changed recently in our billing system so we can make any necessary updates in our application.</p>
<h2>Listening for Changes</h2>
<p>Spreedly is not shy about telling you when your customer data changes. In fact, when any of your subscribers change, Spreedly will POST  a comma separated list of subscriber id&#8217;s (your customer id&#8217;s) to a URL which you specify. While tooling around your Spreedly accounts general settings you may have noticed a group of fields that start with &#8220;Subscribers Changed Notification URL&#8221;. This field is where you place the URL that Spreedly should use when POSTing changed accounts back to your application. This page can be part of your application or just a script that has access to  your database, but it needs to be there so that Spreedly has someone to talk to.</p>
<p>When any of your subscribers change within Spreedly, the application will send a POST request to an address you specify in your settings containing a comma separated list of IDs. These are the customer IDs of those subscribers who have changed. So this is Spreedlys way of telling you that account 2, 4, 6 and 8 have changed and you may want to check them out and update your DB accordingly.</p>
<p>As far as the necessary code, basically all we&#8217;re talking about is a method of a new or existing controller (using CodeIgniter) looking for the &#8220;subscriber_ids&#8221; POST variable and processing appropriately:</p>
<pre class="brush: php">
public function update_customers
{
	$ids = explode(&#039;,&#039;, $this-&gt;input-&gt;post(&#039;subscriber_ids&#039;));

	foreach($ids as $id)
	{
		// get users data from Spreedly

		// update your DB with new data
	}
}
</pre>
<p>Pretty easy huh?</p>
<h2>Why did this take so long?</h2>
<p>This series set a new record for how long it&#8217;s taken me to wrap up a post series and I apologize for that. The reason though is because I&#8217;ve been taking a good long look at all the payment services out there (they&#8217;re popping up all over the place) and have determined that there are others I like better than Spreedly. So as I started to change my mind and focus I spent less time with this service and as a result was unable to share my knowledge as I had planned. </p>
<p>Currently <a href="http://sign-up-sheet.com">Sign-Up-Sheet.com</a> uses <a href="http://chargify.com">Chargify </a>which won me over shortly after I started this series. However, I have since found another app that I like better called <a href="http://opengateway.net">OpenGateway</a>. The details as to why one is better than the other is for another post, but that&#8217;s what happened here. I got sidetracked by other options and simply was unable to regain my focus. Stay tuned for additional information on these payment options and let me know if you would like to see another series possibly on OpenGateway (which coincidentally happens to be built on CI) in the comments.</p>
<h2>That&#8217;s all folks</h2>
<p>And that does it for the Spreedly guide. My apologies for taking so long to complete but things got away from me a bit and one thing lead to another. If you think there is something I didn&#8217;t cover or have any additional questions please let me know in the comments.</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration'>Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration</a></li>
<li><a href='http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process'>Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process</a></li>
<li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup'>Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process</title>
		<link>http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/</link>
		<comments>http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 10:00:47 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=973</guid>
		<description><![CDATA[Picking up right where I left off, in this post I will review integrating Spreedly with your programs sign-up process. As is the case with most services like this, including PayPal, the quickest way to incorporate Spreedly involves redirecting the user to their website and allowing the financial transaction to take place on their servers. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif"><img class="alignright size-full wp-image-776" title="spreedly-logo" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif" alt="" width="160" height="90" /></a>Picking up right where I left off, in this post I will review integrating Spreedly with your programs sign-up process. As is the case with most services like this, including PayPal, the quickest way to incorporate Spreedly involves redirecting the user to their website and allowing the financial transaction to take place on their servers. The user is then redirected back to your website once the transaction has been completed. This is the quickest and easiest method available and is the one I will be reviewing.<br />
<span id="more-973"></span></p>
<h2>Quick Disclaimer</h2>
<p>Spreedly has a full featured API which provides people with programming experience a greater amount of integration flexibility, you just need to be conscience of the security liabilities involved. Links to 3rd party libraries and documentation can be found on the <a href="http://spreedly.com/info/integration/">Spreedly website</a>. To save on time and get this series wrapped up I will not be reviewing the API.</p>
<h2>Your Sign-up Process</h2>
<p>Before we can get to the Spreedly side of things we first need to define how our sign-up process is going to work. It is in our best interests, as the business owners, to make our sing-up process as quick and simple as possible so that more people will purchase accounts. Smashing Magazine published <a href="http://www.smashingmagazine.com/2008/07/04/web-form-design-patterns-sign-up-forms/">a post</a> or <a href="http://www.smashingmagazine.com/2008/07/08/web-form-design-patterns-sign-up-forms-part-2/">two</a> on sign-up form design a while back and I recommend you refer to those poses for further information on designing your process.</p>
<p>The one thing I will say, as it pertains to process, is to keep your sign-up form short and sweet. We will be redirecting users to our Spreedly accounts for the actual financial transaction so don&#8217;t worry about collecting any of that data (address, CC info, etc.) on your form. Just collect the items that are vitally necessary to get the user setup and worry about the non-essentials after they log-in for the first time.</p>
<h2>Prerequisites</h2>
<p>As I mentioned above, we don&#8217;t need to worry about collecting any financial information on our website because all the financial transaction stuff will be handled by Spreedly. However, there is one bit of data that we need to keep track of in order to redirect our users over to Spreedly and that is the subscription plan ID. The way I have chosen to handle this is by creating a table in my applications database to hold a copy of my subscription plans and each plan will include their Spreedly ID. Come to find out I needed to create this table anyway to track the limits of each subscription plan and hold my users to the limits of the account they purchased. So in reality I simply added an additional column to this table to hold the Spreedly ID.</p>
<p>Now you can chose to handle this any way that works for you and your application, but the bottom line is you simply need to be able to keep track of the subscription plans you have setup in Spreedly and the unique ID that has been assigned to them.</p>
<h2>Constructing the Subscribe Link</h2>
<p>So now that we have our subscription process down and have defined a place to keep track of our subscription plans and their IDs on the application side we can start looking at how exactly we will be linking to Spreedly.</p>
<p><a href="http://www.christophermonnat.com/wp-content/uploads/2010/04/spreedly-sub-plans.png"><img class="aligncenter size-full wp-image-980" title="spreedly-sub-plans" src="http://www.christophermonnat.com/wp-content/uploads/2010/04/spreedly-sub-plans.png" alt="" width="595" height="348" /></a></p>
<p>Spreedly makes it somewhat difficult to find your subscription plan ID so you have to go looking for it. When you are logged into your account, click <strong>Plans</strong> to view your subscription plans and click the name to edit it. The edit screen, which is shown above, allows you to make changes to your subscription plan. If you look at the URL of this page you will be able to find the ID of your subscription plan. It&#8217;s the number displayed between &#8220;subscription_plans&#8221; and &#8220;edit&#8221;. That&#8217;s the number you will need to keep track of on your application side. You should also take  a look at <a href="https://spreedly.com/manual/integration-guide/expose-a-subscribe-link/">their documentation</a> links in the box on the right side of the page which also reviews linking to subscription plans from your application.</p>
<p>OK, so now that we have our subscription plan IDs we need to determine what the URL is going to look like.</p>
<p><strong>https://spreedly.com/signupsheet/subscribers/84736/subscribe/1019/screen-name-for-84736</strong></p>
<p>The URL displayed above is a sample URL for the basic subscription plan.  Let&#8217;s take a look at this URL piece by piece to figure out what we need to modify:</p>
<ul>
<li><strong>https://</strong> &#8211; very important for security purposes. Since we are working with credit cards plain old http is forbidden.</li>
<li><strong>spreedly.com</strong> &#8211; as I&#8217;ve already mentioned, all the financial stuff is happening on the Spreedly servers and this is the proof.</li>
<li><span style="color: #993300;"><strong>signupsheet</strong></span> &#8211; this is your unique account short site name. This can be modified on the Site Details screen under Configuration.</li>
<li><strong>subscribers/<span style="color: #993300;">84736</span> </strong>- the number 84736 is the ID of the user or account in OUR system. So this number if the first thing we will customize. I recommend setting it to the unique identifier you use in your application to identify your accounts or users. Whatever is the root account level entity within your application. Be sure not to omit the &#8220;subscribers/&#8221; either, this identifies the ID your passing to Spreedly.</li>
<li><strong><span style="color: #993300;">1019</span></strong> &#8211; this is the subscription plan ID. This is the next thing we will customize depending on the subscription plan our user is purchasing.</li>
<li><span style="color: #993300;"><strong>screen-name-for-84736</strong></span> &#8211; this is a unique user/account name that we provide Spreedly. This is the last thing we will customize. Set this to whatever you wish, perhaps some combination of account name and ID. Whatever will make it easy for you to identify the account within Spreedly by name instead of ID.</li>
</ul>
<p>So that&#8217;s it. All URLs will be the same except for the 4 pieces identified above (in red): your short site name, an account/user ID from your system, the subscription plan ID and a user/account screen name. By customizing those segments you should now be able to successfully redirect your users to Spreedly for credit card processing.</p>
<h2>Passing Additional Data</h2>
<p>It&#8217;s also worth mentioning that you can pass additional data to your Spreedly subscription pages like the subscribers name and e-mail address. If you are already collecting this data on your applications sign-up form it would be helpful if these fields were already filled in on the subscription page. You can easily pass this data along to Spreedly by adding some GET variables onto the URL we constructed above:</p>
<ul>
<li>email=someone@someplace.com</li>
<li>first_name=someone</li>
<li>last_name=special</li>
</ul>
<p>If we use the above GET variables to pass additional information to our subscription forms, then our final Spreedly URL is going to look something like this:</p>
<p><strong>https://spreedly.com/signupsheet/subscribers/84736/subscribe/1019/screen-name-for-84736<span style="color: #993300;">?email=someone@someplace.com&amp;first_name=someone&amp;last_name=special</span></strong></p>
<p>That&#8217;s all there is to it. Once the user inputs their credit card information they will be redirected to the URL which you specified in the subscription plan settings. You can also modify this on the fly by providing an additional GET variable to your URL: return_url. Using that variable you can dynamically redirect the user wherever you specify upon successfully completing the payment process. This comes in handy if you need to pass any kind of dynamic information along with your user when they are redirected back to your site.</p>
<p><a href="http://www.christophermonnat.com/wp-content/uploads/2010/04/spreedly-checkout.png"><img class="aligncenter size-full wp-image-1002" title="spreedly-checkout" src="http://www.christophermonnat.com/wp-content/uploads/2010/04/spreedly-checkout.png" alt="" width="595" height="553" /></a></p>
<h2>What&#8217;s Next?</h2>
<p>If you followed along you should now be up and running with using Spreedly to manage your applications payment processing. You may however notice one thing is missing&#8230; we have no way of knowing whether the payment was processed successfully or not. The user simply gets redirected where we say and that&#8217;s it. We also have no way of knowing when their subscription expires (unless we track that ourselves). In the next post I will look at how we open up the lines of communication between Spreedly and our applications so that we know more about whose paying and whose not.</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration'>Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration</a></li>
<li><a href='http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates'>Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates</a></li>
<li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup'>Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Entrepreneur Heal Thyself</title>
		<link>http://www.christophermonnat.com/2009/12/entrepreneur-heal-thyself/</link>
		<comments>http://www.christophermonnat.com/2009/12/entrepreneur-heal-thyself/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 19:24:30 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=899</guid>
		<description><![CDATA[As a freelancer or sole proprietor, how do you decide when to start a new project? I&#8217;m not talking about taking on client projects&#8230; I&#8217;m referring to ventures, product or application ideas that you have and think would make a good business. Are you the kind of person who gets an idea in their head [...]]]></description>
			<content:encoded><![CDATA[<p>As a freelancer or sole proprietor, how do you decide when to start a new project? I&#8217;m not talking about taking on client projects&#8230; I&#8217;m referring to ventures, product or application ideas that you have and think would make a good business. Are you the kind of person who gets an idea in their head one day and jumps in head first the next? Or, do you need to have a plan in place with potential return on investment before you pick up your mouse? Until recently, I would have said that I fell in between those two extremes landing a bit closer to needing a plan than jumping in. However, over the last several months I have come to the conclusion that I fall smack dab in the first group and have determined that that&#8217;s not necessarily a good thing.</p>
<p><span id="more-899"></span></p>
<h2>To program, or not to program that is the question</h2>
<p>If you have spent any time on this site or on <a href="http://leftofcentercom.com">LOCCs</a> you will have some idea of the projects I&#8217;m involved with. I developed BadgeTracker about 5 years ago, Sign-Up-Sheet.com followed about a year or two later accompanied most recently by myScoutPath and ScoutMailer. Contrary to most entrepreneurs I actually found my niche <strong>after</strong> I had developed a product. BadgeTracker was developed quickly and gained a following and after a little research I determined that the scouting industry was an attractive market to compete in so I selected it as my niche. The products that followed were aimed at scouts first and other groups second and I saw that as having great potential.</p>
<p>The problem here, that I didn&#8217;t realize until just recently, is that I had taken on too much. While I do outsource some work to contractors I am the only programmer, support person and business administrator I got. That means that while I&#8217;m answering support e-mails development stops. While I&#8217;m following up on overdue invoices no one is following up with the sales leads. While I&#8217;m programming no one is marketing. This lead to having 3 or 4 mediocre projects/products that were moving forward at a snails pace.</p>
<p>I had jumped head first into any idea that popped into my head, investing time and money to get it online and then ran out of resources to sustain, support and grow them. This lead to a great deal of frustration on my part because I was unable to work on the things I wanted to work on, investigate new ideas and opportunities or even write on my blog because I was stuck in the muck.</p>
<h2>Wait&#8230; where&#8217;s the money?</h2>
<p>Some of you may be wondering why I didn&#8217;t hire a staff or assistants to help maintain some of this. The short answer is the money wasn&#8217;t there. While the scouting industry may have looked like an attractive market at first, I have found over the years that working with non-profits is somewhat complicated and making a sale is difficult needle to thread. So while I was making some money it wasn&#8217;t enough to hire help or even leave my day job to dedicate more time. All of this of course contributed to more frustration on my part which is a very unproductive mind set to be in.</p>
<h2>Recovery</h2>
<p>What this all boils down to is not having a good vision and plan in place for the business. I should have slowed things down and investigated new ideas a bit more before jumping in a starting development and I should have finished one thing before starting another. I&#8217;m sick and tired of being sick and tired so I think it&#8217;s time for a new plan.</p>
<p>The one thing that all great businesses have in common is  great products. There are plenty of businesses out there with mediocre products and they come and go each year along with whatever is &#8220;in&#8221; at the time. I have decided that I&#8217;m not content with creating mediocre products&#8230; I&#8217;m out to create a great product and doing that requires focus. So I&#8217;ve come to the conclusion that I need to &#8220;reboot&#8221; and start 2010 with a new plan/vision. I think Dr. Charles Emerson Winchester III, from M.A.S.H, put it best when he said &#8220;I do one thing at a time, I do it very well and then I move on.&#8221; This probably means some of my many projects and ideas may be discontinued or abandoned to drift with the current but I&#8217;m confident that this is a better approach than what I have been trying.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/12/entrepreneur-heal-thyself/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simplified Compatibility Checking</title>
		<link>http://www.christophermonnat.com/2009/06/simplify-compatibility-checking/</link>
		<comments>http://www.christophermonnat.com/2009/06/simplify-compatibility-checking/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 15:45:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=851</guid>
		<description><![CDATA[Fever, a new RSS feed reading application, just launched recently. Many of you might be familiar with the developer Shaun Inman from his popular stats tracking app Mint. I haven&#8217;t personally used Mint but I&#8217;m a huge fan of RSS feeds so when I heard about Fever I had to give it a shot. I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/fever-logo.png"><img class="alignright size-full wp-image-853" title="fever-logo" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/fever-logo.png" alt="fever-logo" width="110" height="58" /></a><a href="http://feedafever.com">Fever</a>, a new RSS feed reading application, just launched recently. Many of you might be familiar with the developer <a href="http://www.shauninman.com">Shaun Inman</a> from his popular stats tracking app <a href="http://haveamint.com">Mint</a>. I haven&#8217;t personally used Mint but I&#8217;m a huge fan of RSS feeds so when I heard about Fever I had to give it a shot. I will probably talk about the application a little later after I&#8217;ve had a chance to play with it. But, in this post I wanted to talk briefly about the unique checkout process Shaun uses to help make sure his users are installing the program on a compatable system before they even enter their credit card number.</p>
<p><span id="more-851"></span></p>
<p>One of the difficulties when selling software that needs to be installed is making sure the software is compatible with the users computer/system. I know this is <em>supposed</em> to be a responsibility of the user, but if they make a mistake they will be contacting you for support. Fever takes a unique approach to confirming users are installing the software on compatible machines. Shaun has created a process that links a compatibility check with his checkout/licensing process so that users can only purchase a license if they are installing the program on a compatible machine.</p>
<p style="text-align: center;"><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/fever-compatability.png"><img class="size-full wp-image-852 aligncenter" title="fever-computability" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/fever-compatability.png" alt="fever-compatibility" width="381" height="537" /></a></p>
<p style="text-align: left;">Before you can purchase a license you first download a small package that you upload to the location where you intend on installing the program. From there the package checks your systems compatibility and asks for database information (shown in the image above). Once entered, and after privileges have been checked, you are provided with a link back to the Fever site that populates the purchase form with a unique ID. This ID, I assume, matches your site with the compatibility check performed and then you continue with purchasing the license.</p>
<p>This process is genius! It allows the developer to prove the user is going to be installing the software on a compatible machine before selling them a license. I can image this process greatly reduces, if not eliminates, the support requests having to do with system compatibility and installation issues. Very cool idea!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/06/simplify-compatibility-checking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration</title>
		<link>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/</link>
		<comments>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 10:00:52 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=750</guid>
		<description><![CDATA[If you&#8217;ve ever accepted payments with PayPal you&#8217;ll know all the magic is in the settings/configuration. There are tons of configuration options that you can modify to make PayPal work just the way you like. The same holds true for Spreedly. The developers have paid attention to detail and provided us with the ability to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif"><img src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif" alt="" title="spreedly-logo" width="160" height="90" class="alignright size-full wp-image-776" /></a>If you&#8217;ve ever accepted payments with PayPal you&#8217;ll know all the magic is in the settings/configuration. There are tons of configuration options that you can modify to make PayPal work just the way you like. The same holds true for Spreedly. The developers have paid attention to detail and provided us with the ability to tweak how the service interacts with your chosen payment gateway so you can get just the functionality you&#8217;re looking for. In the last post I gave you a brief introduction to Spreedly and walked you through creating your own free test account. Today we&#8217;re going to jump in head first and look at the account configuration options.</p>
<p><span id="more-750"></span></p>
<p>For those viewers following along at home, if you look at the configuration page, I&#8217;m going to cover each section in reverse order wrapping up with setting up your subscription plans.</p>
<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/05/spreedly-config.gif"><img class="aligncenter size-full wp-image-792" title="spreedly-config" src="http://www.christophermonnat.com/wp-content/uploads/2009/05/spreedly-config.gif" alt="spreedly-config" width="595" height="328" /></a></p>
<h2>Site Details</h2>
<p>The site details section is where, you guess it, you enter the details of the site you are going to be integrating with Spreedly. The information requested on this form is pretty straight forward so I&#8217;m just going to touch on 2 parts.</p>
<p><center><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-site-details.gif"><img class="aligncenter size-full wp-image-795" title="spreedly-site-details" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-site-details.gif" alt="spreedly-site-details" width="490" height="371" /></a></center></p>
<p><strong>URLs</strong></p>
<p>About half way through the form they ask for 3 URLs:</p>
<ol>
<li>Subscriber Changed Notification URL
<p>Since you are using a system that is external to your application to handle payment processing you will have to work out some way to sync the two so your sure people have only those accounts they have paid for. That&#8217;s where the subscribers changed notification URL comes into play. When subscriber data within Spreedly changes, the service will POST a comma separated value list of subscriber IDs to the address you specify here. It then becomes your responsibility to process those changes and sync them with your application.</li>
<li>Individual user URL on your site
<p>This is the address that users visit to view their specific information in your program. Spreedly uses this address to redirect users back to your program from their update screen.</li>
<li>Subscription selection URL on your site
<p>This is that place in your program where users can upgrade/downgrade their account. Again, Spreedly uses this address to redirect users back to your program from their system.</li>
</ol>
<p>I will come back to these URLs later in the series so go ahead and leave them blank for now.</p>
<p><strong>API Authentication Token</strong></p>
<p>At the bottom of the site details form you will find your sites API Authentication Token. This is the token you will use when interacting with the Spreedly API. Be sure to handle with care and keep it a secret&#8230; you can always generate a new one if you need to. Make note of this because we will be using it in the posts to come.</p>
<h2>Manage Site Users</h2>
<p>One of the really nice things about Spreedly is that you can add as many users to your account as you wish without hitting any limits. So, if your organization has a 10 person support/accounting team (wishful thinking perhaps) you can add them all with their own access information from the Manage Site Users section.</p>
<h2>Payment Gateway</h2>
<p>The Payment Gateway section is where you will go when you&#8217;re ready to take your site out of testing and into production. You will have to upgrade your Spreedly account from a test site to a production site and either sign-up for the monthly pricing option or bite the bullet and get a <a href="https://spreedly.com/info/kickstart/">Kickstart package</a>. For the time being, the page just displays some example CC numbers you can use to generate different errors.</p>
<h2>Subscription Plans</h2>
<p>Now to the important stuff! The Subscription Plans section is where you setup your applications different subscription plans and pricing. By default, Spreedly has setup one example plan to give you an idea how things work. I will issue one word of caution here, you CANNOT delete subscription plans. I hope this is coming soon, because I have made a mess out of my other account, but for right now it can&#8217;t be done. Just keep this in mind as you enter your plans.</p>
<p>I want to draw your attention to 2 pieces on this form:</p>
<p><center><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-subscription-plans.gif"><img class="aligncenter size-full wp-image-796" title="spreedly-subscription-plans" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-subscription-plans.gif" alt="spreedly-subscription-plans" width="490" height="383" /></a></center></p>
<p><strong>Feature Level</strong></p>
<p>The feature level is the name with which you will refer to the subscription plan through the API. You want to keep this simple yet specific so you can easily match it up with a subscription type. I typically just repeat the plan name as one word lowercase just to keep it easy.</p>
<p><strong>Plan Type</strong></p>
<p>The type of plan is where you can specify if this is a regular subscription, gift subscription or free trial. This really gives you a lot of options when setting up your applications pricing structure. You can set the amount of time each plan is valid for before charging the user again (number of days or months). You can also specify if you want to require auto-recurring purchases (you only accept auto-recurring payments) or not. The sky&#8217;s the limit!</p>
<h2>That&#8217;s it!</h2>
<p>After you play around with your settings and subscription types a little bit you will have a configured Spreedly test account ready to accept subscribers. In the next post I&#8217;m going to take a break from the Spreedly specific stuff for a little while and talk about planning your sign-up/checkout process and determining how that&#8217;s going to work with your newly configured Spreedly account.</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup'>Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &#038; Account Setup</a></li>
<li><a href='http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process'>Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process</a></li>
<li><a href='http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates'>Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Speedy Subscriptions Using Spreedly (Part 1) &#8211; Overview &amp; Account Setup</title>
		<link>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/</link>
		<comments>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:00:12 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=747</guid>
		<description><![CDATA[I developed Sign-Up-Sheet.com four years ago first as a sandbox project for learning Ruby on Rails (RoR). After becoming disillusioned with RoR, I redeveloped the app in PHP using CodeIgniter (CI) and that&#8217;s where it&#8217;s been ever since. Every once and a while I try to add a new feature here or there but find [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif"><img class="alignright size-full wp-image-776" title="spreedly-logo" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-logo.gif" alt="spreedly-logo" width="160" height="90" /></a>I developed <a href="http://www.sign-up-sheet.com">Sign-Up-Sheet.com</a> four years ago first as a sandbox project for learning Ruby on Rails (RoR). After becoming disillusioned with RoR, I redeveloped the app in PHP using <a href="http://www.codeigniter.com">CodeIgniter</a> (CI) and that&#8217;s where it&#8217;s been ever since. Every once and a while I try to add a new feature here or there but find it very difficult to focus any time/energy on a product that doesn&#8217;t generate any revenue. The solution to this problem, of course, is to start charging for the service. But every time I researched what was involved with accepting credit cards the complicated pricing schemes and high costs always turned me away. That was until I found <a href="http://www.spreedly.com">Spreedly</a>! This post kicks off a new series that will take a detailed look at Spreedly. Over the next couple of weeks, I will introduce you to the service, walk you through how their system works and give you a real world example so you can see it in action.<br />
<span id="more-747"></span></p>
<h2>What is Spreedly?</h2>
<p>Aside from the best thing since sliced bread&#8230; Spreedly is a service that takes the hassle out of collecting subscription fees for web based services/applications. Developing applications that use 3rd party payment gateways and that sell recurring subscriptions is a difficult and often expensive undertaking. Spreedly simplifies the process by handling the complex task of subscription management and payment processing for you so you can focus your time and money on your product.</p>
<p>After configuring your Spreedly account and entering your subscription types and pricing scheme, the service will handle all the payment gateway interaction and user subscription management for you&#8230; no muss no fuss. Accepting payments literally becomes as easy as redirecting your user to a Spreedly URL and having them enter their credit card information. That&#8217;s it!!</p>
<h2>Supported Gateways</h2>
<p>It&#8217;s important to understand that <strong>Spreedly is not a payment gateway</strong>. Spreedly simply acts as the middle man between your application and your selected gateway using APIs. This means you will still need to find a payment gateway and merchant account (if necessary). The simplest, and cheapest, option is probably <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside">PayPal</a> because it&#8217;s a gateway and merchant account all-in-one. But if that doesn&#8217;t work for you, Spreedly currently supports the following gateways:</p>
<ul>
<li><a href="http://www.authorize.net/">Authorize.net</a> (Only US dollars)</li>
<li><a href="http://www.beanstream.com/">Beanstream</a> (Only Canadian dollars)</li>
<li><a href="http://www.eway.com.au/">eWAY</a> (Only Australian dollars)</li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside">PayPal Website Payments Pro</a> (also <a href="https://www.paypal.com/uk/cgi-bin/webscr?cmd=_wp-pro-overview-outside">UK</a>)</li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_additional-payment-overview-outside">PayPal Express Checkout</a> (also <a href="https://www.paypal.com/uk/cgi-bin/webscr?cmd=_additional-payment-overview-outside">UK</a>)<br />
(does not currently support automatically recurring subscriptions)</li>
<li><a href="http://www.sagepay.com/">Sage Pay</a> (formerly Protx)</li>
<li><a href="http://usaepay.com/">USA ePay</a> (Only US dollars)</li>
</ul>
<p>They are constantly adding new gateways to the service so be sure to visit <a href="http://www.spreedly.com/info/payment-gateways/">their site</a> for the most updated list. If you don&#8217;t see your gateway listed above the odds are good that they can add it for you. Just contact their support team and they will research what&#8217;s involved.</p>
<h2>Pricing</h2>
<p>Accepting credit cards online is an expensive proposition&#8230; that&#8217;s why I have avoided it up until now. There are bank fees for merchant accounts, fees for each transaction, monthly fees for the payment gateway, etc&#8230; not to mention the percentage of each transaction that certain parities take just because they can. It&#8217;s enough to make you dizzy!</p>
<p>The pricing for Spreedly is pretty straight forward:</p>
<p><strong>$19 per month + transaction fees</strong></p>
<ul>
<li>3% on the first 50 transactions per month</li>
<li>2% on transactions 51 through 5000</li>
<li>1% on all transactions after 5000</li>
</ul>
<p>The thing to point out here is that the Spreedly fees will be on top of whatever your payment gateway charges. In the end you are still probably looking at a decent sum of money&#8230; but odds are it&#8217;s still cheaper (programming included) than if you went it alone or with another service.</p>
<p>If there are too many monthly fees for you to handle, Spreedly also has another pricing option called the <a href="http://www.spreedly.com/info/kickstart/">Kickstart package</a>. For one single payment of $699.00 you can get a Spreedly account <strong>for life</strong> with:</p>
<ul>
<li>a frozen per-transaction fee of 1%</li>
<li>no monthly fees</li>
<li>and it never expires!!</li>
</ul>
<p>It pays to keep an eye on the Spreedly site (and maybe follow their <a href="http://twitter.com/spreedly">Twitter account</a>) for special offers because when they first launched Kickstart the price was $499.00 for a limited time. So there are opportunities for picking up deals if you pay attention.</p>
<h2>Account Setup</h2>
<p>Now that you have a basic understanding of what Spreedly is, let&#8217;s go ahead and create a test account. Spreedly makes it super easy to get your bearings and see how the system works without spending any money. You can sign-up for a free test account (which gives you access to everything you need) and see if it will work for you. To create your account, visit <a href="https://www.spreedly.com/signup">https://www.spreedly.com/signup</a> and fill out the form.</p>
<p><a href="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-overview.gif"><img class="aligncenter size-full wp-image-789" title="spreedly-overview" src="http://www.christophermonnat.com/wp-content/uploads/2009/06/spreedly-overview.gif" alt="spreedly-overview" width="595" height="351" /></a></p>
<p>After signing-up you will be directed to your test site overview page (shown above). The overview page gives you a summary of your account in terms of transactions and subscribers. You can click around the interface if you like but it&#8217;s going to be pretty empty until we start submitting transactions (which we&#8217;ll get to later in this series).</p>
<h2>That&#8217;s a wrap</h2>
<p>That does it for the Spreedly intro. In the next post I will review how to configure your account and setup your subscription plans/pricing scheme.</p>
<p>I&#8217;m just getting started with Spreedly so stay tuned!</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-2-account-configuration/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration'>Speedy Subscriptions Using Spreedly (Part 2) &#8211; Account Configuration</a></li>
<li><a href='http://www.christophermonnat.com/2010/08/speedy-subscriptions-using-spreedly-part-4-checking-for-updates/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates'>Speedy Subscriptions Using Spreedly (Part 4) &#8211; Checking for Updates</a></li>
<li><a href='http://www.christophermonnat.com/2010/04/speedy-subscriptions-using-spreedly-part-3-the-sign-up-process/' rel='bookmark' title='Permanent Link: Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process'>Speedy Subscriptions Using Spreedly (Part 3) &#8211; The Sign-up Process</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/06/speedy-subscriptions-using-spreedly-part-1-service-overview-introduction/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook Connect Library for CodeIgniter</title>
		<link>http://www.christophermonnat.com/2009/05/facebook-connect-library-for-codeigniter/</link>
		<comments>http://www.christophermonnat.com/2009/05/facebook-connect-library-for-codeigniter/#comments</comments>
		<pubDate>Mon, 18 May 2009 22:00:52 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=762</guid>
		<description><![CDATA[Just a brief follow-up to the post series I did a while back on Implementing Facebook Connect with CI. Today, Elliot Haughin continued his tradition of releasing helpful CI libraries and published a new library for implementing Facebook Connect using CodeIgniter. Haven&#8217;t had a chance to review it personally yet but I would imagine it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Just a brief follow-up to the post series I did a while back on <a href="http://www.christophermonnat.com/guides">Implementing Facebook Connect with CI</a>. Today, Elliot Haughin continued his tradition of releasing helpful CI libraries and published a <a href="http://www.haughin.com/2009/05/18/new-codeigniter-library-facebook-connect/">new library for implementing Facebook Connect using CodeIgniter</a>. Haven&#8217;t had a chance to review it personally yet but I would imagine it&#8217;s just the thing to make implementing Facebook Connect on your CI site easier. Check it out!</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/01/implementing-facebook-connect-part-1/' rel='bookmark' title='Permanent Link: Implementing Facebook Connect (Part 1) &#8211; What is Facebook Connect?'>Implementing Facebook Connect (Part 1) &#8211; What is Facebook Connect?</a></li>
<li><a href='http://www.christophermonnat.com/2009/02/implementing-facebook-connect-part-3-accessing-data-from-facebook/' rel='bookmark' title='Permanent Link: Implementing Facebook Connect (Part 3) &#8211; Accessing Data from Facebook'>Implementing Facebook Connect (Part 3) &#8211; Accessing Data from Facebook</a></li>
<li><a href='http://www.christophermonnat.com/2008/08/ci-inferno/' rel='bookmark' title='Permanent Link: CI Inferno'>CI Inferno</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/05/facebook-connect-library-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How-to Ensure a Secure Connection Using PHP</title>
		<link>http://www.christophermonnat.com/2009/05/how-to-ensure-a-secure-connection/</link>
		<comments>http://www.christophermonnat.com/2009/05/how-to-ensure-a-secure-connection/#comments</comments>
		<pubDate>Fri, 01 May 2009 10:00:04 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=636</guid>
		<description><![CDATA[Image via Wikipedia When submitting sensitive information over the web it&#8217;s important to ensure that the requested page is being accessed via an HTTPS encrypted connection. I&#8217;ve come across some forms that don&#8217;t check whether a secure connection has been made or not. In other words, you can delete the S from HTTP and instead [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 171px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:SympaticoSecurityManagerSafe.png"><img title="‎Sympatico Security Manager" src="http://upload.wikimedia.org/wikipedia/en/9/99/SympaticoSecurityManagerSafe.png" alt="‎Sympatico Security Manager" width="161" height="131"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:SympaticoSecurityManagerSafe.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>When submitting sensitive information over the web it&#8217;s important to <strong>ensure</strong> that the requested page is being accessed via an HTTPS encrypted connection. I&#8217;ve come across some forms that don&#8217;t check whether a secure connection has been made or not. In other words, you can delete the S from HTTP and instead of redirecting the user back to the HTTPS connection the form is just displayed unsecured. This is a BIG NO NO&#8230; as a programmer you cannot rely on the visitor, or even other developers who would be linking to the form, to request a form securely. In this post I will review how you can ensure that your users are accessing certain pages using a secure connection.<br />
<span id="more-636"></span></p>
<h2>The Server Superglobal</h2>
<p>How can you tell if your user is requesting a certain page using a secure connection (HTTPS)? Enter the <a href="http://www.php.net/manual/en/reserved.variables.server.php">PHP server surperglobal</a>.</p>
<p>&#8220;<var class="varname">$_SERVER</var> is an array containing information    such as headers, paths, and script locations. The entries in this    array are created by the web server.&#8221;<br />
- PHP Manual (http://www.php.net)</p>
<p>There are 2 elements within this array that you can check that will tell you whether the user has made a secure request or not: <strong>https</strong> and <strong>server_port</strong>.</p>
<h2>Programmer Beware</h2>
<p>Something to keep in mind is that each web server will provide or not provide certain information in the $_SERVER array depending on their configuration. The PHP manual also points this out:</p>
<p>&#8220;There is no guarantee that    every web server will provide any of these; servers may omit some,    or provide others not listed here.&#8221;<br />
- PHP Manual (http://www.php.net)</p>
<p>So I guess that brings us back to the original question: how can you tell if your user is requesting a certain page using a secure connection (HTTPS)? Of the 2 elements mentioned above, server_port is part of the CGI 1.1 specification so the chances are good that element will be available in most servers. You can check for the availability of the https element if you wish but you should also include a check of the server_port as a fallback.</p>
<h2>The Code</h2>
<p>There is a good code example in the <a href="http://www.php.net/manual/en/reserved.variables.server.php#89306">comments of the PHP manual</a> of a function that checks whether or not the user has made a secure request:</p>
<pre class="brush: php">
&lt;?php
function isSSL(){

if($_SERVER[&#039;https&#039;] == 1) /* Apache */ {
return TRUE;
} elseif ($_SERVER[&#039;https&#039;] == &#039;on&#039;) /* IIS */ {
return TRUE;
} elseif ($_SERVER[&#039;SERVER_PORT&#039;] == 443) /* others */ {
return TRUE;
} else {
return FALSE; /* just using http */
}

}
?&gt;
</pre>
<p>This example function makes use of both the https and server_port elements of the superglobal array and also takes into account the different values that might be provided based on the web server. The only thing I will mention about using the server_port element is to make sure you know what port your server is using for HTTPS connections. I believe 443 is the standard, but ports can be changed so you just want to make sure you are checking the correct port for your server.</p>
<h2>What about CodeIgniter (CI)?</h2>
<p>If your programming using CI, you could certainly put the function above in a helper and call it whenever necessary. Or, a technique I&#8217;ve used successfully in the past, is to put the check in a custom library and auto load it. When you do it this way the connection is tested every time a page is loaded automatically without you having to make any additional function calls. And instead of returning TRUE or FALSE you can simply redirect the user to the requested page using HTTPS instead of HTTP which truly automates the process.</p>
<p>One thing that can trip you up when making secure connections using CI is the address you&#8217;ve entered on line 14 of application/config/config.php. If you enter just a static address starting with HTTP then HTTP will be used when calling any URL helper function like site_url() or anchor(). To avoid this issue,&nbsp; you can replace line 14 with the following code from the <a href="http://codeigniter.com/wiki/Automatic_configbase_url/">CI wiki</a>:</p>
<pre class="brush: php">

$config[&#039;base_url&#039;] = ((isset($_SERVER[&#039;HTTPS&#039;]) &amp;amp;&amp;amp; $_SERVER[&#039;HTTPS&#039;] == &quot;on&quot;) ? &quot;https&quot; : &quot;http&quot;);
$config[&#039;base_url&#039;] .= &quot;://&quot;.$_SERVER[&#039;HTTP_HOST&#039;];
$config[&#039;base_url&#039;] .= str_replace(basename($_SERVER[&#039;SCRIPT_NAME&#039;]),&quot;&quot;,$_SERVER[&#039;SCRIPT_NAME&#039;]); 
</pre>
<p>This code will automatically set the base_url config element so you don&#8217;t have to. This also comes in real handy when writing portable code that you want to distribute to other users or clients for installation on their own servers.</p>
<h2>That&#8217;s a wrap</h2>
<p>That does it for making sure your files are being accessed securely. If you have any questions or use a different technique for checking secure connections please share them by posting a comment.</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2008/09/customizing-domains-with-wildcard-dns/' rel='bookmark' title='Permanent Link: Customizing Domains With Wildcard DNS'>Customizing Domains With Wildcard DNS</a></li>
<li><a href='http://www.christophermonnat.com/2009/02/implementing-facebook-connect-part-3-accessing-data-from-facebook/' rel='bookmark' title='Permanent Link: Implementing Facebook Connect (Part 3) &#8211; Accessing Data from Facebook'>Implementing Facebook Connect (Part 3) &#8211; Accessing Data from Facebook</a></li>
<li><a href='http://www.christophermonnat.com/2008/08/generating-pdf-files-using-codeigniter/' rel='bookmark' title='Permanent Link: Generating PDF files using CodeIgniter'>Generating PDF files using CodeIgniter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/05/how-to-ensure-a-secure-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m a Zend Certified Engineer (ZCE)</title>
		<link>http://www.christophermonnat.com/2009/03/im-a-zend-certified-engineerzce/</link>
		<comments>http://www.christophermonnat.com/2009/03/im-a-zend-certified-engineerzce/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 15:04:29 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=562</guid>
		<description><![CDATA[Last week I mentioned that I was going in for my Zend PHP 5 Certification exam on Friday. The test has come and gone and I&#8217;m happy to say I passed. To be honest, the test was a little more difficult than I thought it would be and I was a bit nervous at the [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I mentioned that I was going in for my Zend PHP 5 Certification exam on Friday. The test has come and gone and I&#8217;m happy to say I passed. To be honest, the test was a little more difficult than I thought it would be and I was a bit nervous at the end. But I passed and I can cross that off my list of goals for 2009 <img src='http://www.christophermonnat.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>If you are considering getting certified I would deffinitly recommend it. I can&#8217;t speak on the impact it will have on your ability to get a job or anything like that, but I can tell you that it&#8217;s a nice accomplishment just for yourself. If there was one thing I learned while studying for the test it&#8217;s how much I didn&#8217;t know about PHP. 5 years of programming still left some large gaps in my knowledge which this process has helped me realize and reduce. If your not certified give it a shot, you&#8217;ve got nothing to loose.</p>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/03/zend-php-certification-necessary-or-not/' rel='bookmark' title='Permanent Link: Zend PHP Certification: Necessary or Not?'>Zend PHP Certification: Necessary or Not?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/03/im-a-zend-certified-engineerzce/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Zend PHP Certification: Necessary or Not?</title>
		<link>http://www.christophermonnat.com/2009/03/zend-php-certification-necessary-or-not/</link>
		<comments>http://www.christophermonnat.com/2009/03/zend-php-certification-necessary-or-not/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 17:25:42 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.christophermonnat.com/?p=547</guid>
		<description><![CDATA[Image via Wikipedia I have to start this post out with a quick apology for the lack of recent posts. There is a lot going on right now: working on ScoutPath (which launches in June), putting out fires in BadgeTracker and working full time at my day job. All of this leaves little time for [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:PHP-logo.svg"><img title="PHP" src="http://upload.wikimedia.org/wikipedia/en/thumb/2/27/PHP-logo.svg/202px-PHP-logo.svg.png" alt="PHP" width="202" height="107" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:PHP-logo.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>I have to start this post out with a quick apology for the lack of recent posts. There is a lot going on right now: working on <a href="http://www.myscoutpath.com">ScoutPath </a>(which launches in June), putting out fires in <a href="http://www.badgetracker.com">BadgeTracker</a> and working full time at my day job. All of this leaves little time for blogging (or anything else for that matter). Another thing I&#8217;m working on is getting my <a href="http://www.zend.com/en/services/certification/php-5-certification/">Zend PHP 5 certification</a> and that brings me to this post. A couple of years ago when Zend first announced the certification I was determined to get certified but just haven&#8217;t put my mind to it until recently. However, after studying for the last couple of weeks and taking the <a href="http://vulcan.phparch.com">practice tests</a> I am left wondering what this certification proves and whether it&#8217;s truly worth it.<br />
<span id="more-547"></span></p>
<h2>The Test</h2>
<p>For those of you not familiar with the test let me break it down for you:</p>
<ul>
<li>70 questions</li>
<li>a combination of multiple choice (with multiple answers) and short answer</li>
<li>you get 90 minutes to complete</li>
</ul>
<p>The test is taken on a computer in true Who Want&#8217;s to be a Millionaire fashion, just without Regis. When done you are told whether you have passed or failed. Now the whole computer test thing is bugging me a little because I had an incident back in college where my laptop shit the bed <strong>during</strong> a programming final and I was only able to complete part of the test. But I&#8217;m sure the test producers have thought of all that <img src='http://www.christophermonnat.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<h2>What does it prove?</h2>
<p>If I displayed a big long code block here with 2 or 3 lines blanked out with question marks and then asked you to tell me what code should replace the question marks to achieve some final result, could you do it? That&#8217;s just one example of the questions asked on this test and I&#8217;m racking my brain trying to figure out what knowing the answer to that question proves. Does it show that I know PHP or that I just know the subject matter of that particular script? Or that I can understand confusing questions?</p>
<p>I think the question of what a particular certification really proves pops up now and then within the professional community when people try to put a weight to a specific accomplishment. Is it the difference maker between getting the job or being shown the door? I don&#8217;t necessarily think so but that&#8217;s a determination each person or company needs to make for themselves.</p>
<h2>Is it worth it?</h2>
<p>The test costs $125 and your free to spend anything above that on various preparation methods but all considered it&#8217;s a pretty cheap proposition. When you pass you are added to the <a href="http://www.zend.com/en/store/education/certification/yellow-pages.php">Zend Yellow Pages</a> and you get access to the Zend Certified Engineers LinkedIn group. You can also download a nifty badge to put on your blog and resume but overall these are nice perks. These are in addition to putting it on your resume and such as well which helps you get noticed by employers and bosses and such too.</p>
<p>So, is it worth it? I think so, but that&#8217;s a determination you will have to make for yourself.</p>
<h2>Wrap up</h2>
<p>Becoming PHP certified is a nice feather to put in your cap to differentiate you from the thousands of other PHP programmers out and about. What the questions actually prove is still up for debate but overall I think it will be a good thing. I&#8217;m taking the test on Friday so I&#8217;ll be sure to post a follow-up on the whole certification process next week.</p>
<p>Stay tuned!</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/45898756-0397-4e40-ab15-e8e7467d31e4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=45898756-0397-4e40-ab15-e8e7467d31e4" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>


<p>Related posts:<ol><li><a href='http://www.christophermonnat.com/2009/03/im-a-zend-certified-engineerzce/' rel='bookmark' title='Permanent Link: I&#8217;m a Zend Certified Engineer (ZCE)'>I&#8217;m a Zend Certified Engineer (ZCE)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.christophermonnat.com/2009/03/zend-php-certification-necessary-or-not/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
