aboutsummaryrefslogtreecommitdiffstats
path: root/purchase
diff options
context:
space:
mode:
authorTeddy Wing2015-06-07 19:38:28 -0400
committerTeddy Wing2015-06-07 19:38:28 -0400
commitf61bdaf1f62d6fd73ceaddd7c96beb41b2869552 (patch)
tree05e2eab5b3a289b3443a511761fa5b5ffdfe9d0f /purchase
parent7e57f147312fb9858e5071e6211e6e26b0092c17 (diff)
parent502db93bf61c1c73d7b774d862f91b6fafefb1e6 (diff)
downloadNew-House-on-the-Block-f61bdaf1f62d6fd73ceaddd7c96beb41b2869552.tar.bz2
Merge branch 'webserver'
Diffstat (limited to 'purchase')
-rw-r--r--purchase/purchase.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/purchase/purchase.go b/purchase/purchase.go
new file mode 100644
index 0000000..45940f2
--- /dev/null
+++ b/purchase/purchase.go
@@ -0,0 +1,23 @@
+package purchase
+
+import (
+ "github.com/teddywing/new-house-on-the-block/vendor/_nuts/github.com/fabioberger/coinbase-go"
+)
+
+func SendMoney(from_key string, from_secret string,
+ to string, amount string) (transaction_id string, err error) {
+ c := coinbase.ApiKeyClientSandbox(from_key, from_secret)
+
+ params := &coinbase.TransactionParams{
+ To: to,
+ Amount: amount,
+ Notes: "You just bought a house",
+ }
+
+ confirmation, err := c.SendMoney(params)
+ if err != nil {
+ return "", err
+ } else {
+ return confirmation.Transaction.Id, nil
+ }
+}