Skip to content

thriftshop-site/create-purchase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create Purchase FN

Development

  • cp .env.example .env

  • edit .env

GOOGLE_SERVICE_ACCOUNT_EMAIL=
GOOGLE_PRIVATE_KEY=
GOOGLE_SPREADSHEET_ID_FROM_URL=
Set Up Google Services If Not Yet Set Up

Create New Google Project

pic-selected-200630-1220-20

Enable Google Spreadsheet API

enable-google-api

Select Your New Created Project

pic-selected-200630-1228-25

  • Create New Google Service Account

pic-selected-200630-1229-33

  • Fill Up Service Account Details

pic-selected-200630-1232-27

  • Add Role Owner

pic-selected-200630-1236-01

Create New Secret KEY

pic-selected-200630-1238-12

  • Select JSON

pic-selected-200630-1239-14

  • This will Download A JSON , Open that File which Will Contain GOOGLE_PRIVATE_KEY and GOOGLE_SERVICE_ACCOUNT_EMAIL
{
  "private_key": "GOOGLE_PRIVATE_KEY", // COPY THIS AND PASTE TO YOU .env file
  "client_email": "GOOGLE_SERVICE_ACCOUNT_EMAIL", // COPY AND PASTE THIS TO YOUR .env file
}

Get Google Spreadsheet ID

  1. Go to this link: https://docs.google.com/spreadsheets/u/0/

  2. Create A New Spreadsheet

  3. Check The URL and Copy URL Segment and Paste to GOOGLE_SPREADSHEET_ID_FROM_URL

https://docs.google.com/spreadsheets/d/COPY-THIS-URL-SEGMENT/edit#gid=0

Grant Permission to GOOGLE_SERVICE_ACCOUNT_EMAIL

  • Inside Your SpreadSheet ,Click Share Button , paste your GOOGLE_SERVICE_ACCOUNT_EMAIL

share-to-google-email

run netlify dev command

Raw JSON PAYLOAD
{
    "reference_no": "dh5zPAn",
    "referral": "midascode",
    "deliverable": false,
    "receiver_name": "Juan Dela Cruz",
    "receiver_phone": "+639123456789",
    "address": "Complete Address",
    "notes": "Add Sosmething Awesome Here!"
}
  • NOTE: This Microservice should only be called after we Create Link and have reference_no (required)

  • if deliverable is false (i.e product such as softwares) Address, and Receiver Info will Not Be Filled! , default to false

  • Referral Code is Optional and used to update referral commission on referral sheet

Deploy

Deploy to Netlify

Set Your Domain In Netlify

  • Go to Settings

  • Click Change Site Name ${username}-tss-fn-create-purchase.${domain}.com

Production

  • make post request with Needed payload to ${username}-tss-fn-create-purchase.${domain}.com/api

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published