This file contains 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
export const sendSMSVerificationCode = async (event, context, callback) => { | |
try { | |
context.callbackWaitsForEmptyEventLoop = false; | |
await connectToDB(); | |
const data = JSON.parse(event.body); | |
const { phone } = data; | |
console.log(phone); | |
const code = Math.floor(1000 + Math.random() * 9000); | |
let user; |
This file contains 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"; | |
const RippleAPI = require("ripple-lib").RippleAPI; | |
const address = "THE ADDRESS OF YOUR WALLET"; | |
const secret = "THE SECRET KEY FOR YOUR WALLET"; | |
const api = new RippleAPI({ server: "wss://s1.ripple.com:443" }); | |
const instructions = { maxLedgerVersionOffset: 5 }; | |
const payment = { |
This file contains 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
const paymentMethods = await stripe.paymentMethods.list({ | |
customer: stripeCustomerID, | |
type: "card", | |
}); | |
const payment_method = paymentMethods.data[0].id; | |
const paymentIntent = await stripe.paymentIntents.create({ | |
payment_method_types: ["card"], | |
amount: 1000, | |
customer: stripeCustomerID, | |
payment_method, |
This file contains 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
import React, { useState, useContext, useEffect } from "react"; | |
import { DashboardContext } from "../../../../../shared/context"; | |
import { WebView } from "react-native-webview"; | |
import { CORE_API_URL } from "../../../../../shared/api"; | |
import { PageLoading } from "../../../../../assets/animations/loading"; | |
import axios from "axios"; | |
const AddPaymentMethod = () => { | |
const context = useContext(DashboardContext); | |
const { user, setUser, setUserStripeAccount } = context; | |
const [sessionId, setSessionId] = useState(null); |
This file contains 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
import React, { useEffect } from "react"; | |
import { useParams } from "react-router-dom"; | |
import { loadStripe } from "@stripe/stripe-js"; | |
const StripeCheckout = () => { | |
const params = useParams(); | |
console.log(params); | |
const { id } = params; | |
useEffect(() => { | |
const asyncFunc = async () => { |
This file contains 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
const customer = await stripe.customers.create(); | |
const { id } = customer | |
const session = await stripe.checkout.sessions.create({ | |
customer: id, | |
payment_method_types: ["card"], | |
mode: "setup", | |
success_url: `${host}/stripe-checkout-status?success=true`, | |
cancel_url: `${host}/stripe-checkout-status?errors=true`, |
This file contains 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
[ | |
{ | |
"uid": "d435473e-5937-4c66-8694-688319057562", | |
"title": "Where do you want to stay?", | |
"type": "multipleChoice", | |
"answers": [ | |
{ | |
"uid": "bbb-1", | |
"label": "San Francisco" | |
}, |
This file contains 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
package api | |
import ( | |
"server/api/apierror" | |
"server/slog" | |
"server/store" | |
) | |
// VerifyUserIdentity allows a user to mark there identity verification method as skipped to allow booking in the ios app | |
// Products: ios app |
This file contains 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
import React, { useEffect } from 'react'; | |
import { Route, useHistory } from 'react-router-dom'; | |
import jwt from 'jsonwebtoken'; | |
const PrivateRoute = ({ children, ...rest }) => { | |
const history = useHistory(); | |
useEffect(() => { | |
const onMount = async () => { // create an async function | |
let localStorageUser = localStorage.getItem('user'); // check if user exists in localstorage | |
let isValid = true; // is the json web token still valid? | |
if (localStorageUser) { |
This file contains 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
/** | |
* Definition for isBadVersion() | |
* | |
* @param {integer} version number | |
* @return {boolean} whether the version is bad | |
* isBadVersion = function(version) { | |
* ... | |
* }; | |
*/ |
NewerOlder