This sample creates a simple serverless Firebase cloud function to generate Wyre reservation ids and Checkout URLs.
- Create a Wallet Order Reservation on POST request. (view code).
- Wyre Checkout: https://docs.sendwyre.com/docs/getting-started-wyre-checkout
- Wyre Wallet Order Reservations: https://docs.sendwyre.com/docs/wallet-order-reservations
- Firebase docs: https://firebase.google.com/docs/functions
- Create a Firebase Project using the Firebase Developer Console
- Enable billing on your project by switching to the Blaze 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 Wyre API Key & Secret to firebase config:
firebase functions:config:set wyre.key=YOUR-WYRE-KEY wyre.secret=YOUR-WYRE-SECRET-KEY
- Firebase config instructions
- Get your Wyre Account Id
- Deploy your project using
firebase deploy --only functions:wyreReservation
- Test your Wallet Order Reservation integration by viewing your deployed site
firebase open hosting:site
firebase serve --only functions:wyreReservation
Once you’re ready to go live, you will need to exchange your test keys for your live keys. Reach out to [email protected] and schedule an integration review. See the Wyre dashboard for further details.
- Update your Wyre keys config:
firebase functions:config:set wyre.key=YOUR-WYRE-KEY wyre.secret=YOUR-WYRE-SECRET-KEY
- Redeploy functions for the changes to take effect
firebase deploy --only functions:wyreReservation
.