- Table of Contents
- Features
- Supported Digital Wallets
- Supported Payment Processors
- Overview
- Installation Requirements
- Supporting Repositories
- Getting Started
- Database Set Up
- (Optional) Update Database Schema
- Testing
- Caveats
- Development Endpoints
- Contribution
- Enterprise Support
- Found this repo interesting?
- 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.
- Apple Pay
- Google Pay
- Stripe
- Adyen
- Add your own
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.
- Go 1.16.0+
- Node.js 10.0+
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.
- Clone the repository
git clone git@github.com:rsoury/buyte.git
- Install Node.js Dependencies:
yarn
- Set up your Amplify Configuration
amplify configure
- Make a
dev
directory under the amplify directory. In each directory (dev
orprod
), 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
Visit the Certs directory and follow the guide to produce your Apple Pay Certificates
- 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.
- 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.
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
andCOGNITO_USERPOOLID
your Environment file(s).
Further configuration for Cognito will continue in the Buyte Dashboard 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
andADMIN_PASSWORD
environment variables to your.env
file
- Add your
- 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
orbuyte 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.
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
go test -v
- ApplePay dependency has some caveats:
- You may need to change your
PKG_CONFIG_PATH
to include OpenSSL. For example, on my Mac I usePKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig go test
.
- You may need to change your
- 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 were made to assist in spinning up a landing page with the appropriate digital wallet.
Simply fork this repo and make it your own, or create a pull request and we can build something awesome together!
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.
Star this project ⭐️⭐️⭐️, and feel free to follow me on Github, Twitter or Medium