Buyte
Digital wallet payment orchestration on a serverless stack
Accelerate your eCommerce website checkout with an enhanced digital wallet payment orchestration. Integrate native Apple Pay and Google Pay with your Payment Processor(s).
Table of Contents
Features
- Frictionless: Skip passwords, account forms and the standard checkout flow. Minimise time to checkout, maximising conversions.
- Familiar: Allow your users to checkout using the same technology they use in-store.
- Secure: Apple and Google's security infrastructure prevents card/payment details from leaving your user's devices.
- Widgetised: Complete your checkout from anywhere on your website with the Buyte Checkout.
- Extensible: Bring your Payment Processor and pass on raw/decrypted payment data.
- Serverless: Scalable by default.
Supported Digital Wallets
Supported Payment Processors
Overview
This repository responsible for tokenisation of digital wallet payloads before passing on raw/decrypted payment data to the connected Payment Processor.
It is comprised of the Serverless API, CLI, Scripts, and AWS Amplify Configuration
The produced Binary is a CLI tool capable of running commands for administrative and development purposes as well as a command for starting the Tokenisation and Payment Processing API.
Installation Requirements
Supporting Repositories
Once this codebase has been set up, please visit:
- Buyte Dashboard
- Set up the Administration Portal where Checkouts can be created and connected to different Payment Processors.
- Buyte Checkout
- Configure and then install the Buyte Checkout JS library into your website referencing the Checkout ID produced in your Buyte Dashboard.
Getting Started
- Clone the repository
git clone git@github.com:rsoury/buyte.git
- Install Node.js Dependencies:
yarn
1. Amplify
- Set up your Amplify Configuration
amplify configure
- Make a
dev
directory under the amplify directory. In each directory (dev
or prod
), you can manage an environment for your Amplify configurations. We advise committing these configurations to a private repository. These configurations will include references to components in your cloud infrastructure.
mkdir -p ./amplify/dev
cd ./amplify/dev
amplify init
- Add a Data Storage (DynamoDB and AppSync GraphQL) to Amplify
amplify api add
- Select "GraphQL" for the interface and "Amazon Cognito User Pools" for authentication
- Select "Yes" for "Do you want to configure advanced settings for the GraphQL API" and provide the path to the GraphQL Schema
../graphql.schema
- Add Auth (Cognito) to Amplify
amplify add auth
You should receive a message that Auth has already been added.
- Push your Amplify configuration
amplify push
Ensure you auto-generate code from GraphQL schema when prompted.
- Add the GraphQL Endpoint to your Environment file
.env.development
or .env.production
2. ApplePay Certificates
Visit the Certs directory and follow the guide to produce your Apple Pay Certificates
3. Serverless
- Deploy to AWS
For Production -
sls deploy --env production --stage prod
For Development - sls deploy
For development, use sls offline
to test requests to a locally hosted web server.
3. CLI
- Install Golang dependencies -
go mod download
- Build the binary -
make
- Run the API in Development -
buyte api
- Run the API in Production -
buyte api --production
For development, use make init && make watch
to rebuild the binary on file change.
5. Finalise Cognito
Go to your AWS Console and visit the Cognito Portal.
- Add the Serverless Lambda Functions as the Cognito Triggers.
- Add a Domain Name to your Hosted UI
- Update your
COGNITO_CLIENTID
and COGNITO_USERPOOLID
your Environment file(s).
Further configuration for Cognito will continue in the Buyte Dashboard set up.
Database Set Up
We highly advise configuring your .env.development
or .env.production
files before proceeding to minimise the number of flags passed to each command.
- Create yourself a super user
buyte create-super-user -e youremail@example.com -p somepassword
- Add your
ADMIN_USERNAME
and ADMIN_PASSWORD
environment variables to your .env
file
- Set up Cognito Custom User Attributes - for Dashboard
buyte auth-setup
- Create your payment options
buyte payments add --name "Apple Pay" --image https://s3.url/to-imaage.png
buyte payments add --name "Google Pay"
- Create your payment providers
buyte providers add --name Adyen
buyte providers add --name Stripe
- Use the List commands to identify the Ids of each Payment and Provider record. ie.
buyte payments list
or buyte providers list
- Connect your Payment Options to each of your Payment Providers.
buyte providers connect --provider-id adyen-xxxx-xxxx-xxxx --payment-id applepay-yyyy-yyyy-yyyy
buyte providers connect --provider-id stripe-xxxx-xxxx-xxxx --payment-id applepay-yyyy-yyyy-yyyy
buyte providers connect --provider-id adyen-xxxx-xxxx-xxxx --payment-id googlepay-yyyy-yyyy-yyyy
buyte providers connect --provider-id stripe-xxxx-xxxx-xxxx --payment-id googlepay-yyyy-yyyy-yyyy
- List your providers to check which payment options are connected -
buyte providers list
You should see an output of the Provider details and their associated Payment Options.
(Optional) Update Database Schema
In case you have unique storage requirements that fall outside of the schema, here's a simple way to update your schema.
- Create a symlink to the Amplify backend directory.
ln -s ./amplify/schema.graphql ./amplify/dev/amplify/backend/api/buytedev/schema.graphql
- Make modifications to
./amplify/schema.graphql
cd ./amplify/dev/
amplify api update
amplify push
Testing
go test -v
Caveats
- ApplePay dependency has some caveats:
- You may need to change your
PKG_CONFIG_PATH
to include OpenSSL. For example, on my Mac I use PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig go test
.
- After Serverless Deploy, go to AWS Cognito in AWS console and save the Cognito Triggers page.
There is a bug here where without saving manually, they will not run when required.
Development Endpoints
Development endpoints were made to assist in spinning up a landing page with the appropriate digital wallet.
Contribution
Simply fork this repo and make it your own, or create a pull request and we can build something awesome together!
Enterprise Support
Whether you're looking to integrate a Legacy Payment Processor or Banking API, or looking for managed deployment and operation in your cloud, you can contact us at Web Doodle to discuss tailored solutions.
Found this repo interesting?
Star this project ⭐️⭐️⭐️, and feel free to follow me on Github, Twitter or Medium