flycorp / santander-billet
Santander票据API集成
Requires
- php: ^7.2.5|^8.0
- guzzlehttp/guzzle: ^7.3
This package is auto-updated.
Last update: 2024-09-09 13:48:55 UTC
README
负责生成带有Santander API的PIX选项的票据的包
🚀 开始
以下说明将帮助您在本地机器上获取项目的副本,用于开发和测试。
📋 预先要求
- PHP ˆ7.2
- Laravel ˆ6.0
- Composer
🔧 安装
使用COMPOSER包管理器将依赖项包含到您的项目中。
执行命令
composer require flycorp/santander-billet
或者,在您的 'composer.json' 文件中添加
{ "require": { "flycorp/santander-billet": "dev-main" } }
然后,运行包管理器安装命令
composer install
然后,将配置文件发布到 config\santander_billet.php
php artisan vendor:publish --provider="FlyCorp\SantanderBillet\providers\SantanderBilletServiceProvider" --tag=config
记住,在使用包时导入Santander类
use FlyCorp\SantanderBillet\Santander;
环境变量
将允许与API端点通信的环境变量添加到您的 '.env' 文件中
SANTANDER_BILLET_ENVIRONMENT="sandbox"
SANTANDER_BILLET_CLIENT_ID=
SANTANDER_BILLET_CLIENT_SECRET=
SANTANDER_BILLET_CERTIFICATE_AUTH=
SANTANDER_BILLET_CERTIFICATE_PATH=
变量描述
* SANTANDER_BILLET_ENVIRONMENT: Ambiente da API(sandbox ou production)
* SANTANDER_BILLET_CLIENT_ID: Valor do client_id fornecido pelo Santader
* SANTANDER_BILLET_CLIENT_SECRET: Valor do client_secret fornecido pelo Santander
* SANTANDER_BILLET_CERTIFICATE_AUTH: Senha do certificado
* SANTANDER_BILLET_CERTIFICATE_PATH: Caminho do certificado em formato pfx dentro da pasta Storage
API端点
工作空间
-
[POST] 创建工作空间 /collection_bill_management/v2/workspaces
$santanderIntegration = new Santander; $workspace = [ "type" => "BILLING", "covenants" => [ [ "code" => 0000001 ] ], "description" => "Testando", "bankSlipBillingWebhookActive" => true, "pixBillingWebhookActive" => true, "webhookURL" => "https://teste" ]; $data = $santanderIntegration->createWorkspace($workspace);
-
[GET] 查询工作空间 /collection_bill_management/v2/workspaces
$santanderIntegration = new Santander; $data = $santanderIntegration->searchWorkspace();#INFORME O ID DO WORKSPACE PARA PESQUISA ESPECÍFICA
-
[DELETE] 删除工作空间 /collection_bill_management/v2/workspaces/{workspace_id}
$santanderIntegration = new Santander; $data = $santanderIntegration->deleteWorkspace("5ca21612-ee50-4626-b2da-e66ca35c605f");
-
[PATCH] 更改工作空间 /collection_bill_management/v2/workspaces/{workspace_id}
$santanderIntegration = new Santander; $body = [ "covenants" => [ [ "code" => 0000001 ] ], "description" => "Testando" ]; #Forneça o workspace_id e body da requisição $data = $santanderIntegration->updateWorkspace("5ca21612-ee50-4626-b2da-e66ca35c605f", $body);
票据
-
[POST] 注册票据 /collection_bill_management/v2/workspaces/{workspace_id}/bank_slips
$santanderIntegration = new Santander; $bill = [ "environment" => "sandbox",# Valores aceitos(sandbox, PRODUCAO) "nsuCode" => 1014, "nsuDate" => "2023-05-09", "covenantCode" => 0000001,#INFORME O SEU "bankNumber" => "1014",#INFORME O SEU "clientNumber" => "123", "dueDate" => "2023-05-09", "issueDate" => "2023-05-09", "participantCode" => "teste liq abat", "nominalValue" => 1.00, "payer" => [ "name" => "João da Silva santos", "documentType" => "CPF", "documentNumber" => "94620639079", "address" => "rua nove de janeiro", "neighborhood" => "bela vista", "city" => "sao paulo", "state" => "SP", "zipCode" => "05134-897" ], "beneficiary" => [ "name" => "João da Silva", "documentType" => "CNPJ", "documentNumber" => "20201210000155" ], "documentKind" => "DUPLICATA_MERCANTIL", "deductionValue" => "0.10", "paymentType" => "REGISTRO", "key" => [#ESTA CHAVE É NECESSÁRIA PARA GERAR O QR-CODE "type" => "CNPJ",#TIPOS ACEITOS (CPF, CNPJ, CELULAR, EMAIL, EVP) "dictKey" => "00000000000000"#CNPJ SEM MÁSCARA ], "writeOffQuantityDays" => "30", "messages" => [ "mensagem um", "mensagem dois" ] ]; #Forneça o workspace_id e body da requisição $data = $santanderIntegration->registerBill('5ca21612-ee50-4626-b2da-e66ca35c605f', $bill);
-
[PATCH] 更新指令 /collection_bill_management/v2/workspaces/{workspace_id}/bank_slips
$santanderIntegration = new Santander; $body = [ "covenantCode" => "0000001", "bankNumber" => "123", "operation" => "BAIXAR" ]; #Forneça o workspace_id e body da requisição $data = $santanderIntegration->updateBillInstructions("5ca21612-ee50-4626-b2da-e66ca35c605f", $body);
-
[POST] 获取访问票据(PDF/QR-code)数据 /collection_bill_management/v2/bills/{$billId}/bank_slips
$santanderIntegration = new Santander; $billId = "0000001.1005"; $body = [ "payerDocumentNumber" => "94620639079", ]; #Forneça o bill_id e body da requisição $data = $santanderIntegration->getPdfBill($billId, $body);
简单查询
-
[GET] 查询探头 /collection_bill_management/v2/workspaces/{workspace_id}/bank_slips/{bank_slips}
$santanderIntegration = new Santander; $data = $santanderIntegration->simpleSearchBySonda();
-
[GET] 查询nn /collection_bill_management/v2/bills
$santanderIntegration = new Santander; $beneficiaryCode = "356720"; #CÓDIGO DO BENEFICIÁRIO $bankNumber = "10054325"; #CÓDIGO DO BANCO $data = $santanderIntegration->detailedSearchByNn($beneficiaryCode, $bankNumber);
-
[GET] 查询sn /collection_bill_management/v2/bills
$santanderIntegration = new Santander; $beneficiaryCode = "356720"; #CÓDIGO DO BENEFICIÁRIO $bankNumber = "10054325"; #CÓDIGO DO BANCO $dueDate = "2023-04-25"; $nominalValue = "100.00"; $data = $santanderIntegration->detailedSearchBySn($beneficiaryCode, $bankNumber, $dueDate, $nominalValue);
-
[GET] 查询sn /collection_bill_management/v2/bills
$santanderIntegration = new Santander; $beneficiaryCode = "356720"; #CÓDIGO DO BENEFICIÁRIO $bankNumber = "10054325"; #CÓDIGO DO BANCO $dueDate = "2023-04-25"; #DATA DE VENCIMENTO $nominalValue = "100.00";#VALOR NOMINAL $data = $santanderIntegration->detailedSearchBySn($beneficiaryCode, $bankNumber, $dueDate, $nominalValue);
-
[GET] 按类型搜索 /collection_bill_management/v2/bills
$santanderIntegration = new Santander; $billId = "0000001.1005"; #Valores para type (bankslips, default, duplicate, registry, settlement) #A. default: Pesquisa padrão, trazendo somente dados básicos do boleto #B. duplicate: Pesquisa de dados para emissão de segunda via de boleto #C. bankslip: Pesquisa para dados completos do boleto #D. setlement: Pesquisa para informações de baixas/liquidações do boleto #E. registry: Pesquisa de informações de cartório no boleto $data = $santanderIntegration->detailedSearchBySearchType($billId, $type);