Commit c9abb530 by Murlidhar

Initial commit

parents
<?php
return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules([
'@PSR2' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'strict_comparison' => true,
'strict_param' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'braces' => false,
'single_blank_line_at_eof' => false,
'blank_line_after_namespace' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('test')
->exclude('tests')
->in(__DIR__)
);
language: php
sudo: false
php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
before_install: "composer install"
script: "vendor/bin/phpunit"
# SwaggerClient-php
The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
## Requirements
PHP 5.5 and later
## Installation & Usage
### Composer
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
```
{
"repositories": [
{
"type": "git",
"url": "https://github.com/git_user_id/git_repo_id.git"
}
],
"require": {
"git_user_id/git_repo_id": "*@dev"
}
}
```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
```
## Tests
To run the unit tests:
```
composer install
./vendor/bin/phpunit
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
try {
$apiInstance->cancelAuthorization($authorization_token);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->cancelAuthorization: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
$body = new \Swagger\Client\Model\CreateOrderRequest(); // \Swagger\Client\Model\CreateOrderRequest |
try {
$result = $apiInstance->createOrder($authorization_token, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
$body = new \Swagger\Client\Model\CustomerTokenCreationRequest(); // \Swagger\Client\Model\CustomerTokenCreationRequest |
try {
$result = $apiInstance->purchaseToken($authorization_token, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->purchaseToken: ', $e->getMessage(), PHP_EOL;
}
?>
```
## Documentation for API Endpoints
All URIs are relative to *https://api.klarna.com*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*OrdersApi* | [**cancelAuthorization**](docs/Api/OrdersApi.md#cancelauthorization) | **DELETE** /payments/v1/authorizations/{authorizationToken} | Cancel an existing authorization
*OrdersApi* | [**createOrder**](docs/Api/OrdersApi.md#createorder) | **POST** /payments/v1/authorizations/{authorizationToken}/order | Create a new order
*OrdersApi* | [**purchaseToken**](docs/Api/OrdersApi.md#purchasetoken) | **POST** /payments/v1/authorizations/{authorizationToken}/customer-token | Generate a consumer token
*SessionsApi* | [**createCreditSession**](docs/Api/SessionsApi.md#createcreditsession) | **POST** /payments/v1/sessions | Create a new payment session
*SessionsApi* | [**readCreditSession**](docs/Api/SessionsApi.md#readcreditsession) | **GET** /payments/v1/sessions/{session_id} | Read an existing payment session
*SessionsApi* | [**updateCreditSession**](docs/Api/SessionsApi.md#updatecreditsession) | **POST** /payments/v1/sessions/{session_id} | Update an existing payment session
## Documentation For Models
- [Address](docs/Model/Address.md)
- [AssetUrls](docs/Model/AssetUrls.md)
- [Attachment](docs/Model/Attachment.md)
- [AuthorizedPaymentMethod](docs/Model/AuthorizedPaymentMethod.md)
- [CreateOrderRequest](docs/Model/CreateOrderRequest.md)
- [Customer](docs/Model/Customer.md)
- [CustomerRead](docs/Model/CustomerRead.md)
- [CustomerReadCreateToken](docs/Model/CustomerReadCreateToken.md)
- [CustomerTokenCreationRequest](docs/Model/CustomerTokenCreationRequest.md)
- [CustomerTokenCreationResponse](docs/Model/CustomerTokenCreationResponse.md)
- [ErrorV2](docs/Model/ErrorV2.md)
- [MerchantSession](docs/Model/MerchantSession.md)
- [MerchantUrls](docs/Model/MerchantUrls.md)
- [Options](docs/Model/Options.md)
- [Order](docs/Model/Order.md)
- [OrderLine](docs/Model/OrderLine.md)
- [PaymentMethodCategory](docs/Model/PaymentMethodCategory.md)
- [ProductIdentifiers](docs/Model/ProductIdentifiers.md)
- [Session](docs/Model/Session.md)
- [SessionCreate](docs/Model/SessionCreate.md)
- [SessionRead](docs/Model/SessionRead.md)
- [Subscription](docs/Model/Subscription.md)
## Documentation For Authorization
All endpoints do not require authorization.
## Author
{
"name": "klarna/payments",
"description": "A Klarna Payments SDK",
"keywords": [
"swagger",
"php",
"sdk",
"rest",
"api"
],
"homepage": "http://swagger.io",
"license": "proprietary",
"authors": [
{
"name": "Swagger and contributors",
"homepage": "https://github.com/swagger-api/swagger-codegen"
}
],
"require": {
"php": "^7.4",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.0 || ^9.0",
"friendsofphp/php-cs-fixer": "^3.5"
},
"autoload": {
"psr-4": { "Swagger\\Client\\" : "lib/" }
},
"autoload-dev": {
"psr-4": { "Swagger\\Client\\" : "test/" }
}
}
# Swagger\Client\OrdersApi
All URIs are relative to *https://api.klarna.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**cancelAuthorization**](OrdersApi.md#cancelauthorization) | **DELETE** /payments/v1/authorizations/{authorizationToken} | Cancel an existing authorization
[**createOrder**](OrdersApi.md#createorder) | **POST** /payments/v1/authorizations/{authorizationToken}/order | Create a new order
[**purchaseToken**](OrdersApi.md#purchasetoken) | **POST** /payments/v1/authorizations/{authorizationToken}/customer-token | Generate a consumer token
# **cancelAuthorization**
> cancelAuthorization($authorization_token)
Cancel an existing authorization
Use this API call to cancel/release an authorization. If the `authorization_token` received during a Klarna Payments won’t be used to place an order immediately you could release the authorization. Read more on **[Cancel an existing authorization](https://docs.klarna.com/klarna-payments/other-actions/cancel-an-authorization/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
try {
$apiInstance->cancelAuthorization($authorization_token);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->cancelAuthorization: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization_token** | **string**| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **createOrder**
> \Swagger\Client\Model\Order createOrder($authorization_token, $body)
Create a new order
Use this API call to create a new order. Placing an order towards Klarna means that the Klarna Payments session will be closed and that an order will be created in Klarna's system.<br/>When you have received the `authorization_token` for a successful authorization you can place the order. Among the other order details in this request, you include a URL to the confirmation page for the customer.<br/>When the Order has been successfully placed at Klarna, you need to handle it either through the Merchant Portal or using [Klarna’s Order Management API](#order-management-api). Read more on **[Create a new order](https://docs.klarna.com/klarna-payments/integrate-with-klarna-payments/step-3-create-an-order/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
$body = new \Swagger\Client\Model\CreateOrderRequest(); // \Swagger\Client\Model\CreateOrderRequest |
try {
$result = $apiInstance->createOrder($authorization_token, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization_token** | **string**| |
**body** | [**\Swagger\Client\Model\CreateOrderRequest**](../Model/CreateOrderRequest.md)| | [optional]
### Return type
[**\Swagger\Client\Model\Order**](../Model/Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **purchaseToken**
> \Swagger\Client\Model\CustomerTokenCreationResponse purchaseToken($authorization_token, $body)
Generate a consumer token
Use this API call to create a Klarna Customer Token.<br/>After having obtained an `authorization_token` for a successful authorization, this can be used to create a purchase token instead of placing the order. Creating a Klarna Customer Token results in Klarna storing customer and payment method details. Read more on **[Generate a consumer token](https://docs.klarna.com/klarna-payments/in-depth-knowledge/customer-token/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\OrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization_token = "authorization_token_example"; // string |
$body = new \Swagger\Client\Model\CustomerTokenCreationRequest(); // \Swagger\Client\Model\CustomerTokenCreationRequest |
try {
$result = $apiInstance->purchaseToken($authorization_token, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->purchaseToken: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization_token** | **string**| |
**body** | [**\Swagger\Client\Model\CustomerTokenCreationRequest**](../Model/CustomerTokenCreationRequest.md)| | [optional]
### Return type
[**\Swagger\Client\Model\CustomerTokenCreationResponse**](../Model/CustomerTokenCreationResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# Swagger\Client\SessionsApi
All URIs are relative to *https://api.klarna.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createCreditSession**](SessionsApi.md#createcreditsession) | **POST** /payments/v1/sessions | Create a new payment session
[**readCreditSession**](SessionsApi.md#readcreditsession) | **GET** /payments/v1/sessions/{session_id} | Read an existing payment session
[**updateCreditSession**](SessionsApi.md#updatecreditsession) | **POST** /payments/v1/sessions/{session_id} | Update an existing payment session
# **createCreditSession**
> \Swagger\Client\Model\MerchantSession createCreditSession($body)
Create a new payment session
Use this API call to create a Klarna Payments session.<br/>When a session is created you will receive the available `payment_method_categories` for the session, a `session_id` and a `client_token`. The `session_id` can be used to read or update the session using the REST API. The `client_token` should be passed to the browser. Read more on **[Create a new payment session](https://docs.klarna.com/klarna-payments/integrate-with-klarna-payments/step-1-initiate-a-payment/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\SessionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$body = new \Swagger\Client\Model\SessionCreate(); // \Swagger\Client\Model\SessionCreate | session_request
try {
$result = $apiInstance->createCreditSession($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SessionsApi->createCreditSession: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\SessionCreate**](../Model/SessionCreate.md)| session_request |
### Return type
[**\Swagger\Client\Model\MerchantSession**](../Model/MerchantSession.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **readCreditSession**
> \Swagger\Client\Model\SessionRead readCreditSession($session_id)
Read an existing payment session
Use this API call to read a Klarna Payments session. You can read the Klarna Payments session at any time after it has been created, to get information about it. This will return all data that has been collected during the session. Read more on **[Read an existing payment session](https://docs.klarna.com/klarna-payments/other-actions/check-the-details-of-a-payment-session/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\SessionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$session_id = "session_id_example"; // string | session_id
try {
$result = $apiInstance->readCreditSession($session_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SessionsApi->readCreditSession: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**session_id** | **string**| session_id |
### Return type
[**\Swagger\Client\Model\SessionRead**](../Model/SessionRead.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **updateCreditSession**
> updateCreditSession($body, $session_id)
Update an existing payment session
Use this API call to update a Klarna Payments session with new details, in case something in the order has changed and the checkout has been reloaded. Including if the consumer adds a new item to the cart or if consumer details are updated. Read more on **[Update an existing payment session](https://docs.klarna.com/klarna-payments/other-actions/update-the-cart/)**.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\SessionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$body = new \Swagger\Client\Model\Session(); // \Swagger\Client\Model\Session | session_request
$session_id = "session_id_example"; // string | session_id
try {
$apiInstance->updateCreditSession($body, $session_id);
} catch (Exception $e) {
echo 'Exception when calling SessionsApi->updateCreditSession: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\Session**](../Model/Session.md)| session_request |
**session_id** | **string**| session_id |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# Address
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attention** | **string** | ‘Attn.’ (if applicable). Only applicable for B2B customers. | [optional]
**city** | **string** | Customer’s city. | [optional]
**country** | **string** | Customer’s country. This value overrides the purchase country if they are different. Should follow the standard of ISO 3166 alpha-2. E.g. GB, US, DE, SE. | [optional]
**email** | **string** | Customer’s email address. | [optional]
**family_name** | **string** | Customers family name in UTF-8 encoding. Cannot be only numbers, must be more than 1 character. Allowed special characters: -&#x27;’. More information can be found [in this link](https://docs.klarna.com/klarna-payments/in-depth-knowledge/customer-data-requirements/#details-needed-per-market) | [optional]
**given_name** | **string** | Customers given name in UTF-8 encoding. Cannot be only numbers, must be more than 1 character. Allowed special characters: -&#x27;’. More information can be found [in this link](https://docs.klarna.com/klarna-payments/in-depth-knowledge/customer-data-requirements/#details-needed-per-market) | [optional]
**organization_name** | **string** | Organization name (if applicable). Only applicable for B2B customers. | [optional]
**phone** | **string** | Phone number. Preferably a mobile phone number. | [optional]
**postal_code** | **string** | Customer’s postal code. Validation according to Universal Postal Union addressing systems. E.g. 12345, W1G OPW. | [optional]
**region** | **string** | Customer’s region or state - Mandatory for US and AU market. Validations according to ISO 3166-2 format, e.g. OH, NJ, etc. | [optional]
**street_address** | **string** | Customer’s street address. Regional formatting is required, as follows: UK/US/FR: 33 Cavendish Square Rest of EU: De Ruijterkade 7 | [optional]
**street_address2** | **string** | Customer’s street address. Second Line. | [optional]
**title** | **string** | Customer’s Title. Allowed values per country: UK - \&quot;Mr\&quot;, \&quot;Ms\&quot; DE - \&quot;Herr\&quot;, \&quot;Frau\&quot; AT: \&quot;Herr, \&quot;Frau\&quot; CH: de-CH: \&quot;Herr, \&quot;Frau\&quot; it-CH: \&quot;Sig.\&quot;, \&quot;Sig.ra\&quot; fr-CH: \&quot;M\&quot;, \&quot;Mme\&quot; BE: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; NL: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# AssetUrls
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**descriptive** | **string** | URL of the descriptive asset. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated. | [optional]
**standard** | **string** | URL of the standard asset. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Attachment
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**body** | **string** | The content of the extra merchant data should be presented as a string inside this property. The body should be an object containing any of the keys and sub-objects described below serialized to JSON. More information on that object can be found [here](https://developers.klarna.com/api/#attachment-schema). |
**content_type** | **string** | The content type of the body. It is usually represented as \&quot;application/vnd.klarna.internal.emd-v2+json\&quot; |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# AuthorizedPaymentMethod
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number_of_days** | **int** | | [optional]
**number_of_installments** | **int** | | [optional]
**type** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# CreateOrderRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**authorization_token** | **string** | Authorization token. | [optional]
**auto_capture** | **bool** | Allow merchant to trigger auto capturing. | [optional] [default to false]
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**custom_payment_method_ids** | **string[]** | Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications. | [optional]
**customer** | [**\Swagger\Client\Model\Customer**](Customer.md) | | [optional]
**locale** | **string** | Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country. Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**. | [optional]
**merchant_data** | **string** | Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters) | [optional]
**merchant_reference1** | **string** | Used for storing merchant&#x27;s internal order number or other reference. | [optional]
**merchant_reference2** | **string** | Used for storing merchant&#x27;s internal order number or other reference. The value is available in the settlement files. (max 255 characters). | [optional]
**merchant_urls** | [**\Swagger\Client\Model\MerchantUrls**](MerchantUrls.md) | | [optional]
**order_amount** | **int** | Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. |
**order_lines** | [**\Swagger\Client\Model\OrderLine[]**](OrderLine.md) | The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order. |
**order_tax_amount** | **int** | Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**payment_method_categories** | [**\Swagger\Client\Model\PaymentMethodCategory[]**](PaymentMethodCategory.md) | Available payment method categories | [optional]
**purchase_country** | **string** | The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc. |
**purchase_currency** | **string** | The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc. |
**shipping_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**status** | **string** | The current status of the session. Possible values: &#x27;complete&#x27;, &#x27;incomplete&#x27; where &#x27;complete&#x27; is set when the order has been placed. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Customer
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date_of_birth** | **string** | Customer’s date of birth. The format is ‘yyyy-mm-dd’ | [optional]
**gender** | **string** | Customer’s gender - ‘male’ or ‘female’ | [optional]
**last_four_ssn** | **string** | Last four digits of the customer&#x27;s social security number. This value is available for US customers. | [optional]
**national_identification_number** | **string** | The customer&#x27;s national identification number. This value is available for EU customers utilizing national identification numbers. | [optional]
**organization_entity_type** | **string** | Organization entity type. Only applicable for B2B customers. | [optional]
**organization_registration_id** | **string** | Organization registration id. Only applicable for B2B customers. | [optional]
**title** | **string** | Customer’s Title. Allowed values per country: UK - \&quot;Mr\&quot;, \&quot;Ms\&quot; DE - \&quot;Herr\&quot;, \&quot;Frau\&quot; AT: \&quot;Herr, \&quot;Frau\&quot; CH: de-CH: \&quot;Herr, \&quot;Frau\&quot; it-CH: \&quot;Sig.\&quot;, \&quot;Sig.ra\&quot; fr-CH: \&quot;M\&quot;, \&quot;Mme\&quot; BE: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; NL: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; | [optional]
**type** | **string** | Type of customer in the session. If nothing is added, a B2C session will be the default. If it is a b2b-session, you should enter organization to trigger a B2B session. | [optional]
**vat_id** | **string** | VAT ID. Only applicable for B2B customers. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# CustomerRead
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date_of_birth** | **string** | Customer’s date of birth. The format is ‘yyyy-mm-dd’ | [optional]
**gender** | **string** | Customer’s gender - ‘male’ or ‘female’ | [optional]
**organization_entity_type** | **string** | Organization entity type. Only applicable for B2B customers. | [optional]
**organization_registration_id** | **string** | Organization registration id. Only applicable for B2B customers. | [optional]
**title** | **string** | Customer’s Title. Allowed values per country: UK - \&quot;Mr\&quot;, \&quot;Ms\&quot; DE - \&quot;Herr\&quot;, \&quot;Frau\&quot; AT: \&quot;Herr, \&quot;Frau\&quot; CH: de-CH: \&quot;Herr, \&quot;Frau\&quot; it-CH: \&quot;Sig.\&quot;, \&quot;Sig.ra\&quot; fr-CH: \&quot;M\&quot;, \&quot;Mme\&quot; BE: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; NL: \&quot;Dhr.\&quot;, \&quot;Mevr.\&quot; | [optional]
**type** | **string** | Type of customer in the session. If nothing is added, a B2C session will be the default. If it is a b2b-session, you should enter organization to trigger a B2B session. | [optional]
**vat_id** | **string** | VAT ID. Only applicable for B2B customers. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# CustomerReadCreateToken
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date_of_birth** | **string** | Customer’s date of birth. The format is ‘yyyy-mm-dd’ | [optional]
**gender** | **string** | Customer’s gender - ‘male’ or ‘female’ | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# CustomerTokenCreationRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**customer** | [**\Swagger\Client\Model\Customer**](Customer.md) | | [optional]
**description** | **string** | Description of the purpose of the token. |
**intended_use** | **string** | Intended use for the token. |
**locale** | **string** | RFC 1766 customer&#x27;s locale. |
**purchase_country** | **string** | ISO 3166 alpha-2 purchase country. |
**purchase_currency** | **string** | ISO 4217 purchase currency. |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# CustomerTokenCreationResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**customer** | [**\Swagger\Client\Model\CustomerReadCreateToken**](CustomerReadCreateToken.md) | | [optional]
**payment_method_reference** | **string** | Used to connect customers with payment method when it is present. | [optional]
**redirect_url** | **string** | URL to redirect the customer to after placing the order. This is a Klarna URL where Klarna will place a cookie in the customer’s browser (if redirected) and redirect the customer back to the confirmation URL provided by the merchant. This is not a mandatory step but a recommended one to improve the returning customer’s experience. | [optional]
**token_id** | **string** | Generated customer token. This token will be used to create a new order for the subscription using the Create a New order using token API. |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# ErrorV2
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**authorized_payment_method** | [**\Swagger\Client\Model\AuthorizedPaymentMethod**](AuthorizedPaymentMethod.md) | | [optional]
**correlation_id** | **string** | | [optional]
**error_code** | **string** | | [optional]
**error_messages** | **string[]** | | [optional]
**fraud_status** | **string** | | [optional]
**reason** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# MerchantSession
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client_token** | **string** | Client token to be passed to the JS client while initializing the JS SDK in the next step. |
**payment_method_categories** | [**\Swagger\Client\Model\PaymentMethodCategory[]**](PaymentMethodCategory.md) | Available payment method categories for this particular session | [optional]
**session_id** | **string** | ID of the created session. Please use this ID to share with Klarna for identifying any issues during integration. |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# MerchantUrls
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**confirmation** | **string** | URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the consumer is sent to the redirect URL after placing the order. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL(max 2000 characters). | [optional]
**notification** | **string** | URL for notifications on pending orders. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL (max 2000 characters). | [optional]
**push** | **string** | URL that will be requested when an order is completed. Should be different than checkout and confirmation URLs. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL (max 2000 characters). | [optional]
**authorization** | **string** | URL for receiving the authorization token when payment is completed. Used for Authorization Callback. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Options
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**color_border** | **string** | Color for the border of elements within the iFrame. Value should be a CSS hex color, e.g. \&quot;#FF9900\&quot; | [optional]
**color_border_selected** | **string** | Color for the border of elements within the iFrame when selected by the customer. Value should be a CSS hex color, e.g. \&quot;#FF9900\&quot; | [optional]
**color_details** | **string** | Color for the bullet points within the iFrame. Value should be a CSS hex color, e.g. \&quot;#FF9900\&quot; | [optional]
**color_text** | **string** | Color for the texts within the iFrame. Value should be a CSS hex color, e.g. \&quot;#FF9900\&quot; | [optional]
**radius_border** | **string** | Radius for the border of elements within the iFrame. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**authorized_payment_method** | [**\Swagger\Client\Model\AuthorizedPaymentMethod**](AuthorizedPaymentMethod.md) | | [optional]
**fraud_status** | **string** | Fraud status for the order. Either ACCEPTED or PENDING. If ACCEPTED, the order could be captured. If PENDING, please wait till you receive the notification from Klarna in the notification URL that the order has been approved. You can find additional information here. | [optional]
**order_id** | **string** | Unique order ID of the transaction. This ID will be used for all order management processes. |
**redirect_url** | **string** | URL to redirect the customer to after placing the order. This is a Klarna URL to which the merchant should redirect the customer to. Klarna will place a cookie in the customer’s browser (if redirected) and redirect the customer back to the confirmation URL provided by the merchant. This is not a mandatory step but a recommended one to improve the returning customer’s experience. It is a spontaneous step and does not harm the customer’s experience. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# OrderLine
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**image_url** | **string** | URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters). A minimum of 250x250 px resolution is recommended for the image to look good in the Klarna app, and below 50x50 px won&#x27;t even show. We recommend using a good sized image (650x650 px or more), however the file size must not exceed 12MB. | [optional]
**merchant_data** | **string** | Used for storing merchant&#x27;s internal order number or other reference. Pass through field. (max 1024 characters) | [optional]
**name** | **string** | Descriptive name of the order line item. |
**product_identifiers** | [**\Swagger\Client\Model\ProductIdentifiers**](ProductIdentifiers.md) | | [optional]
**product_url** | **string** | URL to the product in the merchant’s webshop that can be later used in communications between Klarna and the customer. (max 1024 characters) | [optional]
**quantity** | **int** | Quantity of the order line item. Must be a non-negative number. |
**quantity_unit** | **string** | Unit used to describe the quantity, e.g. kg, pcs, etc. If defined the value has to be 1-8 characters. | [optional]
**reference** | **string** | Client facing article number, SKU or similar. Max length is 256 characters. | [optional]
**tax_rate** | **int** | Tax rate of the order line. Non-negative value. The percentage value is represented with two implicit decimals. I.e 1900 &#x3D; 19%. | [optional]
**total_amount** | **int** | Total amount of the order line. Must be defined as minor units. Includes tax and discount. Eg: 2500&#x3D;25 euros Value &#x3D; (quantity x unit_price) - total_discount_amount. (max value: 100000000) |
**total_discount_amount** | **int** | Non-negative minor units. Includes tax. Eg: 500&#x3D;5 euros | [optional]
**total_tax_amount** | **int** | Total tax amount of the order line. Must be within ±1 of total_amount - total_amount 10000 / (10000 + tax_rate). Negative when type is discount. | [optional]
**type** | **string** | Type of the order line item. The possible values are: physical discount shipping_fee sales_tax digital gift_card store_credit surcharge | [optional]
**unit_price** | **int** | Price for a single unit of the order line. Must be defined as minor units. Includes tax, excludes discount. (max value: 100000000) |
**subscription** | [**\Swagger\Client\Model\Subscription**](Subscription.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# PaymentMethodCategory
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asset_urls** | [**\Swagger\Client\Model\AssetUrls**](AssetUrls.md) | | [optional]
**identifier** | **string** | ID of the payment method category to be used while loading the widget later. The possible values are:&lt;ul&gt;&lt;li&gt;klarna&lt;/li&gt;&lt;li&gt;pay_later&lt;/li&gt;&lt;li&gt;pay_now&lt;/li&gt;&lt;li&gt;pay_over_time&lt;/li&gt;&lt;li&gt;direct_bank_transfer&lt;/li&gt;&lt;li&gt;direct_debit&lt;/li&gt;&lt;/ul&gt; | [optional]
**name** | **string** | Name of the payment method category. These names are dynamic depending on what payment method is in the category. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated, or any updates of included payment methods by you. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# ProductIdentifiers
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**brand** | **string** | The product&#x27;s brand name as generally recognized by consumers. If no brand is available for a product, do not supply any value. | [optional]
**category_path** | **string** | The product&#x27;s category path as used in the merchant&#x27;s webshop. Include the full and most detailed category and separate the segments with &#x27; &gt; &#x27; | [optional]
**global_trade_item_number** | **string** | The product&#x27;s Global Trade Item Number (GTIN). Common types of GTIN are EAN, ISBN or UPC. Exclude dashes and spaces, where possible | [optional]
**manufacturer_part_number** | **string** | The product&#x27;s Manufacturer Part Number (MPN), which - together with the brand - uniquely identifies a product. Only submit MPNs assigned by a manufacturer and use the most specific MPN possible | [optional]
**color** | **string** | Color to be shown to the end customer (max 64 characters). | [optional]
**size** | **string** | Size to be shown to the end customer (max 64 characters). | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Session
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**acquiring_channel** | **string** | The acquiring channel in which the session takes place. Ecommerce is default unless specified. Any other values should be defined in the agreement. | [optional]
**attachment** | [**\Swagger\Client\Model\Attachment**](Attachment.md) | | [optional]
**authorization_token** | **string** | Authorization token. | [optional]
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**client_token** | **string** | Token to be passed to the JS client | [optional]
**custom_payment_method_ids** | **string[]** | Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications. | [optional]
**customer** | [**\Swagger\Client\Model\Customer**](Customer.md) | | [optional]
**design** | **string** | Design package to use in the session. This can only by used if a custom design has been implemented for Klarna Payments and agreed upon in the agreement. It might have a financial impact. Delivery manager will provide the value for the parameter. | [optional]
**expires_at** | [**\DateTime**](\DateTime.md) | Session expiration date | [optional]
**locale** | **string** | Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country. Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**. | [optional]
**merchant_data** | **string** | Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters) | [optional]
**merchant_reference1** | **string** | Used for storing merchant&#x27;s internal order number or other reference. | [optional]
**merchant_reference2** | **string** | Used for storing merchant&#x27;s internal order number or other reference. The value is available in the settlement files. (max 255 characters). | [optional]
**merchant_urls** | [**\Swagger\Client\Model\MerchantUrls**](MerchantUrls.md) | | [optional]
**options** | [**\Swagger\Client\Model\Options**](Options.md) | | [optional]
**order_amount** | **int** | Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**order_lines** | [**\Swagger\Client\Model\OrderLine[]**](OrderLine.md) | The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order. | [optional]
**order_tax_amount** | **int** | Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**payment_method_categories** | [**\Swagger\Client\Model\PaymentMethodCategory[]**](PaymentMethodCategory.md) | Available payment method categories | [optional]
**purchase_country** | **string** | The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc. | [optional]
**purchase_currency** | **string** | The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc. | [optional]
**shipping_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**status** | **string** | The current status of the session. Possible values: &#x27;complete&#x27;, &#x27;incomplete&#x27; where &#x27;complete&#x27; is set when the order has been placed. | [optional]
**intent** | **string** | Intent for the session. The field is designed to let partners inform Klarna of the purpose of the customer’s session. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# SessionCreate
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**acquiring_channel** | **string** | The acquiring channel in which the session takes place. Ecommerce is default unless specified. Any other values should be defined in the agreement. | [optional]
**attachment** | [**\Swagger\Client\Model\Attachment**](Attachment.md) | | [optional]
**authorization_token** | **string** | Authorization token. | [optional]
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**client_token** | **string** | Token to be passed to the JS client | [optional]
**custom_payment_method_ids** | **string[]** | Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications. | [optional]
**customer** | [**\Swagger\Client\Model\Customer**](Customer.md) | | [optional]
**design** | **string** | Design package to use in the session. This can only by used if a custom design has been implemented for Klarna Payments and agreed upon in the agreement. It might have a financial impact. Delivery manager will provide the value for the parameter. | [optional]
**expires_at** | [**\DateTime**](\DateTime.md) | Session expiration date | [optional]
**locale** | **string** | Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country. Default value is \&quot;en-US\&quot;. Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**. | [optional]
**merchant_data** | **string** | Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters) | [optional]
**merchant_reference1** | **string** | Used for storing merchant&#x27;s internal order number or other reference. | [optional]
**merchant_reference2** | **string** | Used for storing merchant&#x27;s internal order number or other reference. The value is available in the settlement files. (max 255 characters). | [optional]
**merchant_urls** | [**\Swagger\Client\Model\MerchantUrls**](MerchantUrls.md) | | [optional]
**options** | [**\Swagger\Client\Model\Options**](Options.md) | | [optional]
**order_amount** | **int** | Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. |
**order_lines** | [**\Swagger\Client\Model\OrderLine[]**](OrderLine.md) | The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order. |
**order_tax_amount** | **int** | Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**payment_method_categories** | [**\Swagger\Client\Model\PaymentMethodCategory[]**](PaymentMethodCategory.md) | Available payment method categories | [optional]
**purchase_country** | **string** | The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc. |
**purchase_currency** | **string** | The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc. |
**shipping_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**status** | **string** | The current status of the session. Possible values: &#x27;complete&#x27;, &#x27;incomplete&#x27; where &#x27;complete&#x27; is set when the order has been placed. | [optional]
**intent** | **string** | Intent for the session. The field is designed to let partners inform Klarna of the purpose of the customer’s session. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# SessionRead
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**acquiring_channel** | **string** | The acquiring channel in which the session takes place. Ecommerce is default unless specified. Any other values should be defined in the agreement. | [optional]
**attachment** | [**\Swagger\Client\Model\Attachment**](Attachment.md) | | [optional]
**authorization_token** | **string** | Authorization token. | [optional]
**billing_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**client_token** | **string** | Token to be passed to the JS client | [optional]
**custom_payment_method_ids** | **string[]** | Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications. | [optional]
**customer** | [**\Swagger\Client\Model\CustomerRead**](CustomerRead.md) | | [optional]
**design** | **string** | Design package to use in the session. This can only by used if a custom design has been implemented for Klarna Payments and agreed upon in the agreement. It might have a financial impact. Delivery manager will provide the value for the parameter. | [optional]
**expires_at** | [**\DateTime**](\DateTime.md) | Session expiration date | [optional]
**locale** | **string** | Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country. Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**. | [optional]
**merchant_data** | **string** | Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters) | [optional]
**merchant_reference1** | **string** | Used for storing merchant&#x27;s internal order number or other reference. | [optional]
**merchant_reference2** | **string** | Used for storing merchant&#x27;s internal order number or other reference. The value is available in the settlement files. (max 255 characters). | [optional]
**merchant_urls** | [**\Swagger\Client\Model\MerchantUrls**](MerchantUrls.md) | | [optional]
**options** | [**\Swagger\Client\Model\Options**](Options.md) | | [optional]
**order_amount** | **int** | Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**order_lines** | [**\Swagger\Client\Model\OrderLine[]**](OrderLine.md) | The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order. | [optional]
**order_tax_amount** | **int** | Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500. | [optional]
**payment_method_categories** | [**\Swagger\Client\Model\PaymentMethodCategory[]**](PaymentMethodCategory.md) | Available payment method categories | [optional]
**purchase_country** | **string** | The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc. | [optional]
**purchase_currency** | **string** | The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc. | [optional]
**shipping_address** | [**\Swagger\Client\Model\Address**](Address.md) | | [optional]
**status** | **string** | The current status of the session. Possible values: &#x27;complete&#x27;, &#x27;incomplete&#x27; where &#x27;complete&#x27; is set when the order has been placed. | [optional]
**intent** | **string** | Intent for the session. The field is designed to let partners inform Klarna of the purpose of the customer’s session. | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
# Subscription
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | The name of the subscription product |
**interval** | **string** | The cadence unit for this. |
**interval_count** | **int** | The number of intervals |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_repo_base_url=$4
if [ "$git_user_id" = "" ]; then
git_user_id="git_user_id"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="git_repo_id"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
if [ "$git_repo_base_url" = "" ]; then
git_repo_base_url="https://github.com"
echo "[INFO] No command line input provided. Set \$git_repo_base_url to $git_repo_base_url"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git
else
git_repo_base_url=${git_repo_base_url#*//}
git_repo_base_url=${git_repo_base_url%%.*}
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
<?php
/**
* ApiException
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client;
use \Exception;
/**
* ApiException Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class ApiException extends Exception
{
/**
* The HTTP body of the server response either as Json or string.
*
* @var mixed
*/
protected $responseBody;
/**
* The HTTP header of the server response.
*
* @var string[]|null
*/
protected $responseHeaders;
/**
* The deserialized response object
*
* @var $responseObject;
*/
protected $responseObject;
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string[]|null $responseHeaders HTTP response header
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
$this->responseBody = $responseBody;
}
/**
* Gets the HTTP response header
*
* @return string[]|null HTTP response header
*/
public function getResponseHeaders()
{
return $this->responseHeaders;
}
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return mixed HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody()
{
return $this->responseBody;
}
/**
* Sets the deseralized response object (during deserialization)
*
* @param mixed $obj Deserialized response object
*
* @return void
*/
public function setResponseObject($obj)
{
$this->responseObject = $obj;
}
/**
* Gets the deseralized response object (during deserialization)
*
* @return mixed the deserialized response object
*/
public function getResponseObject()
{
return $this->responseObject;
}
}
<?php
/**
* Configuration
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client;
/**
* Configuration Class Doc Comment
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Configuration
{
private static $defaultConfiguration;
/**
* Associate array to store API key(s)
*
* @var string[]
*/
protected $apiKeys = [];
/**
* Associate array to store API prefix (e.g. Bearer)
*
* @var string[]
*/
protected $apiKeyPrefixes = [];
/**
* Access token for OAuth
*
* @var string
*/
protected $accessToken = '';
/**
* Username for HTTP basic authentication
*
* @var string
*/
protected $username = '';
/**
* Password for HTTP basic authentication
*
* @var string
*/
protected $password = '';
/**
* The host
*
* @var string
*/
protected $host = 'https://api.klarna.com';
/**
* User agent of the HTTP request, set to "PHP-Swagger" by default
*
* @var string
*/
protected $userAgent = 'Swagger-Codegen/1.0.0/php';
/**
* Debug switch (default set to false)
*
* @var bool
*/
protected $debug = false;
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected $debugFile = 'php://output';
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected $tempFolderPath;
/**
* Constructor
*/
public function __construct()
{
$this->tempFolderPath = sys_get_temp_dir();
}
/**
* Sets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $key API key or token
*
* @return $this
*/
public function setApiKey($apiKeyIdentifier, $key)
{
$this->apiKeys[$apiKeyIdentifier] = $key;
return $this;
}
/**
* Gets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return string API key or token
*/
public function getApiKey($apiKeyIdentifier)
{
return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
}
/**
* Sets the prefix for API key (e.g. Bearer)
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $prefix API key prefix, e.g. Bearer
*
* @return $this
*/
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
{
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
return $this;
}
/**
* Gets API key prefix
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return string
*/
public function getApiKeyPrefix($apiKeyIdentifier)
{
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
}
/**
* Sets the access token for OAuth
*
* @param string $accessToken Token for OAuth
*
* @return $this
*/
public function setAccessToken($accessToken)
{
$this->accessToken = $accessToken;
return $this;
}
/**
* Gets the access token for OAuth
*
* @return string Access token for OAuth
*/
public function getAccessToken()
{
return $this->accessToken;
}
/**
* Sets the username for HTTP basic authentication
*
* @param string $username Username for HTTP basic authentication
*
* @return $this
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* Gets the username for HTTP basic authentication
*
* @return string Username for HTTP basic authentication
*/
public function getUsername()
{
return $this->username;
}
/**
* Sets the password for HTTP basic authentication
*
* @param string $password Password for HTTP basic authentication
*
* @return $this
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Gets the password for HTTP basic authentication
*
* @return string Password for HTTP basic authentication
*/
public function getPassword()
{
return $this->password;
}
/**
* Sets the host
*
* @param string $host Host
*
* @return $this
*/
public function setHost($host)
{
$this->host = $host;
return $this;
}
/**
* Gets the host
*
* @return string Host
*/
public function getHost()
{
return $this->host;
}
/**
* Sets the user agent of the api client
*
* @param string $userAgent the user agent of the api client
*
* @throws \InvalidArgumentException
* @return $this
*/
public function setUserAgent($userAgent)
{
if (!is_string($userAgent)) {
throw new \InvalidArgumentException('User-agent must be a string.');
}
$this->userAgent = $userAgent;
return $this;
}
/**
* Gets the user agent of the api client
*
* @return string user agent
*/
public function getUserAgent()
{
return $this->userAgent;
}
/**
* Sets debug flag
*
* @param bool $debug Debug flag
*
* @return $this
*/
public function setDebug($debug)
{
$this->debug = $debug;
return $this;
}
/**
* Gets the debug flag
*
* @return bool
*/
public function getDebug()
{
return $this->debug;
}
/**
* Sets the debug file
*
* @param string $debugFile Debug file
*
* @return $this
*/
public function setDebugFile($debugFile)
{
$this->debugFile = $debugFile;
return $this;
}
/**
* Gets the debug file
*
* @return string
*/
public function getDebugFile()
{
return $this->debugFile;
}
/**
* Sets the temp folder path
*
* @param string $tempFolderPath Temp folder path
*
* @return $this
*/
public function setTempFolderPath($tempFolderPath)
{
$this->tempFolderPath = $tempFolderPath;
return $this;
}
/**
* Gets the temp folder path
*
* @return string Temp folder path
*/
public function getTempFolderPath()
{
return $this->tempFolderPath;
}
/**
* Gets the default configuration instance
*
* @return Configuration
*/
public static function getDefaultConfiguration()
{
if (self::$defaultConfiguration === null) {
self::$defaultConfiguration = new Configuration();
}
return self::$defaultConfiguration;
}
/**
* Sets the detault configuration instance
*
* @param Configuration $config An instance of the Configuration Object
*
* @return void
*/
public static function setDefaultConfiguration(Configuration $config)
{
self::$defaultConfiguration = $config;
}
/**
* Gets the essential information for debugging
*
* @return string The report for debugging
*/
public static function toDebugReport()
{
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;
}
/**
* Get API key (with prefix if set)
*
* @param string $apiKeyIdentifier name of apikey
*
* @return string API key with the prefix
*/
public function getApiKeyWithPrefix($apiKeyIdentifier)
{
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
$apiKey = $this->getApiKey($apiKeyIdentifier);
if ($apiKey === null) {
return null;
}
if ($prefix === null) {
$keyWithPrefix = $apiKey;
} else {
$keyWithPrefix = $prefix . ' ' . $apiKey;
}
return $keyWithPrefix;
}
}
<?php
/**
* ApiException
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client;
use \Exception;
/**
* ApiException Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class HeaderSelector
{
/**
* @param string[] $accept
* @param string[] $contentTypes
* @return array
*/
public function selectHeaders($accept, $contentTypes)
{
$headers = [];
$accept = $this->selectAcceptHeader($accept);
if ($accept !== null) {
$headers['Accept'] = $accept;
}
$headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes);
return $headers;
}
/**
* @param string[] $accept
* @return array
*/
public function selectHeadersForMultipart($accept)
{
$headers = $this->selectHeaders($accept, []);
unset($headers['Content-Type']);
return $headers;
}
/**
* Return the header 'Accept' based on an array of Accept provided
*
* @param string[] $accept Array of header
*
* @return string Accept (e.g. application/json)
*/
private function selectAcceptHeader($accept)
{
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
return null;
} elseif (preg_grep("/application\/json/i", $accept)) {
return 'application/json';
} else {
return implode(',', $accept);
}
}
/**
* Return the content type based on an array of content-type provided
*
* @param string[] $contentType Array fo content-type
*
* @return string Content-Type (e.g. application/json)
*/
private function selectContentTypeHeader($contentType)
{
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
return 'application/json';
} elseif (preg_grep("/application\/json/i", $contentType)) {
return 'application/json';
} else {
return implode(',', $contentType);
}
}
}
<?php
/**
* AssetUrls
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* AssetUrls Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class AssetUrls implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'asset_urls';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'descriptive' => 'string',
'standard' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'descriptive' => null,
'standard' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'descriptive' => 'descriptive',
'standard' => 'standard' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'descriptive' => 'setDescriptive',
'standard' => 'setStandard' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'descriptive' => 'getDescriptive',
'standard' => 'getStandard' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['descriptive'] = isset($data['descriptive']) ? $data['descriptive'] : null;
$this->container['standard'] = isset($data['standard']) ? $data['standard'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets descriptive
*
* @return string
*/
public function getDescriptive()
{
return $this->container['descriptive'];
}
/**
* Sets descriptive
*
* @param string $descriptive URL of the descriptive asset. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated.
*
* @return $this
*/
public function setDescriptive($descriptive)
{
$this->container['descriptive'] = $descriptive;
return $this;
}
/**
* Gets standard
*
* @return string
*/
public function getStandard()
{
return $this->container['standard'];
}
/**
* Sets standard
*
* @param string $standard URL of the standard asset. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated.
*
* @return $this
*/
public function setStandard($standard)
{
$this->container['standard'] = $standard;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
<?php
/**
* Attachment
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* Attachment Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Attachment implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'attachment';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'body' => 'string',
'content_type' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'body' => null,
'content_type' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'body' => 'body',
'content_type' => 'content_type' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'body' => 'setBody',
'content_type' => 'setContentType' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'body' => 'getBody',
'content_type' => 'getContentType' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['body'] = isset($data['body']) ? $data['body'] : null;
$this->container['content_type'] = isset($data['content_type']) ? $data['content_type'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if ($this->container['body'] === null) {
$invalidProperties[] = "'body' can't be null";
}
if ($this->container['content_type'] === null) {
$invalidProperties[] = "'content_type' can't be null";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets body
*
* @return string
*/
public function getBody()
{
return $this->container['body'];
}
/**
* Sets body
*
* @param string $body The content of the extra merchant data should be presented as a string inside this property. The body should be an object containing any of the keys and sub-objects described below serialized to JSON. More information on that object can be found [here](https://developers.klarna.com/api/#attachment-schema).
*
* @return $this
*/
public function setBody($body)
{
$this->container['body'] = $body;
return $this;
}
/**
* Gets content_type
*
* @return string
*/
public function getContentType()
{
return $this->container['content_type'];
}
/**
* Sets content_type
*
* @param string $content_type The content type of the body. It is usually represented as \"application/vnd.klarna.internal.emd-v2+json\"
*
* @return $this
*/
public function setContentType($content_type)
{
$this->container['content_type'] = $content_type;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
<?php
/**
* CustomerReadCreateToken
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* CustomerReadCreateToken Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class CustomerReadCreateToken implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'customer_read_create_token';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'date_of_birth' => 'string',
'gender' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'date_of_birth' => null,
'gender' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'date_of_birth' => 'date_of_birth',
'gender' => 'gender' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'date_of_birth' => 'setDateOfBirth',
'gender' => 'setGender' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'date_of_birth' => 'getDateOfBirth',
'gender' => 'getGender' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null;
$this->container['gender'] = isset($data['gender']) ? $data['gender'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets date_of_birth
*
* @return string
*/
public function getDateOfBirth()
{
return $this->container['date_of_birth'];
}
/**
* Sets date_of_birth
*
* @param string $date_of_birth Customer’s date of birth. The format is ‘yyyy-mm-dd’
*
* @return $this
*/
public function setDateOfBirth($date_of_birth)
{
$this->container['date_of_birth'] = $date_of_birth;
return $this;
}
/**
* Gets gender
*
* @return string
*/
public function getGender()
{
return $this->container['gender'];
}
/**
* Sets gender
*
* @param string $gender Customer’s gender - ‘male’ or ‘female’
*
* @return $this
*/
public function setGender($gender)
{
$this->container['gender'] = $gender;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
<?php
/**
* MerchantSession
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* MerchantSession Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class MerchantSession implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'merchant_session';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'client_token' => 'string',
'payment_method_categories' => '\Swagger\Client\Model\PaymentMethodCategory[]',
'session_id' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'client_token' => null,
'payment_method_categories' => null,
'session_id' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'client_token' => 'client_token',
'payment_method_categories' => 'payment_method_categories',
'session_id' => 'session_id' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'client_token' => 'setClientToken',
'payment_method_categories' => 'setPaymentMethodCategories',
'session_id' => 'setSessionId' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'client_token' => 'getClientToken',
'payment_method_categories' => 'getPaymentMethodCategories',
'session_id' => 'getSessionId' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['client_token'] = isset($data['client_token']) ? $data['client_token'] : null;
$this->container['payment_method_categories'] = isset($data['payment_method_categories']) ? $data['payment_method_categories'] : null;
$this->container['session_id'] = isset($data['session_id']) ? $data['session_id'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if ($this->container['client_token'] === null) {
$invalidProperties[] = "'client_token' can't be null";
}
if ($this->container['session_id'] === null) {
$invalidProperties[] = "'session_id' can't be null";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets client_token
*
* @return string
*/
public function getClientToken()
{
return $this->container['client_token'];
}
/**
* Sets client_token
*
* @param string $client_token Client token to be passed to the JS client while initializing the JS SDK in the next step.
*
* @return $this
*/
public function setClientToken($client_token)
{
$this->container['client_token'] = $client_token;
return $this;
}
/**
* Gets payment_method_categories
*
* @return \Swagger\Client\Model\PaymentMethodCategory[]
*/
public function getPaymentMethodCategories()
{
return $this->container['payment_method_categories'];
}
/**
* Sets payment_method_categories
*
* @param \Swagger\Client\Model\PaymentMethodCategory[] $payment_method_categories Available payment method categories for this particular session
*
* @return $this
*/
public function setPaymentMethodCategories($payment_method_categories)
{
$this->container['payment_method_categories'] = $payment_method_categories;
return $this;
}
/**
* Gets session_id
*
* @return string
*/
public function getSessionId()
{
return $this->container['session_id'];
}
/**
* Sets session_id
*
* @param string $session_id ID of the created session. Please use this ID to share with Klarna for identifying any issues during integration.
*
* @return $this
*/
public function setSessionId($session_id)
{
$this->container['session_id'] = $session_id;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
<?php
/**
* MerchantUrls
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* MerchantUrls Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class MerchantUrls implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'merchant_urls';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'confirmation' => 'string',
'notification' => 'string',
'push' => 'string',
'authorization' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'confirmation' => null,
'notification' => null,
'push' => null,
'authorization' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'confirmation' => 'confirmation',
'notification' => 'notification',
'push' => 'push',
'authorization' => 'authorization' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'confirmation' => 'setConfirmation',
'notification' => 'setNotification',
'push' => 'setPush',
'authorization' => 'setAuthorization' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'confirmation' => 'getConfirmation',
'notification' => 'getNotification',
'push' => 'getPush',
'authorization' => 'getAuthorization' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['confirmation'] = isset($data['confirmation']) ? $data['confirmation'] : null;
$this->container['notification'] = isset($data['notification']) ? $data['notification'] : null;
$this->container['push'] = isset($data['push']) ? $data['push'] : null;
$this->container['authorization'] = isset($data['authorization']) ? $data['authorization'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets confirmation
*
* @return string
*/
public function getConfirmation()
{
return $this->container['confirmation'];
}
/**
* Sets confirmation
*
* @param string $confirmation URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the consumer is sent to the redirect URL after placing the order. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL(max 2000 characters).
*
* @return $this
*/
public function setConfirmation($confirmation)
{
$this->container['confirmation'] = $confirmation;
return $this;
}
/**
* Gets notification
*
* @return string
*/
public function getNotification()
{
return $this->container['notification'];
}
/**
* Sets notification
*
* @param string $notification URL for notifications on pending orders. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL (max 2000 characters).
*
* @return $this
*/
public function setNotification($notification)
{
$this->container['notification'] = $notification;
return $this;
}
/**
* Gets push
*
* @return string
*/
public function getPush()
{
return $this->container['push'];
}
/**
* Sets push
*
* @param string $push URL that will be requested when an order is completed. Should be different than checkout and confirmation URLs. Insert {session.id} and/or {order.id} as placeholder to connect either of those IDs to the URL (max 2000 characters).
*
* @return $this
*/
public function setPush($push)
{
$this->container['push'] = $push;
return $this;
}
/**
* Gets authorization
*
* @return string
*/
public function getAuthorization()
{
return $this->container['authorization'];
}
/**
* Sets authorization
*
* @param string $authorization URL for receiving the authorization token when payment is completed. Used for Authorization Callback.
*
* @return $this
*/
public function setAuthorization($authorization)
{
$this->container['authorization'] = $authorization;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
<?php
/**
* ModelInterface
*
* PHP version 5
*
* @category Class
* @package Swagger\Client\Model
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
/**
* Interface abstracting model access.
*
* @package Swagger\Client\Model
* @author Swagger Codegen team
*/
interface ModelInterface
{
/**
* The original name of the model.
*
* @return string
*/
public function getModelName();
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes();
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats();
/**
* Array of attributes where the key is the local name, and the value is the original name
*
* @return array
*/
public static function attributeMap();
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters();
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters();
/**
* Show all the invalid properties with reasons.
*
* @return array
*/
public function listInvalidProperties();
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool
*/
public function valid();
}
<?php
/**
* PaymentMethodCategory
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Klarna Payments API V1
*
* The payments API is used to create a session to offer Klarna's payment methods as part of your checkout. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement). Read more on [Klarna payments](https://docs.klarna.com/klarna-payments/).
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.42
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* PaymentMethodCategory Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class PaymentMethodCategory implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'payment_method_category';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'asset_urls' => '\Swagger\Client\Model\AssetUrls',
'identifier' => 'string',
'name' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'asset_urls' => null,
'identifier' => null,
'name' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'asset_urls' => 'asset_urls',
'identifier' => 'identifier',
'name' => 'name' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'asset_urls' => 'setAssetUrls',
'identifier' => 'setIdentifier',
'name' => 'setName' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'asset_urls' => 'getAssetUrls',
'identifier' => 'getIdentifier',
'name' => 'getName' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['asset_urls'] = isset($data['asset_urls']) ? $data['asset_urls'] : null;
$this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null;
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets asset_urls
*
* @return \Swagger\Client\Model\AssetUrls
*/
public function getAssetUrls()
{
return $this->container['asset_urls'];
}
/**
* Sets asset_urls
*
* @param \Swagger\Client\Model\AssetUrls $asset_urls asset_urls
*
* @return $this
*/
public function setAssetUrls($asset_urls)
{
$this->container['asset_urls'] = $asset_urls;
return $this;
}
/**
* Gets identifier
*
* @return string
*/
public function getIdentifier()
{
return $this->container['identifier'];
}
/**
* Sets identifier
*
* @param string $identifier ID of the payment method category to be used while loading the widget later. The possible values are:<ul><li>klarna</li><li>pay_later</li><li>pay_now</li><li>pay_over_time</li><li>direct_bank_transfer</li><li>direct_debit</li></ul>
*
* @return $this
*/
public function setIdentifier($identifier)
{
$this->container['identifier'] = $identifier;
return $this;
}
/**
* Gets name
*
* @return string
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string $name Name of the payment method category. These names are dynamic depending on what payment method is in the category. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated, or any updates of included payment methods by you.
*
* @return $this
*/
public function setName($name)
{
$this->container['name'] = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment