Giter Club home page Giter Club logo

superpay's Introduction

SuperPay

Biblioteca para o Gateway de Pagamentos para o SuperPay portado da biblioteca da Locaweb

Configuração

Configure o SuperPayGatewayConfig, ele só precisa ser configurado uma vez. ex.: SuperPayGatewayConfig::setEnvironment("sandbox"); SuperPayGatewayConfig::setToken("13014664467464");

Para utilizar diretamente a API.

echo "Executando criar:";
$resposta = SuperPayGateway::criar( array(
  'url_retorno' => 'http://www.minha-loja.com.br/confirmacao-pedido.php?id=12345',
  'capturar' => 'true',
  'pedido' => array(
    'numero' => "123",
    'total' => "100.00",
    'moeda' => "real",
    'descricao' => "Cylon toaster!"
  ),
  'pagamento' => array(
    'meio_pagamento' => 'redecard_ws',
    'bandeira' => "visa",
    'cartao_numero' => "4012001037141112",
    'cartao_cvv' => "973",
    'parcelas' => "1",
    'tipo_operacao' => "credito_a_vista",
    'cartao_validade' => "082015"
  ),
  'comprador' => array(
    'nome' => "Bruna da Silva",
    'documento' => "27836038881",
    'endereco' => "Rua da Casa",
    'numero' => "1",
    'cep' => "09710240",
    'bairro' => "Centro",
    'cidade' => "São Paulo",
    'estado' => "SP"
  )
))->sendRequest();
var_dump($resposta);
echo "Executando capturar:";
$resposta = SuperPayGateway::capturar(17)->sendRequest();
var_dump($resposta);
echo "Executando cancelar:";
$resposta = SuperPayGateway::cancelar(17)->sendRequest();
var_dump($resposta);
echo "Executando consultar:";
$resposta = SuperPayGateway::consultar(17)->sendRequest();
var_dump($resposta);

echo "==================================================================\n";

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.