Skip to content

Commit ed32cfe

Browse files
committed
use openapi-generator for PHP client
1 parent c5efee6 commit ed32cfe

3,496 files changed

Lines changed: 421261 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.2

rest_client_php/.php_cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setUsingCache(true)
5+
->setRules([
6+
'@PSR2' => true,
7+
'ordered_imports' => true,
8+
'phpdoc_order' => true,
9+
'array_syntax' => [ 'syntax' => 'short' ],
10+
'strict_comparison' => true,
11+
'strict_param' => true,
12+
'no_trailing_whitespace' => false,
13+
'no_trailing_whitespace_in_comment' => false,
14+
'braces' => false,
15+
'single_blank_line_at_eof' => false,
16+
'blank_line_after_namespace' => false,
17+
])
18+
->setFinder(
19+
PhpCsFixer\Finder::create()
20+
->exclude('test')
21+
->exclude('tests')
22+
->in(__DIR__)
23+
);

rest_client_php/.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: php
2+
sudo: false
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- 7.0
8+
- hhvm
9+
before_install: "composer install"
10+
script: "vendor/bin/phpunit"

rest_client_php/README.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# OpenAPIClient-php
2+
3+
The MDES APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP Method used to access it. All strings in request and response objects are to be UTF-8 encoded. Each API URI includes the major and minor version of API that it conforms to. This will allow multiple concurrent versions of the API to be deployed simultaneously.
4+
5+
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
6+
7+
- API version: 1.2.7
8+
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
9+
10+
## Requirements
11+
12+
PHP 5.5 and later
13+
14+
## Installation & Usage
15+
16+
### Composer
17+
18+
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
19+
20+
```json
21+
{
22+
"repositories": [
23+
{
24+
"type": "vcs",
25+
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
26+
}
27+
],
28+
"require": {
29+
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
30+
}
31+
}
32+
```
33+
34+
Then run `composer install`
35+
36+
### Manual Installation
37+
38+
Download the files and include `autoload.php`:
39+
40+
```php
41+
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
42+
```
43+
44+
## Tests
45+
46+
To run the unit tests:
47+
48+
```bash
49+
composer install
50+
./vendor/bin/phpunit
51+
```
52+
53+
## Getting Started
54+
55+
Please follow the [installation procedure](#installation--usage) and then run the following:
56+
57+
```php
58+
<?php
59+
require_once(__DIR__ . '/vendor/autoload.php');
60+
61+
62+
63+
$apiInstance = new OpenAPI\Client\Api\DeleteApi(
64+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
65+
// This is optional, `GuzzleHttp\Client` will be used as default.
66+
new GuzzleHttp\Client()
67+
);
68+
$delete_request_schema = new \OpenAPI\Client\Model\DeleteRequestSchema(); // \OpenAPI\Client\Model\DeleteRequestSchema | Contains the details of the request message.
69+
70+
try {
71+
$result = $apiInstance->deleteDigitization($delete_request_schema);
72+
print_r($result);
73+
} catch (Exception $e) {
74+
echo 'Exception when calling DeleteApi->deleteDigitization: ', $e->getMessage(), PHP_EOL;
75+
}
76+
77+
?>
78+
```
79+
80+
## Documentation for API Endpoints
81+
82+
All URIs are relative to *https://api.mastercard.com/mdes*
83+
84+
Class | Method | HTTP request | Description
85+
------------ | ------------- | ------------- | -------------
86+
*DeleteApi* | [**deleteDigitization**](docs/Api/DeleteApi.md#deletedigitization) | **POST** /digitization/static/1/0/delete | Used to delete one or more Tokens. The API is limited to 10 Tokens per request.
87+
*GetAssetApi* | [**getAsset**](docs/Api/GetAssetApi.md#getasset) | **GET** /assets/static/1/0/asset/{AssetId} | Used to retrieve static Assets from MDES�s repository, such as Card art, MasterCard brand logos, Issuer logos, and Terms and Conditions.
88+
*GetTaskStatusApi* | [**getTaskStatus**](docs/Api/GetTaskStatusApi.md#gettaskstatus) | **POST** /digitization/static/1/0/getTaskStatus | Used to check the status of any asynchronous task that was previously requested.
89+
*GetTokenApi* | [**getToken**](docs/Api/GetTokenApi.md#gettoken) | **POST** /digitization/static/1/0/getToken | Used to get the status and details of a single given Token.
90+
*NotifyTokenUpdatedApi* | [**notifyTokenUpdateForTokenStateChange**](docs/Api/NotifyTokenUpdatedApi.md#notifytokenupdatefortokenstatechange) | **POST** /digitization/static/1/0/notifyTokenUpdated | Outbound API used by MDES to notify the Token Requestor of significant Token updates, such as when the Token is activated, suspended, unsuspended or deleted; or when information about the Token or its product configuration has changed.
91+
*SearchTokensApi* | [**searchTokens**](docs/Api/SearchTokensApi.md#searchtokens) | **POST** /digitization/static/1/0/searchTokens | Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN.
92+
*SuspendApi* | [**createSuspend**](docs/Api/SuspendApi.md#createsuspend) | **POST** /digitization/static/1/0/suspend | Used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost). The API is limited to 10 Tokens per request.
93+
*TokenizeApi* | [**createTokenize**](docs/Api/TokenizeApi.md#createtokenize) | **POST** /digitization/static/1/0/tokenize | Used to digitize a card to create a server-based Token.
94+
*TransactApi* | [**createTransact**](docs/Api/TransactApi.md#createtransact) | **POST** /remotetransaction/static/1/0/transact | Used by the Token Requestor to create a Digital Secure Remote Payment (\&quot;DSRP\&quot;) transaction cryptogram using the credentials stored within MDES in order to perform a DSRP transaction.
95+
*UnsuspendApi* | [**createUnsuspend**](docs/Api/UnsuspendApi.md#createunsuspend) | **POST** /digitization/static/1/0/unsuspend | Used to unsuspend one or more previously suspended Tokens. The API is limited to 10 Tokens per request.
96+
97+
98+
## Documentation For Models
99+
100+
- [AssetResponseSchema](docs/Model/AssetResponseSchema.md)
101+
- [AuthenticationMethods](docs/Model/AuthenticationMethods.md)
102+
- [BillingAddress](docs/Model/BillingAddress.md)
103+
- [CardInfo](docs/Model/CardInfo.md)
104+
- [CardInfoData](docs/Model/CardInfoData.md)
105+
- [DecisioningData](docs/Model/DecisioningData.md)
106+
- [DeleteRequestSchema](docs/Model/DeleteRequestSchema.md)
107+
- [DeleteResponseSchema](docs/Model/DeleteResponseSchema.md)
108+
- [EncryptedPayload](docs/Model/EncryptedPayload.md)
109+
- [EncryptedPayloadTransact](docs/Model/EncryptedPayloadTransact.md)
110+
- [Error](docs/Model/Error.md)
111+
- [ErrorsResponse](docs/Model/ErrorsResponse.md)
112+
- [GetTaskStatusRequestSchema](docs/Model/GetTaskStatusRequestSchema.md)
113+
- [GetTaskStatusResponseSchema](docs/Model/GetTaskStatusResponseSchema.md)
114+
- [GetTokenRequestSchema](docs/Model/GetTokenRequestSchema.md)
115+
- [GetTokenResponseSchema](docs/Model/GetTokenResponseSchema.md)
116+
- [MediaContent](docs/Model/MediaContent.md)
117+
- [NotifyTokenEncryptedPayload](docs/Model/NotifyTokenEncryptedPayload.md)
118+
- [NotifyTokenUpdatedRequestSchema](docs/Model/NotifyTokenUpdatedRequestSchema.md)
119+
- [NotifyTokenUpdatedResponseSchema](docs/Model/NotifyTokenUpdatedResponseSchema.md)
120+
- [ProductConfig](docs/Model/ProductConfig.md)
121+
- [SearchTokensRequestSchema](docs/Model/SearchTokensRequestSchema.md)
122+
- [SearchTokensResponseSchema](docs/Model/SearchTokensResponseSchema.md)
123+
- [SuspendRequestSchema](docs/Model/SuspendRequestSchema.md)
124+
- [SuspendResponseSchema](docs/Model/SuspendResponseSchema.md)
125+
- [Token](docs/Model/Token.md)
126+
- [TokenDetail](docs/Model/TokenDetail.md)
127+
- [TokenDetailData](docs/Model/TokenDetailData.md)
128+
- [TokenDetailDataPAR](docs/Model/TokenDetailDataPAR.md)
129+
- [TokenDetailTokenizeResponse](docs/Model/TokenDetailTokenizeResponse.md)
130+
- [TokenForLCM](docs/Model/TokenForLCM.md)
131+
- [TokenInfo](docs/Model/TokenInfo.md)
132+
- [TokenizeRequestSchema](docs/Model/TokenizeRequestSchema.md)
133+
- [TokenizeResponseSchema](docs/Model/TokenizeResponseSchema.md)
134+
- [TransactEncryptedData](docs/Model/TransactEncryptedData.md)
135+
- [TransactError](docs/Model/TransactError.md)
136+
- [TransactRequestSchema](docs/Model/TransactRequestSchema.md)
137+
- [TransactResponseSchema](docs/Model/TransactResponseSchema.md)
138+
- [UnSuspendRequestSchema](docs/Model/UnSuspendRequestSchema.md)
139+
- [UnSuspendResponseSchema](docs/Model/UnSuspendResponseSchema.md)
140+
141+
142+
## Documentation For Authorization
143+
144+
All endpoints do not require authorization.
145+
146+
## Author
147+
148+
149+

rest_client_php/composer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "GIT_USER_ID/GIT_REPO_ID",
3+
"description": "The MDES APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP Method used to access it. All strings in request and response objects are to be UTF-8 encoded. Each API URI includes the major and minor version of API that it conforms to. This will allow multiple concurrent versions of the API to be deployed simultaneously.",
4+
"keywords": [
5+
"openapitools",
6+
"openapi-generator",
7+
"openapi",
8+
"php",
9+
"sdk",
10+
"rest",
11+
"api"
12+
],
13+
"homepage": "https://openapi-generator.tech",
14+
"license": "unlicense",
15+
"authors": [
16+
{
17+
"name": "OpenAPI-Generator contributors",
18+
"homepage": "https://openapi-generator.tech"
19+
}
20+
],
21+
"require": {
22+
"php": ">=7.1",
23+
"ext-curl": "*",
24+
"ext-json": "*",
25+
"ext-mbstring": "*",
26+
"guzzlehttp/guzzle": "^6.2",
27+
"mastercard/oauth1-signer": "^1.1",
28+
"mastercard/client-encryption": "^1.1"
29+
},
30+
"require-dev": {
31+
"phpunit/phpunit": "^7.4",
32+
"squizlabs/php_codesniffer": "~2.6",
33+
"friendsofphp/php-cs-fixer": "~2.12"
34+
},
35+
"autoload": {
36+
"psr-4": { "OpenAPI\\Client\\" : "lib/" }
37+
},
38+
"autoload-dev": {
39+
"psr-4": { "OpenAPI\\Client\\" : "test/" }
40+
}
41+
}

0 commit comments

Comments
 (0)