PHP code example of lrpatricio / picpay-php

1. Go to this page and download the library: Download lrpatricio/picpay-php 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/ */

    

lrpatricio / picpay-php example snippets



pay = new PicPay\Client('x-picpay-token');


$picpay->create()->send([
    "referenceId" => "102030",
    "callbackUrl" => "http://www.sualoja.com.br/callback",
    "returnUrl" => "http://www.sualoja.com.br/cliente/pedido/102030",
    "value" => 20.51,
    "expiresAt" => "2022-05-01T16:00:00-03:00",
    "buyer" => [
        "firstName" => "João",
        "lastName" => "Da Silva",
        "document" => "123.456.789-10",
        "email" => "[email protected]",
        "phone" => "+55 27 12345-6789"
    ]
]);


$picpay->cancel()->send([
    "referenceId" => "102030",
    "authorizationId" => "555008cef7f321d00ef236333"
]);


$picpay->status()->send([
    "referenceId" => "102030",
]);

composer