����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 18.118.160.215
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/bofirmacademy.com/vendor/mollie/mollie-api-php/examples/payments/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirmacademy.com/vendor/mollie/mollie-api-php/examples/payments/refund-payment.php
<?php
/*
 * How to refund a payment programmatically
 */

try {
    /*
     * Initialize the Mollie API library with your API key.
     *
     * See: https://www.mollie.com/dashboard/developers/api-keys
     */
    require "../initialize.php";

    /*
     * Determine the url parts to these example files.
     */
    $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
    $hostname = $_SERVER['HTTP_HOST'];
    $path = dirname($_SERVER['REQUEST_URI'] ?? $_SERVER['PHP_SELF']);

    if (isset($_GET['payment_id'])) {
        /*
         * Retrieve the payment you want to refund from the API.
         */
        $paymentId = $_GET['payment_id'];
        $payment = $mollie->payments->get($paymentId);

        if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->getAmountRemaining() >= 2.00) {
            /*
             * Refund € 2,00 of the payment.
             *
             * https://docs.mollie.com/reference/v2/refunds-api/create-refund
             */
            $refund = $payment->refund([
                "amount" => [
                    "currency" => "EUR",
                    "value" => "2.00", // You must send the correct number of decimals, thus we enforce the use of strings
                ],
            ]);

            echo "{$refund->amount->currency} {$refund->amount->value} of payment {$paymentId} refunded.", PHP_EOL;
        } else {
            echo "Payment {$paymentId} can not be refunded.", PHP_EOL;
        }

        /*
         * Retrieve all refunds on a payment.
         */
        echo "<ul>";
        foreach ($payment->refunds() as $refund) {
            echo "<li>";
            echo "<strong style='font-family: monospace'>" . htmlspecialchars($refund->id) . "</strong><br />";
            echo htmlspecialchars($refund->description) . "<br />";
            echo htmlspecialchars($refund->amount->currency) . " " . htmlspecialchars($refund->amount->value) . "<br />";
            echo "Status: " . htmlspecialchars($refund->status);
            echo "</li>";
        }
        echo "</ul>";
    }

    echo "Refund payment: ";
    echo "<form method='get'><input name='payment_id' value='tr_xxx'/><input type='submit' /></form>";

    echo "<p>";
    echo '<a href="' . $protocol . '://' . $hostname . $path . '/create-payment.php">Create a payment</a><br>';
    echo '<a href="' . $protocol . '://' . $hostname . $path . '/create-ideal-payment.php">Create an iDEAL payment</a><br>';
    echo '<a href="' . $protocol . '://' . $hostname . $path . '/list-payments.php">List payments</a><br>';
    echo "</p>";
} catch (\Mollie\Api\Exceptions\ApiException $e) {
    echo "API call failed: " . htmlspecialchars($e->getMessage());
}

Youez - 2016 - github.com/yon3zu
LinuXploit