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
public function charge_card(Request $request) | |
{ | |
// $cart = Cart::where('user_id', auth()->user()->id)->where('order_id', null)->get()->toArray(); | |
$customer_id = $this->validateCustomer(); | |
$request->total = str_replace(",", "", $request->total); | |
$orden = $this->create_OrderID(); | |
$chargeRequest = array( | |
'method' => 'card', |
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
// Java - OkHttp | |
import java.io.*; | |
import okhttp3.*; | |
public class main { | |
public static void main(String []args) throws IOException{ | |
OkHttpClient client = new OkHttpClient().newBuilder() | |
.build(); | |
MediaType mediaType = MediaType.parse("application/json"); | |
RequestBody body = RequestBody.create(mediaType, "{\r\n \"holder_name\": \"Tarjeta actualizada\",\r\n \"cvv2\":\"000\"\r\n }"); |
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 | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
require 'vendor/phpmailer/phpmailer/src/Exception.php'; | |
require 'vendor/phpmailer/phpmailer/src/PHPMailer.php'; | |
require 'vendor/phpmailer/phpmailer/src/SMTP.php'; | |
$mail = new PHPMailer(); |
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
// Libreria RestSharp | |
// Remplazar Merchant_id de la url | |
var client = new RestClient("https://sandbox-api.openpay.mx/v1/Merchant_id/charges"); | |
client.Timeout = -1; | |
var request = new RestRequest(Method.POST); | |
request.AddHeader("Content-Type", "application/json"); | |
// Es necesario convertir su llave secreta agregando ':' a base64 para poder completar la verificacion | |
// Ejemplo sk_c71babd865000000000bc588a2: |
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 | |
use Illuminate\Support\Facades\Route; | |
namespace App\Http\Controllers; | |
use Openpay; | |
use Illuminate\Http\Request; | |
require_once '../vendor/autoload.php'; |
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
pruebaAxios() { | |
//Remplazar Merchant_id | |
axios.post('https://api.openpay.mx/v1/MERCHANT/customers', { | |
name: "Alta cliente SPEI", //varEmail is a variable which holds the email | |
last_name: "Integracion", | |
email: "[email protected]" | |
}, | |
{ |
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
var axios = require('axios'); | |
const { performance } = require('perf_hooks'); | |
var data = JSON.stringify({"card_number":"4111111111111111", | |
"holder_name":"Juan Perez Ramirez","expiration_year":"21","expiration_month":"12","cvv2":"110","device_session_id":"kR1MiQhz2otdIuUlQkbEyitIqVMiI16f"}); | |
var config = { | |
method: 'post', | |
url: 'https://sandbox-api.openpay.mx/v1/mdrhnprmsmxkgxtegzhk/cards', | |
headers: { |
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
$customer = array( | |
'name' => 'Juan', | |
'last_name' => 'Vazquez Juarez', | |
'phone_number' => '4423456723', | |
'email' => '[email protected]'); | |
$chargeRequest = array( | |
"method" : "card", | |
'amount' => 100, | |
'description' => 'Cargo terminal virtual a mi merchant', |
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
/** | |
Libreria Java - OkHttp | |
**/ | |
Unirest.setTimeouts(0, 0); | |
HttpResponse<String> response = Unirest.post("https://sandbox-api.openpay.mx/v1/mdrhnprmsmxkgxtegzhk/charges") | |
.header("Content-Type", "application/json") | |
// Es necesario convertir la llave secreta a base64 para poder entablar la conversación y agregar ':' antes de conversion ejemplo (sk_c71ba3dd865fd420b93sc588a8585c122:) | |
.addHeader("Authorization", "Basic c2tfYzcxYmFiZDg2NWZkNDIwYjk0YmM1ODhhODU4NWMxMjI6") | |
.header("Authorization", "Basic c2tfYzcxYmFiZDg2NWZkNDIwYjk0YmM1ODhhODU4NWMxMjI6") |
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
Merchant_id | |
mdrhnprmsmxkgxtegzhk | |
LLave publica | |
pk_72476ae5a41148ee8cd10aceb3998916 | |
Llave secreta | |
sk_c71babd865fd420b94bc588a8585c122 |
NewerOlder