Giter Site home page Giter Site logo

laravel-payku's Introduction

Laravel Payku

📦 A simple implementation, and ready to use package for Payku.

Requirements

  • Laravel 8 or above

Installation

composer require sebacarrasco93/laravel-payku

Adding .env keys

You need to create a public and private token. You can create and get it from:

PAYKU_PUBLIC_TOKEN={your_public_token}
PAYKU_PRIVATE_TOKEN={your_private_token}

Important:

Laravel Payku automatically will set the environment URL based in your APP_ENV key, in your .env project's file

For example, if you set your APP_ENV to local, it will use https://des.payku.cl/api

APP_ENV=local # will set https://des.payku.cl/api

Otherwise, if your APP_ENV is on production, it will use https://app.payku.cl/api

APP_ENV=production # will set https://app.payku.cl/api

If you want to force a specific environment, you can set it

PAYKU_ENV=local # or production

If you want to force a specific API URL in another environment, you can learn how to do it

Usage

Create a order

// In your controller, web.php or equivalent

$order = 'unique-order-'.rand(11111,99999);
$subject = 'Your order';
$amount = 1000; 
$email = '[email protected]';

return LaravelPayku::create($order, $subject, $amount, $email);

Easy Peasy!

Extra

If you want more control, you can publish the migrations and configuration

php artisan vendor:publish --provider="SebaCarrasco93\LaravelPayku\LaravelPaykuServiceProvider"

Notes

I didn't realize how many people were using Laravel Payku. So, I decided to take it back, and make an "TODO" list

Future improvements

I'm working on improving the package, but I have very limited time due to my work.

  • Allowing Webpay payment (2024/03/04)
  • Update dependencies (2024/03/04)
  • Fix method names and tests (2024/03/04)
  • Add custom .env key PAYKU_ENV (2024/03/04)
  • Add support to Webpay (again)
  • Add support to Multicaja Efectivo
  • [ ]...

Testing

./vendor/bin/pest

laravel-payku's People

Contributors

sebacarrasco93 avatar cachorro avatar

Stargazers

 avatar Michael Fernando Hernandez Peralta avatar Kuntal Gupta avatar Mohammad Hafijul Islam avatar  avatar Balogun Abdulquddus avatar Diego Ibáñez avatar

Watchers

James Cloos avatar  avatar

Forkers

juanklagos

laravel-payku's Issues

How to get paid in dollars?

Hello I liked your library, I am from Chile, and we were making payments internationally but wanted to charge in dollars and receive payment in Chilean pesos, the issue is that I saw the documentation I saw your code but I am converting the dollar to 350 Chilean pesos, I made some small changes to the documentation, which was to place the currency variable but it does not happen, I do not know if you ever touched you charge in dollars.

image

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.