1. Go to this page and download the library: Download lloricode/laravel-maya-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Lloricode\Paymaya\Requests\Checkout\CreateCheckoutRequest;
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;
/**
* @test
*/
public function success_checkout()
{
$paymayaID = 'test-maya-generated-id';
$paymayaRedirectUrl = 'http://test-maya/redirect-url';
MockClient::global([
CreateCheckoutRequest::class => new MockResponse(
body: [
'checkoutId' => $paymayaID,
'redirectUrl' => $paymayaRedirectUrl,
]
),
]);
// your test