PHP code example of raphaelvserafim / sdk-intopays

1. Go to this page and download the library: Download raphaelvserafim/sdk-intopays library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

raphaelvserafim / sdk-intopays example snippets


use SdkIntopays\Boleto;
use SdkIntopays\Pix;

XVCJ9.eyJpZCI6NiwiZW1haWwiOiJzZGtAaW50b3BheXMuY29tIiwiaWF0IjoxNzEzMTMzMDMwfQ.0uOXAMSq09aasfUkDCzuvaKVUBBAZf0mU1uBz-UDXkQ";

$baseUrl = "https://dev-app.intopays.com";

$boleto = new Boleto($baseUrl, $jwtToken);




    $boletos = $boleto->getAllBoletos();
    echo json_encode($boletos);



$data = [
  "amount" => 2.51,
  "dueDate" => "2024-02-14T07:20:06.153Z",
  "daysAfterDueDateForCancellation" => 30,
  "payerDocument" => "000.000.000-00",
  "payerName" => "Luffrs",
  "payerEmail" => "[email protected]",
  "payerPhone" => "51999999999",
  "payerZipCode" => "91760110",
  "payerNumber" => "123",
  "payerComplement" => "Apto 123",
  "payerNeighborhood" => "Centro",
  "payerCity" => "Salto",
  "payerState" => "AC",
  "payerAddress" => "Rua Principal",
  "messageLine1" => "Message line 1",
  "messageLine2" => "Message line 2",
  "discount1Code" => "NO_DISCOUNT",
  "discount1Rate" => 0,
  "discount1Value" => 0,
  "discount1Date" => null,
  "discount2Code" => "NO_DISCOUNT",
  "discount2Rate" => 0,
  "discount2Value" => 10,
  "discount2Date" => "2024-02-10T00:00:00.000Z",
  "fineCode" => "NO_FINE",
  "fineDate" => null,
  "fineValue" => 0,
  "fineRate" => 0,
  "interestCode" => "EXEMPT",
  "interestDate" => null,
  "interestRate" => 0,
  "interestValue" => 0,
  "finalBeneficiaryName" => "Final Beneficiary",
  "finalBeneficiaryDocument" => "111.111.111-11",
  "finalBeneficiaryZipCode" => "98765432",
  "finalBeneficiaryAddress" => "Rua Final",
  "finalBeneficiaryNeighborhood" => "Bairro Final",
  "finalBeneficiaryCity" => "Final City",
  "finalBeneficiaryState" => "SP",
  "integrationType" => "SICOOB"
];


$response = $boleto->createBoletoTransaction($data);

echo json_encode($response);



$pix = new Pix($baseUrl, $jwtToken);


$data = [
  "calendarExpiration" => 86400,
  "debtorName" => "Raphael",
  "debtorDocument" => "XXX.XXX.XXX-XX",
  "amountOriginal" => "10.99",
  "amountModificationType" => 0,
  "payerRequest" => "Esse texto esta limitado a 140 caracteres.",
  "additionalInfos" => [
    [
      "name" => "Campo 1",
      "value" => "Informacao Adicional do PSP-Recebedor"
    ]
  ],
  "integrationType" => "SICOOB"
];

$response = $pix->createPixTransaction($data);

echo json_encode($response);