Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob H committed Apr 28, 2021
0 parents commit 2a53420
Show file tree
Hide file tree
Showing 54 changed files with 5,490 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "paymentintent"
}
}
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ios/Runner/GoogleService-Info.plist

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 5bedb7b1d5698ce2c1c67aaf9afae7b3948b172a
channel: beta

project_type: app
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# payment_intent

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
9 changes: 9 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"remoteconfig": {
"template": "remoteconfig.template.json"
}
}
1 change: 1 addition & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
20 changes: 20 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const stripe = require('stripe')(functions.config().stripe.secretkey, {apiVersion: '2019-05-16'});
// 2020-08-27

exports.pub_key = functions.https.onRequest(async (req, res) => {
res.json({ publishable_key: functions.config().stripe.pubkey });
});

exports.create_payment_intent = functions.https.onRequest(async (req, res) => {
try {
const paymentIntent = await stripe.paymentIntents.create({
amount: req.query.amount,
currency: req.query.currency,
});
res.json({ clientSecret: paymentIntent.client_secret });
} catch(err) {
res.status(400).json({ error: { message: err.message } })
}
});
Loading

0 comments on commit 2a53420

Please sign in to comment.