Ask applicants for payment authorization after email confirmation
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 30 Mar 2014 03:30:38 +0000 (23:30 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 30 Mar 2014 03:30:38 +0000 (23:30 -0400)
Suggest $10, authorization expires after 30 days if we do
nothing. This should smooth out the join process a bit.

app/app.sig
app/app.sml
app/confirm.mlt

index 2b7de99..07ed94c 100644 (file)
@@ -20,4 +20,6 @@ sig
     val userExists : string -> bool
 
     val confirm : int * string -> bool
+
+    val appUserName : int -> string
 end
index 513fa94..f1a2c14 100644 (file)
@@ -197,4 +197,11 @@ fun confirm (id, passwd) =
          | NONE => false
     end
 
+fun appUserName id =
+    case C.oneOrNoRows (getDb ()) ($`SELECT name
+                                    FROM MemberApp
+                                    WHERE id = ^(C.intToSql id)`) of
+       SOME [name] => C.stringFromSql name
+      | NONE => raise Fail "Membership application not found"
+
 end
index 0cc9776..63e1a4a 100644 (file)
@@ -4,11 +4,34 @@ val id = Web.stoi ($"id");
 val passwd = $"p";
 
 if App.confirm (id, passwd) then
-   %><h3><b>Confirmation successful</b></h3>
-   You should hear from us within a few days from now.<%
+%><h3><strong>Confirmation successful</strong></h3>
+   <p>You should hear from us within a few days (usually at most 48 hours).</p>
+
+<h3>Authorize Us To Charge You With PayPal</h3>
+
+<p>If you'd like, you can authorize us to charge your initial dues
+using Paypal now. This will place a hold on your Paypal account which
+is automatically released after 30 days, and will be released
+immediately if we reject your application for some reason. You can
+also pay your initial dues after we have approved your application. </p>
+
+<p>You are only required to send $10 for your initial balance, but you
+  may send as much as you'd like. You must either use a verified
+  Paypal account, or use a credit card with a confirmed address.</p>
+
+<form method="GET" action="https://www.paypal.com/cgi-bin/webscr">
+<input type="hidden" name="cmd" value="_xclick" />
+<input type="hidden" name="business" value="payment@hcoop.net" />
+<input type="hidden" name="paymentaction" value="authorization" />
+<input type="hidden" name="item_name" value="New Member payment authorization for <% App.appUserName id %>" /></label>
+<label>Amount $<input id="paypalDues" type="text" name="amount" pattern="^\\d+\\.\\d\\d$" required="required" size="7" value="10.00" /></label>
+<input type="image" src="https://www.paypalobjects.com/webstatic/en_US/btn/btn_buynow_pp_142x27.png" style="vertical-align: middle" />
+</form>
+
+<%
 else
    %><h3><b>Error confirming</b></h3>
    Did you already follow this confirmation link?<%
 end;
 
-@footer[] %>
\ No newline at end of file
+@footer[] %>