-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
79 lines (75 loc) · 2.98 KB
/
doc.go
File metadata and controls
79 lines (75 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Package bbapi provides a Go SDK for Banco do Brasil APIs.
//
// This first iteration implements the Pagamentos em Lote API while keeping the
// client structure ready for future Banco do Brasil products.
//
// Basic usage:
//
// client, err := bbapi.NewClient(bbapi.Config{
// ClientID: "your-client-id",
// ClientSecret: "your-client-secret",
// AppKey: "your-app-key",
// Sandbox: true,
// Scopes: []bbapi.Scope{
// bbapi.ScopeTransfersRequest,
// bbapi.ScopeBatchesRequest,
// },
// })
// if err != nil {
// log.Fatal(err)
// }
//
// transfer, err := client.CreateTransferBatch(ctx, &bbapi.CreateTransferBatchRequest{
// RequestNumber: 123,
// PaymentType: bbapi.PaymentTypeMiscellaneous,
// Transfers: []bbapi.Transfer{
// {
// TransferDate: 10042026,
// TransferValue: 150.75,
// },
// },
// })
// if err != nil {
// log.Fatal(err)
// }
//
// _ = transfer
package bbapi
// Scope represents an OAuth2 scope accepted by Banco do Brasil APIs.
type Scope string
const (
ScopeBankSlipsInfo Scope = "pagamentos-lote.boletos-info"
ScopeBankSlipsRequest Scope = "pagamentos-lote.boletos-requisicao"
ScopeCancelRequest Scope = "pagamentos-lote.cancelar-requisicao"
ScopeReturnedPaymentsInfo Scope = "pagamentos-lote.devolvidos-info"
ScopeBarcodeGuidesInfo Scope = "pagamentos-lote.guias-codigo-barras-info"
ScopeBarcodeGuidesRequest Scope = "pagamentos-lote.guias-codigo-barras-requisicao"
ScopeBatchesInfo Scope = "pagamentos-lote.lotes-info"
ScopeBatchesRequest Scope = "pagamentos-lote.lotes-requisicao"
ScopeBarcodePaymentsInfo Scope = "pagamentos-lote.pagamentos-codigo-barras-info"
ScopeManualGuidePaymentsInfo Scope = "pagamentos-lote.pagamentos-guias-sem-codigo-barras-info"
ScopeManualGuidePaymentsRequest Scope = "pagamentos-lote.pagamentos-guias-sem-codigo-barras-requisicao"
ScopePaymentsInfo Scope = "pagamentos-lote.pagamentos-info"
ScopePixInfo Scope = "pagamentos-lote.pix-info"
ScopeTransfersInfo Scope = "pagamentos-lote.transferencias-info"
ScopePixTransfersInfo Scope = "pagamentos-lote.transferencias-pix-info"
ScopePixTransfersRequest Scope = "pagamentos-lote.transferencias-pix-requisicao"
ScopeTransfersRequest Scope = "pagamentos-lote.transferencias-requisicao"
)
const (
PaymentRequestStateConsistent = 1
PaymentRequestStateInconsistent = 2
PaymentRequestStateAllInconsistent = 3
PaymentRequestStatePending = 4
PaymentRequestStateProcessing = 5
PaymentRequestStateProcessed = 6
PaymentRequestStateRejected = 7
PaymentRequestStatePreparingUnreleased = 8
PaymentRequestStateReleasedByAPI = 9
PaymentRequestStatePreparingReleased = 10
)
const (
PaymentTypeSuppliers = 126
PaymentTypeSalary = 127
PaymentTypeMiscellaneous = 128
)