This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps to creating a machine learning system | |
1. Create your JWT application with Box | |
2. Set up a webhook on a folder | |
3. Set up a lambda to listen for the webhook notifications | |
4. Upload a file using the Box file API (this will trigger your webhook) | |
5. Read in the file from Box and upload the file to your preferred machine learning system | |
6. When the machine learning system sends a notification (after processing the file) upload the new data (via the Box metadata API) to the file. | |
Resources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Initialize packages | |
const util = require('util'); // Deep inspection of objects | |
const boxSDK = require('box-node-sdk'); // Box SDK | |
const fs = require('fs'); // File system for config | |
// Fetch config file for instantiating SDK instance | |
// SAVE YOUR OWN APP CONFIG FILE TO config.json | |
const configJSON = JSON.parse(fs.readFileSync('config.json')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Redirect user to login with Box | |
String box_redirect = Config.box_redirect | |
+ "?response_type=code" | |
+ "&client_id=" + Config.client_id | |
+ "&redirect_uri=" + Config.redirect_uri; | |
res.redirect(box_redirect); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://svcs.sandbox.paypal.com/Permissions/RequestPermissions -s --insecure -H "X-PAYPAL-SECURITY-USERID: caller_1312486258_biz_api1.gmail.com" -H "X-PAYPAL-SECURITY-PASSWORD: 1312486294" -H "X-PAYPAL-SECURITY-SIGNATURE: AbtI7HV1xB428VygBUcIhARzxch4AL65.T18CTeylixNNxDZUu0iO87e" -H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON" -H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON" -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" -d '{"scope":"EXPRESS_CHECKOUT", "callback":"http://www.example.com/success.html", "requestEnvelope": { "errorLanguage":"en_US" }}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
bodyParser = require('body-parser'), | |
app = express(), | |
util = require('util'), | |
braintree = require('braintree'); | |
app.use( bodyParser.json() ); // to support JSON-encoded bodies | |
app.use(bodyParser.urlencoded({ // to support URL-encoded bodies | |
extended: true | |
})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Dropin</title> | |
</head> | |
<body> | |
<form id="checkout" method="post" action="http://localhost:3000/checkout"> | |
<div id="payment-form"></div> | |
<input type="submit" value="Make Payment"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-agreements | |
-H 'Content-Type:application/json' \ | |
-H 'Authorization: Bearer {accessToken}' \ | |
-d '{ | |
"name": "Main Subscription", | |
"description": "Fruit of the Month Subscription", | |
"start_date": "2015-02-19T00:37:04Z", | |
"plan": { | |
"id": "P-0NJ10521L3680291SOAQIVTQ" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-plans \ | |
-H 'Content-Type:application/json' \ | |
-H 'Authorization: Bearer {accessToken}' \ | |
-d '{ | |
"name": "Fruit of the Month", | |
"description": "10 Pound Box of Fruit", | |
"type": "fixed", | |
"payment_definitions": [ | |
{ | |
"name": "Standard Package", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"links":[ | |
{ | |
"href":"https://api.sandbox.paypal.com/v1/payments/authorization/9T287484DP554682S", | |
"rel":"self", | |
"method":"GET" | |
}, | |
{ | |
"href":"https://api.sandbox.paypal.com/v1/payments/authorization/9T287484DP554682S/capture", | |
"rel":"capture", | |
"method":"POST" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ id: 'CARD-3G9597783S5131059KFZC2GQ', | |
valid_until: '2016-04-19T00:00:00.000Z', | |
state: 'ok', | |
type: 'visa', | |
number: 'xxxxxxxxxxxx0331', | |
expire_month: '11', | |
expire_year: '2018', | |
first_name: 'Joe', | |
last_name: 'Shopper', | |
links: |
NewerOlder