From 3a6f3402702ba717a6307264395ae16b0220154b Mon Sep 17 00:00:00 2001 From: Jahn Nietzke Date: Mon, 4 Nov 2024 12:14:27 +0100 Subject: [PATCH] fix directcheckout --- src/Api/AppResourceApi.php | 86 ++++++++++++++++++++++++++------------ 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/src/Api/AppResourceApi.php b/src/Api/AppResourceApi.php index 0f3bf71..b85110f 100644 --- a/src/Api/AppResourceApi.php +++ b/src/Api/AppResourceApi.php @@ -693,19 +693,21 @@ public function chargeWalletRequest( * @param bool|null $validate This request parameter enables the validate (preview) case.<br/>The response will contain the link to a preview image of an internet stamp in PDF format. A product code, a layout format and optionally a motif are transferred to the service. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code, print format, or theme ID is invalid, the response to the caller will contain appropriate information. <br/><br/> For the validate (preview) case the 'Authorization' header is not required and the request body has to be of the specified type (See `#/components/schemas/AppShoppingCartPreviewPDFRequest`). (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPDFApp'] to see the possible values for this operation + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException * @return \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error401Response|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error429Response|\kruegge82\DPIM\Model\RequestStatus + *@throws InvalidArgumentException + * @throws ApiException on non-2xx response or if the response body is not in the expected format */ public function checkoutShoppingCartPDFApp( \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPDFApp'][0] ): \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse { - list($response) = $this->checkoutShoppingCartPDFAppWithHttpInfo($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $contentType); + list($response) = $this->checkoutShoppingCartPDFAppWithHttpInfo($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $directCheckout, $contentType); return $response; } @@ -718,19 +720,21 @@ public function checkoutShoppingCartPDFApp( * @param bool|null $validate This request parameter enables the validate (preview) case.<br/>The response will contain the link to a preview image of an internet stamp in PDF format. A product code, a layout format and optionally a motif are transferred to the service. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code, print format, or theme ID is invalid, the response to the caller will contain appropriate information. <br/><br/> For the validate (preview) case the 'Authorization' header is not required and the request body has to be of the specified type (See `#/components/schemas/AppShoppingCartPreviewPDFRequest`). (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPDFApp'] to see the possible values for this operation + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException * @return array of \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error401Response|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error429Response|\kruegge82\DPIM\Model\RequestStatus, HTTP status code, HTTP response headers (array of strings) + *@throws InvalidArgumentException + * @throws ApiException on non-2xx response or if the response body is not in the expected format */ public function checkoutShoppingCartPDFAppWithHttpInfo( - \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request, + $checkout_shopping_cart_pdf_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPDFApp'][0] ): array { - $request = $this->checkoutShoppingCartPDFAppRequest($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $contentType); + $request = $this->checkoutShoppingCartPDFAppRequest($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $directCheckout, $contentType); try { $options = $this->createHttpClientOption(); @@ -1024,19 +1028,21 @@ public function checkoutShoppingCartPDFAppWithHttpInfo( * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request (required) * @param bool|null $validate This request parameter enables the validate (preview) case.<br/>The response will contain the link to a preview image of an internet stamp in PDF format. A product code, a layout format and optionally a motif are transferred to the service. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code, print format, or theme ID is invalid, the response to the caller will contain appropriate information. <br/><br/> For the validate (preview) case the 'Authorization' header is not required and the request body has to be of the specified type (See `#/components/schemas/AppShoppingCartPreviewPDFRequest`). (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout =false This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPDFApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return PromiseInterface + *@throws InvalidArgumentException */ public function checkoutShoppingCartPDFAppAsync( \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPDFApp'][0] ): PromiseInterface { - return $this->checkoutShoppingCartPDFAppAsyncWithHttpInfo($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $contentType) + return $this->checkoutShoppingCartPDFAppAsyncWithHttpInfo($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $directCheckout, $contentType) ->then( function ($response) { return $response[0]; @@ -1052,20 +1058,22 @@ function ($response) { * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request (required) * @param bool|null $validate This request parameter enables the validate (preview) case.<br/>The response will contain the link to a preview image of an internet stamp in PDF format. A product code, a layout format and optionally a motif are transferred to the service. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code, print format, or theme ID is invalid, the response to the caller will contain appropriate information. <br/><br/> For the validate (preview) case the 'Authorization' header is not required and the request body has to be of the specified type (See `#/components/schemas/AppShoppingCartPreviewPDFRequest`). (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPDFApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return PromiseInterface + *@throws InvalidArgumentException */ public function checkoutShoppingCartPDFAppAsyncWithHttpInfo( $checkout_shopping_cart_pdf_app_request, $validate = false, $finalize = false, + $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPDFApp'][0] ): PromiseInterface { $returnType = '\kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse'; - $request = $this->checkoutShoppingCartPDFAppRequest($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $contentType); + $request = $this->checkoutShoppingCartPDFAppRequest($checkout_shopping_cart_pdf_app_request, $validate, $finalize, $directCheckout, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1109,15 +1117,17 @@ function ($exception) { * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPDFAppRequest $checkout_shopping_cart_pdf_app_request (required) * @param bool|null $validate This request parameter enables the validate (preview) case.<br/>The response will contain the link to a preview image of an internet stamp in PDF format. A product code, a layout format and optionally a motif are transferred to the service. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code, print format, or theme ID is invalid, the response to the caller will contain appropriate information. <br/><br/> For the validate (preview) case the 'Authorization' header is not required and the request body has to be of the specified type (See `#/components/schemas/AppShoppingCartPreviewPDFRequest`). (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPDFApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + *@throws InvalidArgumentException */ public function checkoutShoppingCartPDFAppRequest( $checkout_shopping_cart_pdf_app_request, $validate = false, $finalize = false, + $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPDFApp'][0] ): Request { @@ -1157,7 +1167,14 @@ public function checkoutShoppingCartPDFAppRequest( true, // explode false // required ) ?? []); - + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $directCheckout, + 'directCheckout', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -1234,19 +1251,21 @@ public function checkoutShoppingCartPDFAppRequest( * @param bool|null $validate The response will contain the link to a thumbnail image of an Internet brand in PNG format, which the third-party application must integrate accordingly. The print format is not relevant at this point. The service is given a product code, optionally a motif and a layout format. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code or theme ID is invalid, the response to the caller will contain appropriate information.<br/> For the validate (preview) case the 'Authorization' header is not required. (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation + * @param bool $directCheckout =false This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException * @return \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error401Response|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error429Response|\kruegge82\DPIM\Model\RequestStatus + *@throws InvalidArgumentException + * @throws ApiException on non-2xx response or if the response body is not in the expected format */ public function checkoutShoppingCartPNGApp( \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPNGApp'][0] ): \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse { - list($response) = $this->checkoutShoppingCartPNGAppWithHttpInfo($checkout_shopping_cart_png_app_request, $validate, $finalize, $contentType); + list($response) = $this->checkoutShoppingCartPNGAppWithHttpInfo($checkout_shopping_cart_png_app_request, $validate, $finalize, $directCheckout, $contentType); return $response; } @@ -1258,20 +1277,22 @@ public function checkoutShoppingCartPNGApp( * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request (required) * @param bool|null $validate The response will contain the link to a thumbnail image of an Internet brand in PNG format, which the third-party application must integrate accordingly. The print format is not relevant at this point. The service is given a product code, optionally a motif and a layout format. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code or theme ID is invalid, the response to the caller will contain appropriate information.<br/> For the validate (preview) case the 'Authorization' header is not required. (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation + * @param bool $directCheckout =false This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException * @return array of \kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error401Response|\kruegge82\DPIM\Model\RequestStatus|\kruegge82\DPIM\Model\Error429Response|\kruegge82\DPIM\Model\RequestStatus, HTTP status code, HTTP response headers (array of strings) + *@throws InvalidArgumentException + * @throws ApiException on non-2xx response or if the response body is not in the expected format */ public function checkoutShoppingCartPNGAppWithHttpInfo( \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPNGApp'][0] ): array { - $request = $this->checkoutShoppingCartPNGAppRequest($checkout_shopping_cart_png_app_request, $validate, $finalize, $contentType); + $request = $this->checkoutShoppingCartPNGAppRequest($checkout_shopping_cart_png_app_request, $validate, $finalize, $directCheckout, $contentType); try { $options = $this->createHttpClientOption(); @@ -1565,19 +1586,21 @@ public function checkoutShoppingCartPNGAppWithHttpInfo( * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request (required) * @param bool|null $validate The response will contain the link to a thumbnail image of an Internet brand in PNG format, which the third-party application must integrate accordingly. The print format is not relevant at this point. The service is given a product code, optionally a motif and a layout format. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code or theme ID is invalid, the response to the caller will contain appropriate information.<br/> For the validate (preview) case the 'Authorization' header is not required. (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return PromiseInterface + *@throws InvalidArgumentException */ public function checkoutShoppingCartPNGAppAsync( \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request, ?bool $validate = false, ?bool $finalize = false, + ?bool $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPNGApp'][0] ): PromiseInterface { - return $this->checkoutShoppingCartPNGAppAsyncWithHttpInfo($checkout_shopping_cart_png_app_request, $validate, $finalize, $contentType) + return $this->checkoutShoppingCartPNGAppAsyncWithHttpInfo($checkout_shopping_cart_png_app_request, $validate, $finalize, $directCheckout, $contentType) ->then( function ($response) { return $response[0]; @@ -1593,20 +1616,22 @@ function ($response) { * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request (required) * @param bool|null $validate The response will contain the link to a thumbnail image of an Internet brand in PNG format, which the third-party application must integrate accordingly. The print format is not relevant at this point. The service is given a product code, optionally a motif and a layout format. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code or theme ID is invalid, the response to the caller will contain appropriate information.<br/> For the validate (preview) case the 'Authorization' header is not required. (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return PromiseInterface + *@throws InvalidArgumentException */ public function checkoutShoppingCartPNGAppAsyncWithHttpInfo( $checkout_shopping_cart_png_app_request, $validate = false, $finalize = false, + $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPNGApp'][0] ): PromiseInterface { $returnType = '\kruegge82\DPIM\Model\CheckoutShoppingCartAppResponse'; - $request = $this->checkoutShoppingCartPNGAppRequest($checkout_shopping_cart_png_app_request, $validate, $finalize, $contentType); + $request = $this->checkoutShoppingCartPNGAppRequest($checkout_shopping_cart_png_app_request, $validate, $finalize, $directCheckout, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1650,15 +1675,17 @@ function ($exception) { * @param \kruegge82\DPIM\Model\CheckoutShoppingCartPNGAppRequest $checkout_shopping_cart_png_app_request (required) * @param bool|null $validate The response will contain the link to a thumbnail image of an Internet brand in PNG format, which the third-party application must integrate accordingly. The print format is not relevant at this point. The service is given a product code, optionally a motif and a layout format. This information is encoded in the link and evaluated by INTERNETMARKE when the preview image is rendered. If the product code or theme ID is invalid, the response to the caller will contain appropriate information.<br/> For the validate (preview) case the 'Authorization' header is not required. (optional, default to false) * @param bool|null $finalize This request parameter enables the direct finalization of the shopping cart and an extra finalization request is not required. (optional, default to false) + * @param bool $directCheckout This request parameter enables the direct checkout of the shopping cart and an extra finalization request is not required. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkoutShoppingCartPNGApp'] to see the possible values for this operation * - * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + *@throws InvalidArgumentException */ public function checkoutShoppingCartPNGAppRequest( $checkout_shopping_cart_png_app_request, $validate = false, $finalize = false, + $directCheckout = false, string $contentType = self::contentTypes['checkoutShoppingCartPNGApp'][0] ): Request { @@ -1698,7 +1725,14 @@ public function checkoutShoppingCartPNGAppRequest( true, // explode false // required ) ?? []); - + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $directCheckout, + 'directCheckout', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []);