Giter VIP home page Giter VIP logo

laravel-payment-gateway's Introduction

Laravel Payment Gateway

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This package makes everything is simple, Payment method supported (Visa, MasterCard)

Installation

Install via composer

composer require yousef/payment-gateway

Configuration

Add the PaymentGatewayServiceProvider class in your config/app.php file.

<?php
return [
    // ...
    
    'providers' => [
        Yousef\PaymentGateway\PaymentGatewayServiceProvider::class,
        
    ];

    // ...
];

Publish vendor config files if you need to replace by your own.

php artisan vendor:publish

Usage

Let's say you need use master, visa to pay orders online in your store, now using Payment Gateway package every thing is easy to integrate more readability and Testability. Payment Gateway package support multi currency like [KWD, AED, BHD, QAR, JOD] and anyone can add easy to modify.

<?php

    Payment::createSession($amount, $transactionId, $currency);
    
    Payment::pay($transactionId);
    

Add, modify currency configuration multi-currency-gateway.php

return [
    ...,
    'KWD' => [
        'certificate_verify_peer' => env('CERTIFICATE_VERIFY_PEER', false),
        'certificate_verify_host' => env('CERTIFICATE_VERIFY_HOST', 0),
        'gateway_url' => env('GATEWAY_URL', ''),
        'username'=> env('MERCHANT_USERNAME_KWD', ''),
        'merchant_id' => env('MERCHANT_ID_KWD', 0),
        'password'=> env('MERCHANT_PASSWORD_KWD', ''),
        'merchant_email' => env('MERCHANT_EMAIL_KWD', 0),
        'debug' => env('DEBUG', false),
        'version' => env('VERSION', 61),

        'operations' => [
            'new_session' => 'CREATE_CHECKOUT_SESSION',
            'retrieve_order' => 'RETRIEVE_ORDER',
        ]
    ],

Custom exception classes

    NotCaptured::class
    InvalidAmount::class  
    InvalidTransactionId::class

Add own configuration in .env file the DEFAULT_CURRENCY is USD

VERSION=""
GATEWAY_URL=""

MERCHANT_ID_USD=""
MERCHANT_EMAIL_USD=""
MERCHANT_USERNAME_USD=""
MERCHANT_PASSWORD_USD=""

MERCHANT_ID_KWD=""
MERCHANT_EMAIL_KWD=""
MERCHANT_USERNAME_KWD=""
MERCHANT_PASSWORD_KWD=""

Getting Help

If you're stuck getting something to work, or need to report a bug, please post an issue in the Github Issues for this project.

Contributing

If you're interesting in contributing code to this project, clone it by running:

git clone [email protected]:yousefdev20/laravel-payment-gateway.git

License

This project is open-sourced software licensed under the MIT license.

laravel-payment-gateway's People

Contributors

yousefdev20 avatar

Stargazers

Samir Sabri 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.