This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
MercadoPago\SDK::setAccessToken("ACCESS_TOKEN"); | |
# Create a preference object | |
$preference = new MercadoPago\Preference(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MercadoPago; | |
using MercadoPago.DataStructures.Payment; | |
using MercadoPago.Resources; | |
//... | |
MercadoPago.SDK.SetAccessToken("ENV_ACCESS_TOKEN"); | |
Payment payment = new Payment() | |
{ | |
TransactionAmount = float.Parse("105"), | |
Description = "Awesome Wooden Wallet", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using AdminLTE.Data; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using MercadoPago; | |
using MercadoPago.Resources; | |
using MercadoPago.DataStructures.Payment; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
MercadoPago\SDK::setAccessToken("TEST-563211749753176........5738894"); | |
//... | |
$payment = new MercadoPago\Payment(); | |
$payment->transaction_amount = 108; | |
$payment->token = "5a42b6cf9b6....7145b6fd"; | |
$payment->description = "Fantastic Wooden Computer"; | |
$payment->installments = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Pagar</title> | |
</head> | |
<body> | |
<a mp-mode="modal" href="<?php echo $preference->init_point; ?>">Pagar</a> | |
<script type="text/javascript"> | |
(function(){function $MPC_load(){window.$MPC_loaded !== true && (function(){var s = document.createElement("script");s.type = "text/javascript";s.async = true;s.src = document.location.protocol+"//secure.mlstatic.com/mptools/render.js";var x = document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);window.$MPC_loaded = true;})();}window.$MPC_loaded !== true ? (window.attachEvent ?window.attachEvent('onload', $MPC_load) : window.addEventListener('load', $MPC_load, false)) : null;})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports MercadoPago | |
Imports System.Net | |
Imports MercadoPago.Resources | |
Imports MercadoPago.DataStructures.Payment | |
Imports System | |
Public Class Application | |
Public Shared Sub Main() | |
Pagar("token", 1, "visa", "310", 100.0, "[email protected]", "test_access_token") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
</head> | |
<body> | |
<form action="/procesar-pago" method="POST"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
MercadoPago\SDK::setClientId("CLIENT_ID"); | |
MercadoPago\SDK::setClientSecret("CLIENT_SECRET"); | |
$envio = MercadoPago\SDK::get("/shipping_options", array( | |
"url_query" => array( |