2017 © Pedro PelĆ”ez
 

package azpaylaravel

IntegraĆ§Ć£o com a AZPay para Laravel

image

gmodugno/azpaylaravel

IntegraĆ§Ć£o com a AZPay para Laravel

  • Friday, May 19, 2017
  • by modugno
  • Repository
  • 2 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Larave AzPay

O Laravel AzPay consome a SDK do AzPay e fornece uma forma simples de gerar o pagamentos.

Requerimentos

  • PHP >= 5.5.*
  • Laravel >= 5.2

InstalaĆ§Ć£o

composer require gmodugno/azpaylaravel, (*1)

Service Provider

Abra o arquivo config/app.php e adicione ao Array providers a seguinte instruĆ§Ć£o:, (*2)

AzPayLaravel\AzPay\AzPayServiceProvider::class, 

Aliases do Package

Ainda no arquivo config/app.php adicione no Array aliases a seguinte instruĆ§Ć£o:, (*3)

'AZPay' => AzPayLaravel\AzPay\Facades\AZPay::class, 

CriaĆ§Ć£o do arquivo de configuraĆ§Ć£o

Digite o seguinte comando no seu Terminal, (*4)

php artisan vendor:publish --tag=config, (*5)

Pronto, se tudo deu certo, irĆ” paracer a seguinte mensagem, (*6)

Copied File [/vendor/gmodugno/azpaylaravel/src/AzPay/Config/azpay.php] To [/config/azpay.php], (*7)

Ajustando as ConfiguraƧƵes

Abra o arquivo config/azpay.php e coloque suas credenciais da AzPay. ``` php return [ 'merchant_id' => 'MERCHANT_ID', 'merchant_key' => 'MERCHANT_KEY' ];, (*8)


## Inicializar a SDK ``` php $azpay = AZPay::init();

Order

``` php // Order $azpay->setOrder([ 'reference' => '123456789', 'totalAmount' => '1000' ]);, (*9)


## Billing ``` php // Billing $azpay->setBilling([ 'customerIdentity' => '1', 'name' => 'Fulano de Tal', 'address' => 'Av. Federativa, 230', 'address2' => '10 Andar', 'city' => 'Mogi das Cruzes', 'state' => 'SP', 'postalCode' => '20031-170', 'phone' => '21 4009-9400', 'email' => 'fulanodetal@email.com' ]);

Options

``` php // Options $azpay->setOptions([ 'urlReturn' => 'http://loja.exemplo.com.br', 'fraud' => 'false', 'customField' => '' ]);, (*10)


## CreditCard ``` php // CreditCard $azpay->setCardPayment([ 'acquirer' => AZPay::getCardOperators()['cielo']['modes']['store']['code'], 'method' => '1', 'amount' => '1000', 'currency' => AZPay::getCurrencies('BRL'), 'numberOfPayments' => '1', 'groupNumber' => '0', 'country' => 'BRA', 'flag' => 'visa', 'cardHolder' => 'JosƩ da Silva', 'cardNumber' => '4012001037141112', 'cardSecurityCode' => '123', 'cardExpirationDate' => '201805', 'saveCreditCard' => 'true' ]);

Enviando

``` php // Try try {, (*11)

// venda direta
$azpay->sale()->execute();

$xml_request = $azpay->response();

return $xml_request;

} catch (AzPayLaravel\AzPay\SDK\AZPay_Error $e) {, (*12)

# HTTP 409 - AZPay Error
$error = $azpay->responseError();   

dd($error);

} catch (AzPayLaravel\AzPay\SDK\AZPay_Curl_Exception $e) {, (*13)

# Connection Error
dd($e->getMessage());

} catch (AzPayLaravel\AzPay\SDK\AZPay_Exception $e) {, (*14)

# General Error
dd($e->getMessage());

} ```, (*15)

License

MIT license, (*16)

The Versions

19/05 2017

dev-master

9999999-dev

IntegraĆ§Ć£o com a AZPay para Laravel

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Guilherme Modugno

laravel gateway gateway payment gateway de pagamentos azpay laravel gateway

19/05 2017

1.1

1.1.0.0

IntegraĆ§Ć£o com a AZPay para Laravel

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Guilherme Modugno

laravel gateway gateway payment gateway de pagamentos azpay laravel gateway

18/05 2017

1.0

1.0.0.0

IntegraĆ§Ć£o com a AZPay para Laravel

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Guilherme Modugno

laravel gateway gateway payment gateway de pagamentos azpay laravel gateway