I hereby claim:
- I am reichert621 on github.
- I am alexhaven (https://keybase.io/alexhaven) on keybase.
- I have a public key whose fingerprint is 17B5 344A 2ABB A851 11D5 7700 776C 6210 F268 C1A7
To claim this, I am signing this object:
// bower dependency: "ng-file-upload" | |
// npm dependency: "loopback-component-storage" | |
'use strict'; | |
angular | |
.module('app', [ | |
'ngFileUpload' | |
]) | |
.controller('UploadController', function(Upload) { |
I hereby claim:
To claim this, I am signing this object:
const handleValidations = inputs => { | |
const { name, email, birthday } = inputs; | |
const required = ['name', 'email', 'address', 'state', 'country', 'birthday']; | |
let errors = {}; | |
for (let i = 0; i < required.length; i += 1) { | |
const val = required[i]; | |
if (inputs[val].length < 1) { |
const moment = require('moment'); | |
const isInputPresent = input => { | |
return input && typeof input === 'string' && input.trim().length > 0; | |
}; | |
const isValidEmail = email => { | |
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return regex.test(String(email).toLowerCase()); |
const getValidators = () => { | |
return [ | |
{ | |
field: 'name', | |
validations: [ | |
[isInputPresent, 'Name is required'], | |
[isValidName, 'Invalid name'] | |
] | |
}, |
import request from 'superagent'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { | |
StripeProvider, | |
Elements, | |
CardElement, | |
injectStripe | |
} from 'react-stripe-elements'; |
import React from 'react'; | |
import { StripeProvider, Elements, injectStripe } from 'react-stripe-elements'; | |
// Replace with your public key (https://dashboard.stripe.com/test/apikeys) | |
const STRIPE_API_KEY = 'pk_test_xxx'; | |
const Checkout = props => { | |
const handleCheckout = () => { | |
props.stripe.redirectToCheckout({ | |
items: [{ sku: props.skuId, quantity: 1 }], |
import request from 'superagent'; | |
import React from 'react'; | |
import StripeCheckout from 'react-stripe-checkout'; | |
// Replace with your public key (https://dashboard.stripe.com/test/apikeys) | |
const STRIPE_API_KEY = 'pk_test_xxx'; | |
const createOrder = (skuId, customer) => { | |
const { email, name, address } = customer; |
// Load environment variables from our `.env` file | |
require('dotenv').config(); | |
const path = require('path'); | |
const express = require('express'); | |
// Make sure your STRIPE_SECRET_KEY exists as an environment variable! | |
// This should look something like `sk_test_xxxxxxxxxxxxxxxxxxxxxxxxx` | |
// and can be found at https://dashboard.stripe.com/test/apikeys | |
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); |