PHP code example of brdev / pagarme
1. Go to this page and download the library: Download brdev/pagarme 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/ */
brdev / pagarme example snippets
$pagarme = new BRdev\Pagarme\Client($token);
$user = $pagarme->costumer("Luciano hang","[email protected] ","108.383.820-29","CPF","15981070774");
$user->callback();
$getUser = $pagarme->getCostumer($cusId);
$getUser->callback();
$updateUser = $pagarme->UpdateCostumer($cusId,"Vinicius Nogueira","[email protected] ","108.383.820-29","CPF","15981070774");
$updateUser->callback();
$creditCard = $pagarme->createdCreditCard($cusId,"5425 6489 5749 2251","Vinicius Nogueira","01/2024","123","18220-000","SP","itapetininga","Rua dos Bobos");
$creditCard->callback();
$getCreditCard = $pagarme->getCreditCard($cusId,$cardId);
$getCreditCard->callback();
$updateCreditCard = $pagarme->updateCreditCard($cusId,$cardId,"5425 6489 5749 2251","Vinicius Nogueira","01/2024","123","18220-200","SP","itapetininga","Rua dos Bobos");
$updateCreditCard->callback();
$renewCreditCard = $pagarme->renewCreditCard($cusId,$cardId);
$renewCreditCard->callback();
$deleteCreditCard = $pagarme->deleteCreditCard($cusId,$cardId);
$deleteCreditCard->callback();
$trasactionCredit = $pagarme->transactionCrediCard($cusId,$cardId,uniqid(),"test","10000","1",8);
$trasactionCredit->callback();
$trasactionPIX = $pagarme->transactionPix($cusId,uniqid(),"testando","10000","1","800");
$trasactionPIX->callback();
$transactionBoleto = $pagarme->transactionBoleto("cus_---",uniqid(),"testando a api","1000","1");
$transactionBoleto->callback();
$pagarme->transactionCrediCardSplit("cus_--","card_---",uniqid(),"testando split","1000","1","2","rp_---","5","rp_-----","95");
$pagarme->transactionPixSplit("cus_---",uniqid(),"testando split","1000","1","800","rp_---","2","rp_---","98");
$splitBoleto = $pagarme->transactionBoletoSplit("cus_----",uniqid(),"testando split","1000","1","rp_-----","2","rp_-----","100");
$getOrder = $pagarme->getOrder("or_----");
$getOrder->callback();
$closeOrder = $pagarme->closeOrder("or_----","canceled");
$closeOrder->callback();
$deleteCharge = $pagarme->deleteCharge("ch_------");
$closeOrder->callback();
$createdRecipients = $pagarme->CreatedRecipients("Meu nome Jose","[email protected] ","108.383.820-29","123","0001","12345","1");
$createdRecipients->callback();
$EditRecipients = $pagarme->EditRecipients("rp_------","Jose Santos","[email protected] ");
$EditRecipients->callback();
$EditRecipients = $pagarme->EditRecipients("rp_------","Jose Santos","[email protected] ");
$EditRecipients->callback();
$EditRecipientsBank = $pagarme->EditRecipientBank("rp_-------","Jose Santos","108.383.820-29","260","0002","12345","1");
$EditRecipientsBank->callback();
$getBalance = $pagarme->getBalance("rp_-----");
$getBalance->callback();
$withdrawals = $pagarme->withdrawals("rp_------", "1000");
$withdrawals->callback();
$GetWithdrawals = $pagarme->GetWithdrawals("rp_-------", "ID");
$GetWithdrawals->callback();