Search This Blog

Showing posts with label square payment form. Show all posts
Showing posts with label square payment form. Show all posts

Monday, October 26, 2020

Square Payment Form PHP -- Customer linked to Payment Order

After lot of bang bang. I could find a way to do 3 tasks with Square Payment Form in PHP

  1. Check from Square Customer Director if USER EXISTS based on PHONE number - If yes Get "CUSTOMER ID" and MAKE PAYMENT
  2. If Customer does not exists in Directory -- CREATE A NEW USER -- GO & GET --> find CUSTOMER ID --> & MAKE PAYMENT
  3. Get PAYMENT ID & SAVE IT IN MySQL Database

PS : This is very crud way of scripting (hahaha). Had to find a way to get this project done. I found out simple way by using GOTO statement. Hope it will help you of my 3 weeks of in between projects and delivered.

ENV file -- env (without extension -- plain text file)

Genarate Square Idempotency Key CLASS) - square-functions.php

HTML FORM - paynow.php

PROCESS PAYMENT Page --- process-payment.php

content-wide advt