PHP Classes

API Getnet PHP Client: Access Getnet e-commerce Web services via its API

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 34 All time: 11,063 This week: 455Up
Version License PHP version Categories
getnet-api-client 1.0.0Custom (specified...5PHP 5, E-Commerce, Web services
Description 

Author

This package is specific mainly for applications used in Brazil Brazil .

This package can be used to access Getnet e-commerce Web services via its API.

It provides classes that can send HTTP requests to the Getnet API Web server to execute several actions accessing its services. Currently it can:

- Generate a payment boleto and returning an id to access the page that presents that boleto
- Request a payment using a given credit card and obtain its authorization status

Picture of Jonatas Matheus Gino de Souza
Name: Jonatas Matheus Gino de ... <contact>
Classes: 1 package by
Country: Brazil Brazil

Example

<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/GETNET-API-Client/Boleto.php';

$boleto = new Boleto();

$data = [
   
'amount' => '1000',
   
'name' => 'Payer Name',
   
'email' => 'payer@mail.com',
   
'document_type' => 'CPF', // CPF or CNPJ
   
'document_number' => '00000000000',
   
'phone_number' => '99999999999',
   
'street' => 'Street name',
   
'number' => '22',
   
'complement' => 'complement',
   
'district' => 'district name',
   
'city' => 'city name',
   
'state' => 'state name',
   
'country' => 'Brazil',
   
'postal_code' => 'postal_code',
   
'cardholder_name' => 'cardholder name',
   
'security_code' => 'security code',
   
'brand' => 'brand',
   
'expiration_date' => '12/23',
   
'card_number' => 'card number'
];

$retData = $boleto->doPayment($data);

$err = false;
$message = '';
if(!empty(
$retData['payment_id'])) {
   
$message = '<b>The billing was successfully generated! <br> You can download your billing by clicking ate the following link: <b> <br><br>';
   
$message .= '<a href="' . $boleto->getServer(). $retData['boleto']['_links'][0]['href'] . '" target="_BLANK"> Download! </a>';
}
else {
   
$message = 'Payment unauthorized';
}

echo
$message;


Details

GETNET-API-Client

A client to consume Getnet API services


  Files folder image Files (7)  
File Role Description
Files folder imageGETNET-API-Client (3 files)
Files folder imagesamples (2 files)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (7)  /  GETNET-API-Client  
File Role Description
  Plain text file Auth.php Class Class source
  Plain text file Boleto.php Class Class source
  Plain text file Credit.php Class Class source

  Files folder image Files (7)  /  samples  
File Role Description
  Accessible without login Plain text file boleto.php Example Example script
  Accessible without login Plain text file credit.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:34
This week:0
All time:11,063
This week:455Up