All Projects → luannsr12 → picpay-php

luannsr12 / picpay-php

Licence: other
Simples integração com API do PicPay utilizando PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to picpay-php

semaphore
Take control of your data, connect with anything, and expose it anywhere through protocols such as HTTP, GraphQL, and gRPC.
Stars: ✭ 74 (+164.29%)
Mutual labels:  gateway-api
lura
Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation
Stars: ✭ 5,159 (+18325%)
Mutual labels:  gateway-api
android-upi-payment
An android library for integrating payment using existing upi apps.
Stars: ✭ 26 (-7.14%)
Mutual labels:  gateway-api
picpay.py
Bíblioteca agnóstica para Integração com o gateway de pagamento da Picpay.
Stars: ✭ 35 (+25%)
Mutual labels:  picpay
Krakend
Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation
Stars: ✭ 4,752 (+16871.43%)
Mutual labels:  gateway-api
Ambassador
open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
Stars: ✭ 3,583 (+12696.43%)
Mutual labels:  gateway-api
Contour
Contour is a Kubernetes ingress controller using Envoy proxy.
Stars: ✭ 2,985 (+10560.71%)
Mutual labels:  gateway-api

PicPay PHP Simple

Configuração (src/paymentPicPay.php)

Adicione seu x-picpay-token e x-seller-token | Clique aqui para pegar as credenciais

 private $x_picpay_token = "x-picpay-token";

 private $x_seller_token = "x-seller-token";

Efetuando Pagamento (payment.php)

<?php
 require_once 'src/paymentPicPay.php';
 $picpay = new PicPay;
 
  //Dados do produto
 
   $prod['ref']    = rand(1000,99999);			
   $prod['nome']  = "Trono de ferro";
   $prod['valor'] = 100.00;
   
   // Dados do cliente
   $cli['nome']      = "Daenerys";
   $cli['sobreNome'] = "Targaryen";
   $cli['cpf']       = "000.000.000-00";
   $cli['email']     = "[email protected]";
   $cli['telefone']  = "11999999999";
   
   $produto = (object)$prod;
   $cliente = (object)$cli;
   
   $payment = $picpay->requestPayment($produto,$cliente);
  
	if(isset($payment->message)):
		echo $payment->message;
	else:
 	   $link   = $payment->paymentUrl;
	   $qrCode = $payment->qrcode->base64;
	 
	   echo '<a href="'.$link.'">Pagar com PicPay</a>';
	   echo '<br />';
	   echo '<img src="'.$qrCode.'" />';
	   
    endif;
 ?>

Recebendo Notificação do PicPay (notification.php)

<?php
  require_once 'src/paymentPicPay.php'; 
  $picpay = new PicPay;
  
  // função que verifica a requisição do PicPay
  $notification = $picpay->notificationPayment();
  
	  if($notification){
		  
		  $status	   = $notification->status;
		  $authorizationId = $notification->authorizationId;
		  $referenceId     = $notification->referenceId;
		  
		  
		  /* -- Tratar dados -- */
	  }
 ?>

A função notificationPayment retorna com os seguintes dados:

  • referenceId (Referencia do pedido no seu sistema)
  • status (Confira as respostas de status na documentação do picpay)
  • authorizationId (Usado para estornar o pedido)

Documentação PicPay API: https://ecommerce.picpay.com/doc/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].