Skip to content

ankurbhambri/PaymentGateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirement for this project for setup:

-> Create a vitual environment.
== virtualenv -p python3.6 venv
-> Activate your virtual environment using this command
== source venv/bin/activate
-> Install required python libraries by using pip installer.
== pip install -r requirements.txt
-> Migrate database.
== python manage.py migrate
-> Finally, run your django runserver.
== python manage.py runserver

Two API's work around to this Project.

(POST) First Api Gateway where we can pass valid request and in response valid reponse.

like:-

Request =  {
    "amount": "100",
    “currency”: "USD",
    "type": "creditcard",
    "card": {
        "number": "4111111111111111",
        "expirationMonth": "2",
        "expirationYear": "2020",
        "cvv": "111"
        }
    }

Response = {
    "amount": "100",
    “currency”: “USD”,
    “type”: “creditcard”
    "card": {
        "number": "4111111111111111"
    }
    “status”: “success”,
    “authorization_code”: “SDSD23232333”
    “time”: “2020-05-16 07:00:00”
}

Error Respinse = {
    "amount": "100",
    "currency": "100",
    "type": "100",
    "card": {
        "number": "100"
    },
    "status": "error",
    "error": "'expirationYear'was not present in the response",
    "authorization_code": "Jaytlpzepdcw"
    "time": "2020-10-02 19:00:16.744329",
}

(GET) Second Api All Transactions History response (Success + Error).

like:-

Response = [
    [
        1,
        {
            "card": {
                "number": "100"
            },
            "time": "2020-10-02 19:00:16.413080",
            "type": "100",
            "error": "'expirationYear'was not present in the response",
            "amount": "100",
            "status": "error",
            "currency": "100",
            "authorization_code": "Nkxw0lunfkq5"
        }
    ],
    [
        2,
        {
            "card": {
                "number": "100"
            },
            "time": "2020-10-02 19:00:16.744329",
            "type": "100",
            "error": "'expirationYear'was not present in the response",
            "amount": "100",
            "status": "error",
            "currency": "100",
            "authorization_code": "Jaytlpzepdcw"
        }
    ],
    [
        3,
        {
            "card": {
                "number": "100"
            },
            "time": "2020-10-02 19:01:51.073078",
            "type": "100",
            "amount": "100",
            "status": "success",
            "currency": "100",
            "authorization_code": "E3boeq1gheut"
        }
    ] ............................................
]

Releases

No releases published

Packages

No packages published

Languages