Marius Chiriac
    • Posts
    • Client Server
      • Cookies in development
      • Node: Migrate JS to TS
      • Stripe payment React-Flask
      • Paypal payment React-Flask
    • React
      • React: Migrate JS to TS
    • Unity
      • Design Patterns
        • Chain of Responsibility
        • Command
        • Object Pool
        • Component
      • javascript in WEBGL build
      • Timeline
        • Change timeline dinamically
        • Concatenate Timeline
        • Unity Timeline
    Paypal payment React-Flask

    Paypal payment React-Flask I wrote this guide because there is no code example to implemnt a secure transaction with paypal buttons method with products on own database. versions year: 2021 React: node: 14 “react”: “^17.0.2” “@paypal/react-paypal-js”: “^7.1.2” “@reduxjs/toolkit”: “^1.6.0” Flask: python 3.8.5 flask 2.0.1 Payment Flow User in the React site add items to cart User navigate to cart page User click on “Pay with card” On user input React call the back-end passing cart and user data Flask validate cart items throught database (pricing and availability).

    July 19, 2021 Read
    Stripe payment React-Flask

    Stripe payment React-Flask Payment Flow User in the React site add items to cart User navigate to cart page User click on “Pay with card” On user input React call the back-end passing cart and user data Flask validate cart items throught database (pricing and availability) Flask ask Stripe to create a checkout session, then send back session url to React React redirect User to stripe checkout page User perform payment using card Stripe redirect User to success/failed url (the cart React page) If payment success React empty cart and notify User Stripe notify Flask throught webhook about payment completed with basical order info Flask update database and React about buyed items React (front-end) React functional with typescript.

    July 16, 2021 Read
    Node: Migrate Javascript to Typescript

    In this guide we will see how to migrate a backend server with node.js 14 and express from javascript to typescript Why Typescript help developer to write consistent code makes code easier to read and to mantain Converting project The first step is to add the TypeScript compiler. You can install the compiler as a developer dependency using the –save-dev flag. npm install --save-dev typescript Based on this tsconfig.

    December 9, 2020 Read
    Cookies in development using localhost

    In this guide we will see how to config server backend with nodejs and exrepress to test cookies in localhost Keep In Mind cookies are created server-side the client doesn’t handle cookies cookies are saved on the browser server can read the cookies from the client request Setup backend index.js const express = require('express'); const bodyParser = require('body-parser'); const webpush = require('web-push'); const cors = require('cors'); const cookieParser = require('cookie-parser'); const https = require('https'); const fs = require('fs'); const Auth = require('.

    November 26, 2020 Read
    Navigation
    • About
    • Skills
    • Experiences
    • Recent Posts
    • Projects
    Contact me:
    • Email: redarked@gmail.com
    • Phone: +39 3880947809

    Toha
    © 2021 Marius Chiriac.
    Powered by Hugo Logo