Skip to content

Instantly share code, notes, and snippets.

@gusLopezC
Created January 20, 2021 20:51
Show Gist options
  • Save gusLopezC/9ac53a484f289eed1da4816a44ac8e46 to your computer and use it in GitHub Desktop.
Save gusLopezC/9ac53a484f289eed1da4816a44ac8e46 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Support\Facades\Route;
namespace App\Http\Controllers;
use Openpay;
use Illuminate\Http\Request;
require_once '../vendor/autoload.php';
class OpenpayController extends Controller
{
//
public function UpdateCustomer(){
$openpay = Openpay::getInstance('mdrhnprmsmxkgxtegzhk', 'sk_c71babd865fd420b94bc588a8585c122');
$client = new \GuzzleHttp\Client();
$response = $client->put("https://sandbox-api.openpay.mx/v1/mdrhnprmsmxkgxtegzhk/customers/azgfomxgwpmuxsfoxq4r", [
// un array con la data de los headers como tipo de peticion, etc.
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Basic c2tfYzcxYmFiZDg2NWZkNDIwYjk0YmM1ODhhODU4NWMxMjI6'
],
'json' => [
"name" => "Carlos",
"last_name" =>"Santana",
"email" => "customer_email@me.com",
"phone_number" =>"44209087654"
]
]);
return var_dump($response);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment