Skip to content

Commit

Permalink
Crear un cargo en coinbase con PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
programadornovato committed Dec 29, 2021
1 parent d698d5c commit bea1ab9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion crearCargo.php
Expand Up @@ -2,4 +2,24 @@
require_once './vendor/autoload.php';
use CoinbaseCommerce\ApiClient;
use CoinbaseCommerce\Resources\Charge;
ApiClient::init('f14c4696-e77a-4efa-9ab4-aac045dea4e2');
ApiClient::init('f14c4696-e77a-4efa-9ab4-aac045dea4e2');
$cargo=new Charge([
'name'=>'Pago de acceso premium',
'description'=>'El cliente tiene acceso a la parte premium de la plataforma',
'pricing_type'=>'fixed_price',
'local_price'=>[
'amount'=>'0.20',
'currency'=>'USD'
],
'metadata'=>[
'customer_id'=>'12345',
'order_id'=>'67890'
]
]);
try {
$cargo->save();
echo "El pago se realizo con el id ".$cargo->id."<br>";
echo "Se realizara el pago en la url ".$cargo->hosted_url."<br>";
} catch (\Exeption $ex) {
echo $ex->getMessage();
}

0 comments on commit bea1ab9

Please sign in to comment.