!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/srmklive/paypal/tests/Unit/Client/   drwxr-xr-x
Free 29.24 GB of 117.98 GB (24.78%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     InvoicesTest.php (11.48 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Srmklive\PayPal\Tests\Unit\Client;

use 
GuzzleHttp\Utils;
use 
PHPUnit\Framework\TestCase;
use 
Srmklive\PayPal\Tests\MockClientClasses;
use 
Srmklive\PayPal\Tests\MockRequestPayloads;
use 
Srmklive\PayPal\Tests\MockResponsePayloads;

class 
InvoicesTest extends TestCase
{
    use 
MockClientClasses;
    use 
MockRequestPayloads;
    use 
MockResponsePayloads;

    
/** @test */
    
public function it_can_generate_unique_invoice_number()
    {
        
$expectedResponse $this->mockGenerateInvoiceNumberResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_create_a_draft_invoice()
    {
        
$expectedResponse $this->mockCreateInvoicesResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->createInvoiceParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_list_current_invoices()
    {
        
$expectedResponse $this->mockListInvoicesResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices?total_required=true';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'get');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->get($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_delete_an_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'delete');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->delete($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_update_an_invoice()
    {
        
$expectedResponse $this->mockUpdateInvoicesResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->updateInvoiceParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'put');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->put($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_show_details_for_an_invoice()
    {
        
$expectedResponse $this->mockGetInvoicesResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'get');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->get($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_cancel_an_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/cancel';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->cancelInvoiceParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_generate_qr_code_for_invoice()
    {
        
$expectedResponse $this->mockGenerateInvoiceNumberResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/generate-qr-code';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->generateQRCodeInvoiceParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_register_payment_for_invoice()
    {
        
$expectedResponse $this->mockInvoiceRegisterPaymentResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/payments';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->registerInvoicePaymentParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_delete_payment_for_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/payments/EXTR-86F38350LX4353815';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'delete');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->delete($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_refund_payment_for_invoice()
    {
        
$expectedResponse $this->mockInvoiceRefundPaymentResponse();

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/refunds';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->refundInvoicePaymentParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_delete_refund_for_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-333R-YUQL-YNNN-D7WF/refunds/EXTR-2LG703375E477444T';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'delete');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->delete($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_send_an_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-EHNV-LJ5S-A7DZ-V6NJ/send';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->sendInvoiceParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }

    
/** @test */
    
public function it_can_send_reminder_for_an_invoice()
    {
        
$expectedResponse '';

        
$expectedEndpoint 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/remind';
        
$expectedParams = [
            
'headers' => [
                
'Accept'            => 'application/json',
                
'Accept-Language'   => 'en_US',
                
'Authorization'     => 'Bearer some-token',
            ],
            
'json' => $this->sendInvoiceReminderParams(),
        ];

        
$mockHttpClient $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint$expectedParams'post');

        
$this->assertEquals($expectedResponseUtils::jsonDecode($mockHttpClient->post($expectedEndpoint$expectedParams)->getBody(), true));
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0043 ]--