[guadec-web-regcfp] Add lookup tool



commit aad4a65a1007c2acd3647838d958304a6c096855
Author: Patrick Uiterwijk <puiterwijk redhat com>
Date:   Fri Jun 19 14:46:31 2015 +0200

    Add lookup tool

 bin/payment-lookup |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/bin/payment-lookup b/bin/payment-lookup
new file mode 100755
index 0000000..d6cea04
--- /dev/null
+++ b/bin/payment-lookup
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+var env = process.env.NODE_ENV || "development";
+var config = require('../config/config.json')[env];
+var paypal = require('paypal-rest-sdk');
+paypal.configure(config['paypal']);
+
+process.argv.forEach(function(val, index, array) {
+    if(index >1) {
+        console.log("Payment " + val + ":");
+        paypal.payment.get(val, function(error, payment) {
+            if(!!error) {
+                console.log("Error: ");
+                console.log(error);
+            } else {
+                console.log(payment);
+            }
+        });
+    };
+});


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]