forked from tjmehta/rest-api-sdk-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.js
35 lines (31 loc) · 957 Bytes
/
create.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Copyright 2015-2016 PayPal, Inc. */
"use strict";
var paypal = require('../../../');
require('../../configure');
//Name needs to be unique so just generating a random one
var profile_name = Math.random().toString(36).substring(7);
var create_web_profile_json = {
"name": profile_name,
"presentation": {
"brand_name": "Best Brand",
"logo_image": "https://www.paypalobjects.com/webstatic/mktg/logo/AM_SbyPP_mc_vs_dc_ae.jpg",
"locale_code": "US"
},
"input_fields": {
"allow_note": true,
"no_shipping": 1,
"address_override": 1
},
"flow_config": {
"landing_page_type": "billing",
"bank_txn_pending_url": "http://www.yeowza.com"
}
};
paypal.webProfile.create(create_web_profile_json, function (error, web_profile) {
if (error) {
throw error;
} else {
console.log("Create web_profile Response");
console.log(web_profile);
}
});