[guadec-web-regcfp] Add paypal profile
- From: Patrick Uiterwijk <puiterwijk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [guadec-web-regcfp] Add paypal profile
- Date: Fri, 19 Jun 2015 14:13:09 +0000 (UTC)
commit 6d774d68ec17c82eeffb8d1c40630ae8d108f059
Author: Patrick Uiterwijk <puiterwijk redhat com>
Date: Fri Jun 19 16:12:40 2015 +0200
Add paypal profile
bin/paypal-create-profile | 34 ++++++++++++++++++++++++++++++++++
routes/registration.js | 1 +
2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/bin/paypal-create-profile b/bin/paypal-create-profile
new file mode 100755
index 0000000..e746e20
--- /dev/null
+++ b/bin/paypal-create-profile
@@ -0,0 +1,34 @@
+#!/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']);
+
+var profile = {
+ 'name': 'GUADEC Registration Profile',
+ 'presentation': {
+ 'brand_name': 'GNOME Foundation',
+ 'logo_image': 'https://www.guadec.org/wp-content/uploads/2014/10/guadec-logo-white.png',
+ 'locale_code': 'US',
+ },
+ 'input_fields': {
+ 'allow_note': true,
+ 'no_shipping': 1,
+ 'address_override': 0
+ },
+ 'flow_config': {
+ 'landing_page_type': 'billing',
+ 'bank_txn_pending_url': 'http://www.guadec.org'
+ }
+};
+
+paypal.webProfile.create(profile, function(error, profile) {
+ if(!!error) {
+ console.log("Error");
+ console.log(error);
+ } else {
+ console.log("Profile");
+ console.log(profile);
+ }
+});
diff --git a/routes/registration.js b/routes/registration.js
index da03fc6..66aa048 100644
--- a/routes/registration.js
+++ b/routes/registration.js
@@ -113,6 +113,7 @@ router.post('/pay/paypal/execute', function(req, res, next) {
function create_payment(req, res, next, amount) {
var create_payment = {
'intent': 'sale',
+ "experience_profile_id": config['registration']['paypal_experience_profile'],
'payer': {
'payment_method': 'paypal'
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]