https://github.com/matmiranda/picpay-dotnet
š§© - picpay api for dotnet
https://github.com/matmiranda/picpay-dotnet
dotnet picpay
Last synced: 6 months ago
JSON representation
š§© - picpay api for dotnet
- Host: GitHub
- URL: https://github.com/matmiranda/picpay-dotnet
- Owner: matmiranda
- License: mit
- Created: 2019-01-30T22:22:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T04:09:48.000Z (almost 3 years ago)
- Last Synced: 2025-11-06T19:25:03.366Z (9 months ago)
- Topics: dotnet, picpay
- Language: C#
- Homepage: https://ecommerce.picpay.com/
- Size: 74.2 KB
- Stars: 17
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](./LICENSE)

[](https://www.nuget.org/packages/PicPay)
## Ćndice - C#
- [ImplementaƧƵes .NET com suporte](#implementaƧƵes-net-com-suporte)
- [Instalação da biblioteca](#instalação-da-biblioteca)
- [Configurando e Autenticando o ambiente](#configurando-e-autenticando-o-ambiente)
- Pagamento
- [Criar pedido para pagamento](#criar-pedido-para-pagamento)
- [Capturar pagamento](#capturar-pagamento)
- [Cancelar pedido de pagamento](#cancelar-pedido-de-pagamento)
- [Consultar Status do pedido](#consultar-status-do-pedido)
## ImplementaƧƵes .NET com suporte
A biblioteca foi feito em **[.NET Standard 2.1](https://learn.microsoft.com/pt-br/dotnet/standard/net-standard?tabs=net-standard-2-1) e VS2022**
## Instalação da biblioteca
Execute o comando para instalar via [NuGet](https://www.nuget.org/packages/PicPay/):
```.net cli
> dotnet add package PicPay
```
## Configurando e Autenticando o ambiente
```C#
var config = new PicPayConfig
{
BaseUrl = BaseUrl.ProductionEcommerce,
Token = "your-token"
};
var client = new PicPayClient(config);
```
Para mais informação: [API Refence](https://picpay.github.io/picpay-docs-digital-payments/checkout/resources/api-reference)
## Criar pedido para pagamento
```C#
var body = new PaymentRequest
{
ReferenceId = "102030",
CallbackUrl = "http://www.sualoja.com.br/callback",
ReturnUrl = "http://www.sualoja.com.br/cliente/pedido/102030",
Value = 20.51M,
Buyer = new Buyer
{
FirstName = "João",
LastName = "Da Silva",
Document = "123.456.789-10",
Email = "test@picpay.com",
Phone = "+55 27 12345-6789"
}
};
var response = await client.Payment.CreateAsync(body);
```
## Capturar pagamento
```C#
var body = new PaymentRequest
{
Amount= 12.04M
};
var response = await client.Payment.CaptureAsync(body, "102030");
```
## Cancelar pedido de pagamento
```C#
var body = new PaymentRequest
{
AuthorizationId = "555008cef7f321d00ef236333",
Amount= 50.05M
};
var referenceId = "102030";
var response = await client.Payment.CancelAsync(body, referenceId);
```
## Consultar Status do pedido
```C#
var referenceId = "102030";
var response = await client.Payment.StatusAsync(referenceId);
```