Giter Site home page Giter Site logo

php.ps-code-refinery's Introduction

Transaction Commission Calculator

This Transaction Commission Calculator application is built with PHP and uses Composer for dependency management. The application reads transactions from an input file, calculates commissions based on the origin country of the credit card and the transaction currency, and outputs the results.

Prerequisites

Before proceeding with the setup, ensure you have the following installed on your machine:

  • PHP
  • Composer

Setup

  1. Clone the Repository

    First, clone the repository to your local machine. Open a terminal and run the following command:

    [email protected]:gediminasnn/php.ps-code-refinery.git

    (Optional) Replace [email protected]:gediminasnn/php.ps-code-refinery.git with the URL of repository.

  2. Navigate to the Application Directory

    Change directory to the application root:

    cd php.ps-code-refinery

    (Optional) Replace php.ps-code-refinery with the path where you cloned the repository.

  3. Install Composer Dependencies

    Before starting the Docker containers, install the project's PHP dependencies using Composer. Open a terminal and navigate to your project directory. Then, run the following command:

    composer install

    This command downloads and installs all the PHP libraries your project requires based on the composer.json file.

  4. Run the Application

    You can run the application using the following command:

    php app.php input.txt

    Make sure to replace input.txt with the path to your input file containing the transactions.

  5. (Optional) Run Tests

    Open a new terminal window or tab and execute the following command:

    ./vendor/bin/phpunit tests

    This command will execute your application's test suite. It will run all the tests located in the tests directory of your application.

    By completing this step, you will have fully set up your Transaction Commission Calculator on your local development environment, ensuring it is ready for further development, testing, or deployment.

Documentation

Example input.txt File

{"bin":"45717360","amount":"100.00","currency":"EUR"}
{"bin":"516793","amount":"50.00","currency":"USD"}
{"bin":"45417360","amount":"10000.00","currency":"JPY"}
{"bin":"41417360","amount":"130.00","currency":"USD"}
{"bin":"4745030","amount":"2000.00","currency":"GBP"}

Example Output

php app.php input.txt
1
0.47
1.66
2.41
43.72

License

This project is licensed under the MIT License

php.ps-code-refinery's People

Contributors

gediminasnn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.