Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
21
vendor/mercadopago/dx-php/samples/payment/minimal/create.php
vendored
Normal file
21
vendor/mercadopago/dx-php/samples/payment/minimal/create.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../index.php';
|
||||
|
||||
$payment = new MercadoPago\Payment();
|
||||
|
||||
$payment->transaction_amount = 100;
|
||||
$payment->token = "CARD_TOKEN";
|
||||
$payment->description = "Title of what you are paying for";
|
||||
$payment->installments = 1;
|
||||
|
||||
$payer = new MercadoPago\Payer();
|
||||
$payer->email = "your.payer@email.com";
|
||||
|
||||
$payment->payer = $payer;
|
||||
$payment->save();
|
||||
|
||||
echo "Payment ID: " . $payment->id . "\n";
|
||||
echo "Payment Status: " . $payment->status . "\n";
|
||||
|
||||
?>
|
||||
18
vendor/mercadopago/dx-php/samples/payment/minimal/refund.php
vendored
Normal file
18
vendor/mercadopago/dx-php/samples/payment/minimal/refund.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../index.php';
|
||||
|
||||
# Create a Payment
|
||||
require_once dirname(__FILE__) . '/create.php';
|
||||
|
||||
# Refunding
|
||||
$refund = new MercadoPago\Refund();
|
||||
$refund->amount = $payment->total_paid_amount;
|
||||
$refund->metadata = "A total refund";
|
||||
$refund->save();
|
||||
|
||||
echo "Refund ID: " . $refund->id . "\n";
|
||||
echo "Payment Refunds: \n";
|
||||
var_dump($payment->refunds);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user