Git Product home page Git Product logo

picpay-net's Introduction

Wirecard logo

O jeito mais simples e rĆ”pido de integrar o PicPay a sua aplicaĆ§Ć£o .NET e feito com base nas APIs REST do PicPay.

Docs MIT NuGet

ƍndice - C#

ImplementaƧƵes .NET com suporte

Essa biblioteca foi feito em (.NET Standard 2.0 e VS2017) e tem suporte das seguintes implementaƧƵes do .NET:

  • .NET Core 2.0 ou superior
  • .NET Framework 4.6.1 ou superior
  • Mono 5.4 ou superior
  • Xamarin.iOS 10.14 ou superior
  • Xamarin.Mac 3.8 ou superior
  • Xamarin.Android 8.0 ou superior
  • Universal Windows Platform 10.0.16299 ou superior

Para mais informaƧƵes: .NET Standard.

InstalaĆ§Ć£o

Execute o comando para instalar via NuGet:

PM> Install-Package PicPay

Autenticando o ambiente e-commerce

PicPayClient PP = new PicPayClient("5b008cef7f321d00ef2367b2");

Pagamento

RequisiĆ§Ć£o Pagamento

Link: https://ecommerce.picpay.com/doc/#operation/postPayments

PaymentRequest body = new PaymentRequest
{
    ReferenceId = "102030",
    CallbackUrl = "http://www.sualoja.com.br/callback",
    ReturnUrl = "http://www.sualoja.com.br/cliente/pedido/102030",
    Value = 20.51,
    Buyer = new Buyer
    {
        FirstName = "JoĆ£o",
        LastName = "Da Silva",
        Document = "123.456.789-10",
        Email = "[email protected]",
        Phone = "+55 27 12345-6789"
    }
};
var result = await PP.Payment.Create(body);

Cancelamento

Link: https://ecommerce.picpay.com/doc/#operation/postCancellations

PaymentRequest body = new PaymentRequest
{
    AuthorizationId = "555008cef7f321d00ef236333"
};
var result = await PP.Payment.Cancel(body, "102030");

Status

Link: https://ecommerce.picpay.com/doc/#operation/getStatus

var result = await PP.Payment.Status("102030");

NotificaĆ§Ć£o

Criar notificaĆ§Ć£o

Link: https://ecommerce.picpay.com/doc/#operation/postCallbacks

var body = new NotificationRequest
{
    ReferenceId = "102030",
    AuthorizationId = "555008cef7f321d00ef236333"
};
var url = "http://www.sualoja.com.br/callback";
var result = await PP.Notification.Create(body, "4ef4edbd-5cda-42da-860b-0e8d7b90c784", url);

Tabela

Status Code

CĆ³digo Status DescriĆ§Ć£o
200 OK Equivalente ao status HTTP 200. OK indica que a solicitaĆ§Ć£o foi bem-sucedida e que as informaƧƵes solicitadas estĆ£o na resposta. Este Ć© o cĆ³digo de status mais comuns a ser recebido.
401 Unauthorized Equivalente ao status HTTP 401. Unauthorized indica que o recurso solicitado requer autenticaĆ§Ć£o. O cabeƧalho WWW-Authenticate contĆ©m os detalhes de como realizar a autenticaĆ§Ć£o.
422 UnprocessableEntity Equivalente ao status HTTP 422. UnprocessableEntity indica que o servidor entende o tipo de conteĆŗdo da entidade de solicitaĆ§Ć£o e a sintaxe da entidade de solicitaĆ§Ć£o estĆ” correta, mas nĆ£o conseguiu processar as instruƧƵes contidas.
500 InternalServerError Equivalente ao status HTTP 500. InternalServerError indica que ocorreu um erro genƩrico no servidor.

Exemplo:

var result = await PP.Payment.Status("102030");
var code = result.StatusCode;

Lista de cĆ³digos de estado HTTP: HTTP Status Codes šŸ‘ˆ

picpay-net's People

Contributors

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