Permalink
Browse files

recurlyjs public beta, one-time-transactions, update billing info, an…

…d a lot more improvements
  • Loading branch information...
1 parent a43aad2 commit 70422689c6039b95e584302594042e71b4d7083b @em em committed Aug 10, 2011
View
@@ -105,5 +105,3 @@ It currently depends on jQuery 1.5.2+. Not a problem if you already use it. A fu
* Multi-currency
* Localization (english only right now)
-* Account Management (update billing info, upgrade/downgrade, cancellation)
-* One time transactions
@@ -1,2 +1,2 @@
-<h1> Thanks for subscribing! </h1>
+<h1> Success! </h1>
View
@@ -0,0 +1,84 @@
+html {
+ font-family: "helvetica neue", helvetica, arial;
+ margin: 0;
+ padding: 0;
+ background: #c0c1c3 url("../images/noise.png") no-repeat center top;
+}
+h1 {
+ width: 500px;
+ margin: 30px auto;
+ text-align: center;
+ color: #fff;
+ text-shadow: 0 1px 1px #111;
+}
+h2 {
+ width: 500px;
+ margin: -20px auto 0 auto;
+ text-align: center;
+ font-size: 18px;
+ text-shadow: 0 1px 0 #fff;
+}
+p {
+ margin: 20px;
+ text-shadow: 0 1px 0 #eee;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 26px;
+ text-align: justify;
+}
+code {
+ font-family: menlo, monaco, "Lucida Console", monospace;
+ padding: 2px 4px;
+ font-size: 13px;
+ background: rgba(55,100,150,0.3);
+ color: #fff;
+ letter-space: 1px;
+ text-shadow: 0 1px 0 #467;
+ border-radius: 4px;
+}
+a {
+ color: inherit;
+ font-weight: bold;
+}
+#index {
+ width: 480px;
+ margin: 0 auto;
+}
+#examples {
+ margin: 20px;
+ font-weight: inherit;
+}
+#examples a {
+ display: block;
+ overflow: hidden;
+ padding: 10px 15px;
+ margin-bottom: 10px;
+ border-radius: 18px;
+ color: #fff;
+ text-shadow: 0 1px 0 #000;
+ font-weight: inherit;
+ text-decoration: none;
+ position: relative;
+ background: rgba(0,10,0,0.4);
+ box-shadow: 0 2px 1px rgba(0,0,0,0.1);
+}
+#examples a:hover {
+ color: #fff;
+ background: rgba(0,0,0,0.85);
+}
+#examples a:hover:after {
+ content: "\25B6";
+ position: absolute;
+ right: 15px;
+}
+#recurly-subscribe,
+#recurly-update-billing-info,
+#recurly-transaction {
+ width: 500px;
+ margin: 30px auto;
+ padding: 0px;
+ border: 1px solid #999;
+ border-radius: 8px;
+ background: #fcfcfc url("../images/pulp.jpeg") repeat;
+ box-shadow: 0px 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 #fff;
+}
View
@@ -18,9 +18,9 @@
, VATPercent: 10
});
- Recurly.buildSubscribeForm({
+ Recurly.buildSubscriptionForm({
target: '#recurly-subscribe'
- , plan: 'complexplan'
+ , planCode: 'complexplan'
, addressRequirement: 'full'
, successURL: 'confirmation.html?account_code={account_code}'
});
View
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Recurly.js Examples</title>
+<link rel="stylesheet" href="examples.css" type="text/css" />
+<link rel="stylesheet" href="../recurly.css" type="text/css" />
+</head>
+ <body>
+ <h1>Recurly.js</h1>
+ <h2>Examples</h2>
+ <div id="index">
+
+ <div id="examples">
+ <a href="subscribe.html">Subscribe to Plan</a>
+ <a href="update_billing_info.html">Update Billing Info</a>
+ <a href="one_time_transaction.html">One Time Transaction</a>
+ <a href="gridsystem.html">Grid System Design</a>
+ </div>
+
+ <p>All examples point to a company we created specifically for this demo, called <code>recurlyjsdemo</code>. Naturally you'll want to replace all occurances with your real company subdomain.</p>
+ <p>The demo company defines two plans: <code>simpleplan</code>, and <code>complexplan</code>, and
+ a forever 30% off coupon, named <code>test</code>.</p>
+
+ <p>Update Billing Info, and One-time Transactions both require <a href="vv">parameter signatures</a>, which must be generated server-side and rendered to an option. For demonstration purposes we pre&#8209;computed the signatures and hardcoded them in.</p>
+ </div>
+ </body>
+</html>
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>RecurlyJS One-time Transaction Example</title>
+<!-- <link rel="stylesheet" href="../style/reset.css" type="text/css" /> -->
+<link rel="stylesheet" href="examples.css" type="text/css" />
+<link rel="stylesheet" href="../recurly.css" type="text/css" />
+<script src="lib/jquery-1.6.1.js"></script>
+<script src="../recurly.js"></script>
+<script>
+ Recurly.config({
+ environment: 'sandbox'
+ , subdomain: 'recurlyjsdemo-test'
+ , baseURL: 'http://api-sandbox.lvh.me:3000/jsonp/emeryco-test/'
+ , currency: 'USD'
+ , country: 'US'
+ , VATPercent: 10
+ });
+
+ Recurly.buildTransactionForm({
+ target: '#recurly-transaction'
+ , accountCode: 'testaccount'
+ , amountInCents: 5000
+ , successURL: 'confirmation.html?account_code={account_code}&signature={signature}'
+ , signature: 'f37ecbd8556f936161d3b9a76cf9291ed46a3000-1312409907'
+ // Signature must be generated server-side with sign_transaction()
+ // Without it the request will be rejected.
+ //
+ // !!! IMPORTANT !!!
+ // You must use verify_transaction() with the GET variables passed to successURL
+ // http://docs.recurly.com/recurlyjs/signatures/
+ });
+</script>
+
+</head>
+ <body>
+ <h1>One-time Transaction</h1>
+ <h2>Dollar Amount: $50</h2>
+ <div id="recurly-transaction">
+ </div>
+ </body>
+</html>
View
@@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title>RecurlyJS Subscribe Demo</title>
+<title>RecurlyJS Subscribe Example</title>
<!-- <link rel="stylesheet" href="../style/reset.css" type="text/css" /> -->
-<link rel="stylesheet" href="simple.css" type="text/css" />
+<link rel="stylesheet" href="examples.css" type="text/css" />
<link rel="stylesheet" href="../recurly.css" type="text/css" />
<script src="lib/jquery-1.6.1.js"></script>
<script src="../recurly.js"></script>
@@ -18,16 +18,19 @@
, VATPercent: 10
});
- Recurly.buildSubscribeForm({
+ Recurly.buildSubscriptionForm({
target: '#recurly-subscribe'
- , plan: 'simpleplan'
+ , planCode: 'simpleplan'
, addressRequirement: 'zipstreet'
, successURL: 'confirmation.html?account_code={account_code}'
+ , distinguishContactFromBillingInfo: true
});
});
</script>
</head>
<body>
+ <h1>Subscribe to Plan</h1>
+ <h2>Plan Code: simpleplan (exists)</h2>
<div id="recurly-subscribe">
</div>
</body>
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>RecurlyJS Update Billing Info Example</title>
+<!-- <link rel="stylesheet" href="../style/reset.css" type="text/css" /> -->
+<link rel="stylesheet" href="examples.css" type="text/css" />
+<link rel="stylesheet" href="../recurly.css" type="text/css" />
+<script src="lib/jquery-1.6.1.js"></script>
+<script src="../recurly.js"></script>
+<script>
+ Recurly.config({
+ environment: 'sandbox'
+ , subdomain: 'recurlyjsdemo-test'
+ /* , baseURL: 'http://api-sandbox.lvh.me:3000/jsonp/emeryco-test/' */
+ , currency: 'GBP'
+ , country: 'GB'
+ , VATPercent: 10
+ });
+
+ Recurly.buildUpdateBillingInfoForm({
+ target: '#recurly-update-billing-info'
+ , accountCode: 'testaccount'
+ , successURL: 'confirmation.html?account_code={account_code}'
+ , signature: '04e2f13f2db4f7cfc87d915eee94870fc3e15caa-1312409866'
+ // Signature must be generated server-side with a utility method provided in client libraries.
+ // e.g. Recurly::billing_info_signature(accountcode)
+ // It guarantees that you grant the end-user the right to update billing info for this account
+ // Without it the request will be rejected.
+ });
+</script>
+
+</head>
+ <body>
+ <h1>Update Billing Info</h1>
+ <h2>Account Code: testaccount (exists)</h2>
+ <div id="recurly-update-billing-info">
+ </div>
+ </body>
+</html>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 7042268

Please sign in to comment.