Question
P2 Implement a simple prototype of a payment processing system that demonstrates the principles of distributed computing and programming ( Make your response an original
P2
Implement a simple prototype of a payment processing system that demonstrates the principles of distributed computing and programming ( Make your response an original one. Don't copy content from the internet, and your work is invalid if copied. )
PURPOSE
In this coding challenge, you will implement a prototype distributed payment processing system based on the design descriptions provided below
Required - three things
A source code(no executable code), a small write-up about the implementation details, and a screenshot of your code output
Note - You don't need to have all the requirements completed, but you should make sure that you have all the bare minimum requirements to demonstrate your work
PAYMENT PROCESSING SYSTEM DESCRIPTION
Have you ever stopped to consider what happens when you're shopping online? In between entering your credit card information and the money getting charged to your account is a very complex set of interactions. We shall set forth a design for it and provide sample implementations for some of the components. Let's take a look at some of the details of a payment processing system.
FORMS OF PAYMENT
To keep this simple we'll assume that we only accept credit cards for payment.
FRONTEND
The happy shopper needs some way to enter their payment details.
ONLINE STORE
The storefront needs an interface to the processing system where they can enter the shoppers' details, get confirmation that they can charge the card, and collect the money afterwards.
CREDIT CARD PAYMENTS
Paying by credit card, whether online or in a physical shop, follows a two-step process.
When your card is first run, it performs an "authorization". This authorization takes the credit card details and the amount requested and sends them to the credit card company. The company then looks up the card and verifies whether or not the payment will succeed. A status code (OK or some kind of error code) is returned, along with an authorization code if the status is OK.
Later on (e.g. once an hour, once a day) all of these authorizations are collected up into a single batch and sent as "payment requests" to the credit card company. A payment request contains the same information as the initial authorization along with the authorization code that was returned. The credit card company will respond with statuses for each payment request and all the money for those requests that succeeded is transferred into the store's bank account.
PAYMENT PROCESSING SYSTEM
The system needs to implement credit card processing as described above.
CREDIT CARD COMPANY
We shall assume we use a single credit card processor and that processor provides us with an interface for performing authorizations in real-time and batch payment requests.
******** INSTRUCTIONS
The system you implement should have the following pieces:
- The Client
- This will be the web browser. Set forth a simple web page called "payment.html". You can use the "form.html" page as a starting point to create a form. The payment.html page should prompt the user to enter their credit card information (do not enter real data here!) and it should submit it to the payment server with the path "/make-payment" as a POST request.
- The UI Server
- The UI Server should simply be a web server that accepts requests with the /make-payment path and processes them. To do this it should call the processing server using a JSON string. It should then return success or failure to the client based on the response from the processing server.
- The Processing Server
- This server can have any form you want (including being an HTTP server) . It should accept a JSON string with credit card information and decide whether it wants to accept it as payment or not, and respond to the UI server accordingly. If you wanted to get more interesting you could keep track of payments for each card and include a maximum total spend or something of that form.
- Please keep focused on the goal , which is to gain experience in the principles of distributed systems, rather than creating something perfect.
- You must provide all of your source code (no executable code) and a write-up that describes your design and implementation, clearly explains how to run it, and covers problems you encountered and their solutions.
- Output Screenshot
- Submit a short screenshot of you running the code on your machine to demonstrate you running the application.
Focus
- The implementation, as we've discussed all term, is focused on themerchant's system. After all, the user will need to already have a UI device or application to connect to the Merchant's site; and the Merchant will need to connect to already-existing systems with already-existing interfaces.
- Therefore, please interpret the UI server as the Merchant's web server front end; and please interpret the Processing Server as theMerchant's subsystem that connects to theexternalcredit card processing system to request approvals and batch settlements.
- You are welcome to use our external processing service or modify it if you wish. You can also place that serviceinside the Merchant's subsystem if you segregate and mark it with an appropriate comment.
- The details of this external credit card processing system are not of primary importance.
- It is important to deal with customer input; form a request for authorization; and capture or report the transaction. Information may be exchanged between the merchant system and the credit card processor using JSON or XML.
- The focus of the "more interesting" part is the focus on the next use case, that of the Settlement phase.
- As the instructions caution, "Please keep focused on the goal of this assignment, which is to gain experience in the principles of distributed systems, rather than creating something perfect."
REFERENCES:
- Beyer, Betsy; Jones, Chris; Petoff, Jennifer; Murphy, Niall. 2016. Site Reliability Engineering: How Google Runs Production Systems. https://landing.google.com/sre/sre-book/toc/index.html Chapter 6,8, 10 of this book
- van Steen, Maarten and Tanenbaum, Andrew. 2017. Distributed Systems. CreateSpace Independent Publishing Platform. https://www.distributed-systems.net/index.php/books/ds3/
- Working with JSON. 2019. MDN. Accessed 6 Feb 2020.https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON. JSON Examples. json.org. Accessed 6 Feb 2020.https://json.org/example.html
Note
Make your response as genuine and original as possible. Don't just copy any content on the internet Make it a mixture of your insights and proper citation of your references. Watch out for any grammar errors. Build your ideas and sentences concisely. Section your answers so it is easy to follow.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started