Skip to content

toryano0820/payment-api-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment API

Installing dependencies

  • execute pip install -r requirements.txt

Starting API

  • execute python src/app.py

Request Specs

  • Path: /ProcessPayment
  • Method: POST
  • Content Type: application/json
  • Request Body:
{
    "PaymentMethod":    "<string>",   // currently, "credit_card" is only allowed
    "CreditCardNumber": "<string>",   // accepts any valid credit card number
    "CardHolder":       "<string>",   // cannot be empty
    "ExpirationDate":   "<datetime>", // "yyyy-MM-ddTHH:mm:ss.fffZ", "yyyy-MM-ddTHH:mm:ssZ", "yyyy-MM-dd", "MM/yy", "MM-yy", or "MMyy"
    "SecurityCode":     "<string>",   // 3 digit security code, optional
    "Amount":           "<decimal>"   // accepts decimal numbers greater than 0.0
}

Testing

  • execute pytest -v src\app.py ..

About

Example REST API for accepting online payment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages