Skip to content

Instantly share code, notes, and snippets.

View murilohns's full-sized avatar

Murilo Henrique Nascimento Souza murilohns

View GitHub Profile
@murilohns
murilohns / transactionCreateV3.php
Last active January 24, 2018 14:01
create transaction 2017-08-28
<?php
require("pagarme-php/Pagarme.php");
PagarMe::setApiKey("SUA_CHAVE_DE_API");
$transaction = new PagarMe_Transaction(array(
"amount"=> 21000,
"card_number"=> "4111111111111111",
"card_cvv"=> "123",
"card_expiration_month"=> "09",
@murilohns
murilohns / php-softDescriptor.php
Created February 1, 2018 11:19
Pagar.me SoftDescriptor
<?php
require 'vendor/autoload.php';
$pagarMe = new \PagarMe\Sdk\PagarMe('SUA_API_KEY');
$amount = 1000;
$installments = 1;
$capture = true;
$postbackUrl = 'http://requestb.in/pkt7pgpk';
$metadata = ['idProduto' => 13933139];
$extraAttributes = [
<!DOCTYPE html>
<html>
<head>
<title>Teste de Card Hash</title>
</head>
<body>
</body>
<script src="https://assets.pagar.me/pagarme-js/3.0/pagarme.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<html>
<head>
<meta charset='utf-8'/>
<title> Generate Card Hash </title>
<script src='https://assets.pagar.me/js/pagarme.js'></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<form id="creditCard_form" class="creditCard_form form-group">
Número do cartão:
@murilohns
murilohns / updateRecipient.js
Created March 13, 2018 15:41
updateRecipient in Pagar.me with js
const pagarme = require('pagarme')
const api_key = 'SUA_CHAVE_DE_API';
bank_account_1 = {
bank_code: '987',
agencia: '9876',
agencia_dv: '9',
conta: '98765',
conta_dv: '9',
legal_name: 'Primeira conta bancaria',
@murilohns
murilohns / nginx_callback.php
Last active March 23, 2018 14:09
nginx callback
<?php
require_once DIR_SYSTEM . 'library/PagarMe/Pagarme.php';
abstract class ControllerPaymentPagarMe extends Controller
{
public function callback()
{
Pagarme::setApiKey($this->config->get('pagar_me_'.$payment_method.'_api'));
$requestBody = file_get_contents("php://input");
$xHubSignature = $_SERVER['HTTP_X_HUB_SIGNATURE'];
@murilohns
murilohns / scienceplay.html
Last active May 23, 2018 13:32
Science Play e-mail
<html>
<body style="margin: 0; font-family:Arial, Helvetica, sans-serif; color: #5f5f5f" bgcolor="#d7d7d7">
<div style="width: 100%; background: #d7d7d7; margin-top: 5%;">
<div>
<img src="https://image.ibb.co/bOxs97/header_email_1000.png" width="90%" style="margin-left: 5%;"/>
</div>
<div style="background: #fff; width: 90%; min-height:10px; margin-left:5%; padding-top:20px; padding-bottom:20px">
<p style="padding-left: 80px; padding-right: 80px; text-align: justify">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
//
// Program.cs
//
// Author:
// Jonathan Lima <[email protected]>
//
// Copyright (c) 2014 Pagar.me
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
//
// Program.cs
//
// Author:
// Jonathan Lima <[email protected]>
//
// Copyright (c) 2014 Pagar.me
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@murilohns
murilohns / checkout.html
Last active August 6, 2018 12:23
PHP - Create Subscription with previous created card
<html>
<head>
<html>
<head>
<!-- SCRIPT PAGAR.ME -->
<script src="https://assets.pagar.me/checkout/checkout.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<button id="pay-button">Abrir modal de pagamento</button>