E-commerces is the largest sector of electronic industry
# E-Commerce
- Supply chain management
- Internet Marketting
- Online transaction Processing
- Inventory management
- Data Collection
Shopping car is like git staging area for next commit. Subsets of products to process paynment for.
# Online goods and services
- e-books
- music - iMusic
- Softwares - SaaS
- Royality
Unprecedented increase in e-commerce after COVID 2020
Find more statistics at Statista
# Payment Processing Services
- Unified Payments Interface (UPI) - India
- Unlike traditional mobile wallets, which takes a specified amount of money from user and stores it in its own accounts, UPI withdraws and deposits funds directly from the bank account whenever a transaction is requested.
# Sell PDF
- on Amazon
- e-junkie
# Digital delivery system
- User window shops
- User selects his purchases 0-*
- Makes Payment
- Post payment Processing - Deliver goods.
- Redownload window in case they loose it
- Launch your own affiliate program
# Digital Media
- Files like
PDF
,epub
- Videos like mp3
- Presentations
- animations
- Artwork
# Webhooks
Webhooks are APIs requests but in reverse.
- Webhooks and APIs differ in how they make requests.
- https://cloud.google.com/free/
- Firebase Functions -
javascript
- Google cloud functions in python, Go, java, nodejs
- How to test webhooks locally? in development phase?
Tunneling software like
ultrahook
orncroc
Have to update URL everytime is using a free version. How to do better? enter Stripe CLI
- HOw to deal with JSON on CLI?
Use jq tool. Its like
sed
andawk
but for JSON
# Stripe Payment
What should happen before payment?
- Enter CC info
- parse and send back to us a unique ID
- Use
dotenv
only whenNODE_ENV
(set by node itself) is not production- use dotenv only when in development mode
- Add prices in pennies (avoid floating point errors)
StripeCheckout
,token
function is called when after card information is captured and submitted- To use your API key, assign it to stripe. The Node.js library will then automatically send this key in each request.
- Idempotence operations
- Can add discount coupons, Promotion Code
- Payments from client side needs to be verified by server as they could be manipulated by attacker
- Charge customer based on the price on backend
- strip will verify and return a token
- firebase cloud function to handle verification
- Client Side
- you define your products directly in the Stripe Dashboard and reference them by ID on the client side.
- Prebuilt UI Elements
- Webhook - like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow
- https://youtu.be/jJH56H67yOE
- Would have to use firebase middleware to add
cors
middleware to request- else request might not pass
- might work from browser but not from postman
- Checkout page should load
stripe.js
direcctly from server to remain PCI compliant
What should happen after payment?
nd, decline
- Pricing
- Can send emails, invoices post payment to customer for free
- Currency Support
- Currency conversion
- Stripe supports processing charges in 135+ currencies allowing you to present prices in a customer’s native currency. Doing so can improve sales and help customers avoid conversion costs.
- Link with transferwise account to accept payments in USD, EUR, GBP, NZD, AUD
- Payout When you start processing live payments from your customers with Stripe, you won’t receive your first payout until 7–14 days after receiving your first successful payment.
- Stripe with google pay
- Checkout Flow
TIP
Apple Pay and Google Pay are enabled by default and automatically appear in Checkout when a customer uses a supported device and has saved at least one card in their digital wallet.
- Use the Dashboard, a custom webhook, or a third-party plugin to handle post-payment events like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.
# Resources
- https://stripe.com/docs/google-pay
- https://www.digitalocean.com/community/tutorials/vuejs-stripe-elements-vue-integration
# NOdejs Hosting
RedHat OpenShift is highly recommended for first timers because it offers free Node.js hosting forever
# Questions
- https://www.reddit.com/r/webdev/comments/6aiw4d/vuejs_vs_express/
- How to secure client calls to backends hosted on cloud functions?
# How to design a ecommerce websites?
- Usecases
- Create user profile
- List products
- add/remove product to cart
- Purchase products
- Payment processor API
- Track order
- Database Model
- users
- products
- orders
- Concurrency
- What if 2 users tryign to buy same thing
- APIs
- Split page information into sections
- UI Features
- Keyboard shortcuts
- How to use tutorial? Help
# Payment Standards
# Implement Authentication with route guards
# Resources
← Dotnet Core Firebase →