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 projectId = 'fb-functions-2019'; | |
const uploadsBucketName = 'my-image-upload-bucket' | |
const notSafedBucketName = 'my-not-safed-images' | |
const databaseTable = '/uploads' | |
// SDK do Cloud Functions para Firebase para criar Cloud Functions e escutar e executar eventos. | |
const functions = require('firebase-functions'); | |
const cors = require('cors')({ origin: true }); | |
// SDK do Firebase para acessar a base de dados em tempo real. |
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 } from 'react'; | |
import { Text, Alert, View, ActivityIndicator, TouchableOpacity } from 'react-native'; | |
import { MainContainer, Title, InputText, PersonalButton, HeaderCheckout } from './styles'; | |
import { WebView } from 'react-native-webview'; | |
export default function Checkout() { | |
const [idPagamento, setIdPagamento] = useState("1") | |
const [emailPagamento, setEmailPagamento] = useState("meuemail@gmail.com") | |
const [descricaoPagamento, setDescricaoPagamento] = useState("Venda de produto digital") |
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 MercadoPago = require('mercadopago'); | |
const getFullUrl = (req) =>{ | |
const url = req.protocol + '://' + req.get('host'); | |
console.log(url) | |
return url; | |
} | |
module.exports = { | |
async checkout(req, res){ |
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 express = require('express'); | |
const bodyParser = require('body-parser'); | |
const cors = require('cors'); | |
const engines = require('consolidate'); | |
const path = require('path'); | |
//Routes | |
const paymentsRoute = require('./src/routes/paymentsRoute'); | |
//Load environment |