Giter Site home page Giter Site logo

hypertech-lda / paysuite-php-sdk Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 26 KB

SDK para integração com o paysuite.co.mz

Home Page: https://packagist.org/packages/hypertech/paysuite-php-sdk

License: Apache License 2.0

PHP 100.00%
mpesa payments payments-platform php sdk emola

paysuite-php-sdk's Introduction

PHP Composer

Como utilizar a biblioteca para criar um checkout

A biblioteca paysuite-php-sdk permite que você crie checkouts de forma fácil e rápida. Para criar um checkout, e receber pagamentos suando métodos de pagamento disponíveis em Moçambique como Mpesa, eMola, PayPal e transferência bancária. Para usar siga os seguintes passos:

  1. Crie uma conta no Paysuite.co.mz e obtenha a chave secreta no seu dashboard

  2. Instale a biblioteca paysuite-php-sdk:

    composer require hypertech/paysuite-php-sdk
  3. Crie uma instância da classe Client com seu Secret key e chame o método checkout() da classe Client :

use Hypertech\Paysuite\Client;

$secret = "SuaChaveSecreta";
$paysuite = new Client($secret);
$paysuite->enableTestMode(); // Chame esta função para habilitar o modo de teste

$result = $paysuite->checkout([
    "tx_ref" => 'FACT123',
    "currency" => "MZN",
    "purpose"=> "Pagamento de factura",
    "amount" => 100,
    "callback_url" => "http://seusite.com/callback_url",
    "redirect_url" => "http://seusite.com/invoice.php"
]);

if ($result->isSuccessfully()) {
    $checkoutUrl = $result->getCheckoutUrl();
} else {
    echo $result->getMessage();
}

Testes

export SECRET_KEY="ASuaChaveSecreta"
composer test

Changelog

Por-favor veja CHANGELOG para mais detalhes.

Contribua

Por-favor veja CONTRIBUTING para mais detalhes.

Segurança

Se você descobrir algum problema relacionado à segurança, envie um e-mail para [email protected] em vez de usar o rastreador de problemas.

Licença

The MIT License (MIT). Por-favor veja License File para mais informações.

paysuite-php-sdk's People

Contributors

karson 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.