All Projects → stripe-samples → firebase-mobile-payments

stripe-samples / firebase-mobile-payments

Licence: MIT license
Firebase Cloud Functions to create payments in native Android and iOS applications.

Programming Languages

kotlin
9241 projects
javascript
184084 projects - #8 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to firebase-mobile-payments

open-crowd-fund
🐣 Your open source solution to crowd fund your ideas. Powered by Gatsby.js.
Stars: ✭ 95 (+97.92%)
Mutual labels:  stripe
commerce-stripe
Stripe payment gateway for Craft Commerce
Stars: ✭ 21 (-56.25%)
Mutual labels:  stripe
charging-for-multiple-plan-subscriptions
Getting started with Stripe Elements and Stripe Billing to charge a customer for a monthly subscription with multiple items.
Stars: ✭ 54 (+12.5%)
Mutual labels:  stripe
subscribie
Collect recurring payments online - subscription payments collection automation
Stars: ✭ 36 (-25%)
Mutual labels:  stripe
stripe-graphql
[WIP] 🚧🚧🚧 😎 Community-driven Stripe GraphQL API with superpowers.
Stars: ✭ 53 (+10.42%)
Mutual labels:  stripe
saving-card-after-payment
Learn how to save a card for later reuse after making a payment
Stars: ✭ 78 (+62.5%)
Mutual labels:  stripe
payment-fields
React component for Braintree/Stripe/Square payment fields
Stars: ✭ 17 (-64.58%)
Mutual labels:  stripe
invoicing
GetPaid (Formerly the Invoicing plugin) is a lightweight Payments and Invoicing system for WordPress. It can be used to sell anything online via payment forms or buy now buttons that can be added to any landing page. It can also be used by freelancers to manage their Invoices or by 3rd party Themes and Plugins as their payment system. GeoDirecto…
Stars: ✭ 34 (-29.17%)
Mutual labels:  stripe
laravel-stripe
No description or website provided.
Stars: ✭ 14 (-70.83%)
Mutual labels:  stripe
proof-of-kyc
An NFT that proves you've gone through an identity verification process, powered by Stripe Identity.
Stars: ✭ 78 (+62.5%)
Mutual labels:  stripe
angular-universal-firebase-hosting
An Angular Universal project on Firebase
Stars: ✭ 13 (-72.92%)
Mutual labels:  firebase-cloud-functions
teini
👶 Teini (tiny, [ˈtīnē]) is an extremely small webshop leveraging awesome and free solutions like Github and Vercel.
Stars: ✭ 148 (+208.33%)
Mutual labels:  stripe
nextjs-woocommerce-restapi
A React WooCommerce Project Example With REST API
Stars: ✭ 168 (+250%)
Mutual labels:  stripe
module-stripe
Stripe Payments for Magento 2
Stars: ✭ 45 (-6.25%)
Mutual labels:  stripe
discourse-subscriptions
A Discourse plugin that allows payments and subscription management via Stripe.
Stars: ✭ 24 (-50%)
Mutual labels:  stripe
Ignite
A comprehensive Flask boilerplate to build SaaS applications that includes Stripe billing, emails, login, and OAuth.
Stars: ✭ 102 (+112.5%)
Mutual labels:  stripe
pinax-stripe-light
a payments Django app for Stripe
Stars: ✭ 670 (+1295.83%)
Mutual labels:  stripe
react-native-stripe
Unofficial integration of the payment APIs from the Stripe SDK on react-native
Stars: ✭ 21 (-56.25%)
Mutual labels:  stripe
koa-better-error-handler
A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)
Stars: ✭ 51 (+6.25%)
Mutual labels:  stripe
commercejs-chopchop-demo
A Commerce.js starter kit for Next.js. A beautifully designed elegantly developed, end to end commerce experience for developers and agencies. Pre-integrated with Stripe. One-click deploy to Vercel.
Stars: ✭ 129 (+168.75%)
Mutual labels:  stripe

This project is inactive and is no longer being maintained.

Firebase mobile payments: Android & iOS with Cloud Functions for Firebase

This example includes Firebase Cloud Functions to create payments in native Android and iOS (coming soon) applications.

Features:

  • Android client
  • iOS SwiftUI client
  • Functions
    • Create a customer object when a users signs up via Firebase Authentication and add a customer entry to Cloud Firestore: createStripeCustomer
    • Callable functions to create a short-lived ephemeral keys for the SDK's prebuilt UI components: createEphemeralKey
    • Function to create a PaymentIntent when a new payment doc is added to Cloud Firestore: createStripePayment
    • Webhook handler function to keep Cloud Firestore in sync with Stripe: handleWebhookEvents
    • When a user is deleted from Firebase Authentication, delete thir data in Cloud Firestore and their customer object in Stripe: cleanupUser
Video tutorial: Android Link to video tutorial

Recommended usage

Please note that when selling digital products or services within your app, (e.g. subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use the app store's in-app purchase APIs instead. See Apple's and Google's guidelines for more information.

Deploy and test

  • Create a Firebase Project using the Firebase Developer Console
  • Enable billing on your project by switching to the Blaze or Flame plan. See pricing for more details. This is required to be able to do requests to non-Google services.
  • Enable Google & Email sign-in in your authentication provider settings.
  • Install Firebase CLI Tools if you have not already and log in with firebase login.
  • Configure this sample to use your project using firebase use --add and select your project.
  • Install dependencies locally by running: cd functions; npm install; cd -
  • Add your Stripe API Secret Key to Firebase config:
    firebase functions:config:set stripe.secret=<YOUR STRIPE SECRET KEY>
  • Deploy your project using cd functions; npm run deploy; cd -

Setting up webhooks

  • Run firebase open functions to open the Firebase console.
  • Copy the URL for the handleWebhookEvents functions (e.g. https://region-project-name.cloudfunctions.net/handleWebhookEvents)
  • Create a new webhook endpoint with the URL in the Stripe Dashboard
  • Copy the signing secret (whsec_xxx) and add it to Firebase config:
    firebase functions:config:set stripe.webhooksecret=<YOUR WEBHOOK SECRET>
  • Redeploy the handleWebhookEvents function: firebase deploy --only functions:handleWebhookEvents

Accepting live payments

Once you’re ready to go live, you will need to exchange your test keys for your live keys. See the Stripe docs for further details.

  • Update your Stripe secret config:
    firebase functions:config:set stripe.secret=<YOUR STRIPE LIVE SECRET KEY>
  • Set your live publishable key in your respective client integration.
  • Follow the Setting up webhooks from above for live mode.
  • Redeploy the functions for the changes to take effect cd functions; npm run deploy; cd -.

Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].