# Deprecations ## Soft Deprecations This functionality is currently [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation): ### Writing Tests #### Test Double API | Issue | Description | Since | Replacement | |-------------------------------------------------------------------|-----------------------------------|-------|-------------| | [#3687](https://github.com/sebastianbergmann/phpunit/issues/3687) | `MockBuilder::setMethods()` | 8.3.0 | | | [#3687](https://github.com/sebastianbergmann/phpunit/issues/3687) | `MockBuilder::setMethodsExcept()` | 9.6.0 | | ## Hard Deprecations This functionality is currently [hard-deprecated](https://phpunit.de/backward-compatibility.html#hard-deprecation): ### Writing Tests #### Assertions, Constraints, and Expectations | Issue | Description | Since | Replacement | |-------------------------------------------------------------------|------------------------------------------------|-------|---------------------------------------------------| | [#4062](https://github.com/sebastianbergmann/phpunit/issues/4062) | `TestCase::assertNotIsReadable()` | 9.1.0 | `TestCase::assertIsNotReadable()` | | [#4065](https://github.com/sebastianbergmann/phpunit/issues/4065) | `TestCase::assertNotIsWritable()` | 9.1.0 | `TestCase::assertIsNotWritable()` | | [#4068](https://github.com/sebastianbergmann/phpunit/issues/4068) | `TestCase::assertDirectoryNotExists()` | 9.1.0 | `TestCase::assertDirectoryDoesNotExist()` | | [#4071](https://github.com/sebastianbergmann/phpunit/issues/4071) | `TestCase::assertDirectoryNotIsReadable()` | 9.1.0 | `TestCase::assertDirectoryIsNotReadable()` | | [#4074](https://github.com/sebastianbergmann/phpunit/issues/4074) | `TestCase::assertDirectoryNotIsWritable()` | 9.1.0 | `TestCase::assertDirectoryIsNotWritable()` | | [#4077](https://github.com/sebastianbergmann/phpunit/issues/4077) | `TestCase::assertFileNotExists()` | 9.1.0 | `TestCase::assertFileDoesNotExist()` | | [#4080](https://github.com/sebastianbergmann/phpunit/issues/4080) | `TestCase::assertFileNotIsReadable()` | 9.1.0 | `TestCase::assertFileIsNotReadable()` | | [#4083](https://github.com/sebastianbergmann/phpunit/issues/4083) | `TestCase::assertFileNotIsWritable()` | 9.1.0 | `TestCase::assertFileIsNotWritable()` | | [#4086](https://github.com/sebastianbergmann/phpunit/issues/4086) | `TestCase::assertRegExp()` | 9.1.0 | `TestCase::assertMatchesRegularExpression()` | | [#4089](https://github.com/sebastianbergmann/phpunit/issues/4089) | `TestCase::assertNotRegExp()` | 9.1.0 | `TestCase::assertDoesNotMatchRegularExpression()` | | [#4091](https://github.com/sebastianbergmann/phpunit/issues/4091) | `TestCase::assertEqualXMLStructure()` | 9.1.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecation()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecationMessage()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecationMessageMatches()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectError()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectErrorMessage()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectErrorMessageMatches()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNotice()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNoticeMessage()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNoticeMessageMatches()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarning()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarningMessage()` | 9.6.0 | | | [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarningMessageMatches()` | 9.6.0 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassHasAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassNotHasAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassHasStaticAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassNotHasStaticAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertObjectHasAttribute()` | 9.6.1 | `TestCase::assertObjectHasProperty()` | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertObjectNotHasAttribute()` | 9.6.1 | `TestCase::assertObjectNotHasProperty()` | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::classHasAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::classHasStaticAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::objectHasAttribute()` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ClassHasAttribute` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ClassHasStaticAttribute` | 9.6.1 | | | [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ObjectHasAttribute` | 9.6.1 | `ObjectHasProperty` | #### Test Double API | Issue | Description | Since | Replacement | |-------------------------------------------------------------------|---------------------------------------|-------|-------------------------------------------------------------------------| | [#4141](https://github.com/sebastianbergmann/phpunit/issues/4141) | `TestCase::prophesize()` | 9.1.0 | [phpspec/prophecy-phpunit](https://github.com/phpspec/prophecy-phpunit) | | [#4297](https://github.com/sebastianbergmann/phpunit/issues/4297) | `TestCase::at()` | 9.3.0 | | | [#4297](https://github.com/sebastianbergmann/phpunit/issues/4297) | `InvokedAtIndex` | 9.3.0 | | | [#5063](https://github.com/sebastianbergmann/phpunit/issues/5063) | `InvocationMocker::withConsecutive()` | 9.6.0 | | | [#5063](https://github.com/sebastianbergmann/phpunit/issues/5063) | `ConsecutiveParameters` | 9.6.0 | | | [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064) | `TestCase::getMockClass()` | 9.6.0 | | #### Miscellaneous | Issue | Description | Since | Replacement | |-------------------------------------------------------------------|----------------------------------------------|-------|------------------------------------------------| | [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132) | `Test` suffix for abstract test case classes | | | | | `TestCase::$backupGlobalsBlacklist` | 9.3.0 | `TestCase::$backupGlobalsExcludeList` | | | `TestCase::$backupStaticAttributesBlacklist` | 9.3.0 | `TestCase::$backupStaticAttributesExcludeList` | ### Extending PHPUnit | Issue | Description | Since | Replacement | |-------------------------------------------------------------------|--------------------------------------|-------|-------------------------------------------------------------| | [#4676](https://github.com/sebastianbergmann/phpunit/issues/4676) | `TestListener` | 8.0.0 | [Event System](https://docs.phpunit.de/en/10.3/events.html) | | [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `Command::handleLoader()` | 9.1.0 | | | [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `TestSuiteLoader` | 9.1.0 | | | [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `StandardTestSuiteLoader` | 9.1.0 | | | [#4676](https://github.com/sebastianbergmann/phpunit/issues/4676) | `TestListenerDefaultImplementation` | 8.2.4 | [Event System](https://docs.phpunit.de/en/10.3/events.html) |
Get access token to initiates payment transaction.
generate-token
| Parameter | Type | Comments |
|---|---|---|
| client_id | string | Enter merchant API client/primary key |
| secret_id | string | Enter merchant API secret key |
| env | string | Enter merchant API environment |
| merchant_id | string | Enter merchant API merchant id |
Request Example (guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', $base_url. 'v1/generate-token', [
'headers' => [
'accept' => 'application/json',
'content-type' => 'application/json',
],
'form_params' => [
'client_id' => '$client_id',
'secret_id' => 'secret_id',
'env' => 'env',
'merchant_id' => 'merchant_id',
],
]);
echo $response->getBody();
**Response: SUCCESS (200 OK)**
{
"message": {
"success": [
"Successfully token is generated"
]
},
"data": {
"token":"eyJpdiI6InpkczhjTjhQdVhUL2lKQ0pSUUx6aUE9PSIsInZhbHVlIjoiVGVBTVBDTXltbjNZcEIvdEJveGpTSno3TU5NRUtnVkhCZ1pHTFNCUnZGQ2UxMnYxN202cEE1YVRDTEFsc0ZERExoTjdtL0dTL2xoU3QzeUJJOExiMUx5T0w1L0llUXhTUkU1cWVLWEdEbEplb0dKNXcwbTNRM0VxdkUwYzZuNFdtNkhMQ0pRZysyNWkvdzBxSlBoSVBSOGFTekNnR2RXNHVtcG9lMGZOTmNCcm1hR3c5Sk9KTnB4Y3ltZDl6cm90MThrR21Ca3B1azc3bXRiQ0J6SW96UVo1elNkU1ZqeE05bTcwWGp1MEUxWlJFdnNWTmpSbnVpeW92b2U4dXZkUGgyb1VmK0luaGdyaFlsVTZlcVpVRnZlTG1DeFF6Ykk2T2h6Z3JzbnIyNHpNdHowSE5JdDR0Y0pZT20zUm1XYW8iLCJtYWMiOiJlY2M4NGE1OGUzYzkzYzk0YzljNmVmNjE0YWI0ZDIwOGI3NDQ2YWEyY2ZhNzc0NzE4ZmY1ZmYyMz
IyZmQzNDY1IiwidGFnIjoiIn0=",
},
"type": "success"
}
**Response: ERROR (400 FAILED)**
{
"message": {
"error": [
"Invalid credentials."
]
},
"data": null,
"type": "error"
}