Skip to content

Instantly share code, notes, and snippets.

@tomaslin
Created June 7, 2011 10:15
Show Gist options
  • Save tomaslin/1011989 to your computer and use it in GitHub Desktop.
Save tomaslin/1011989 to your computer and use it in GitHub Desktop.
A simple payment app
A simple payment app.
Your task is to implement a simple payment tracking system in Grails or your preferred framework.
Requirements:
- Accounts have a balance, name, email.
- Every user starts off with £200.
- We would like to see proper use of tests, gsp tags and clean code.
- Don't worry about putting in a proper user management or security layer.
What should happen:
1: Customer rep goes to the pay screen. Selects pay from Joe to Patty. Payment is removed from Joe's balance and given to Patty. Patty gets an email. Joe gets an email.
2: Customer rep goes to the transaction screen. Selects Patty. See all transactions for Patty.
3: Customer rep tries to pay from Joe to Patty. Amount too large. Gets error.
Here is some awesome skeletal html from our designers. Please put the right gsp tags. You don't need to worry about making it pretty.
--- Pay.gsp ---
<html>
<head>
<title>Pay Some Person</title>
<meta name="layout" content="main" />
</head>
<body>
[ errors go here ]
<div>
<h2>Pay</h2>
<br/>
<b>From:</b> [ from Account.list() ] <---- dropdown
<br/>
<b>To: </b> [ from Account.list() ] <---- dropdown
<br/>
<b>Amount:</b> [ text input ]
<br/>
<b>[ submit ]</b>
</div>
</body>
</html>
--- Transactions.gsp ---
<html>
<head>
<title>See transactions</title>
<meta name="layout" content="main" />
</head>
<body>
<div>
<h2>Pay</h2>
<br/>
[ errors go here ]
<b>Person:</b> [ from Account.list() ] <---- dropdown
<br/>
<b>[ submit ]</b>
------------------------------------------------------
<div>Balance: [amount]</div>
<div>some awesome table with transaction amounts</div>
</div>
</body>
</html>
Tips:
- Use the greenmail plugin.
- Bonus points for Ajax.
- Don't spend more than 2 hours on this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment