Operation deleteFreeShippingCouponByIdAsyncWithHttpInfo

Delete FreeShippingCoupon

@param  string $free_shipping_coupon_id ID of freeShippingCoupon to delete. (required)

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
352823
protected static function deleteFreeShippingCouponByIdAsyncWithHttpInfo($free_shipping_coupon_id) 
    {
        $returnType = '';  
        $request = self::deleteFreeShippingCouponByIdRequest($free_shipping_coupon_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
347516
public function dispatchOrderCouponOnApplyEvent(
        OrderInterface $cart,
        CouponInterface $coupon
    ) {
        $event = new OrderCouponOnApplyEvent(
            $cart,
            $coupon
        );

        $this->eventDispatcher->dispatch(
            ElcodiCartCouponEvents::ORDER_COUPON_ONAPPLY,
            $event
        );
    }
993542
protected static function deleteTransactionByIdAsyncWithHttpInfo($transaction_id) 
    {
        $returnType = '';  
        $request = self::deleteTransactionByIdRequest($transaction_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
236143
public function delete($id)
    {
        $response = false;
        if (empty($id)) {
            throw new \InvalidArgumentException('ID Product cannot be empty');
        }

        try {
            $apiResponse = $this->client->delete("{$this->uriImport}product/{$id}", [
                'query' => [
                    'key' => $this->config['data']['key'],
                ],
            ]);

            $apiResponse = json_decode($apiResponse->getBody(), true);

            if (isset($apiResponse['affected']) && $apiResponse['affected'] > 0) {
                $response = true;
            }
        } catch (ClientException $e) {
            $response = false;
        }

        return $response;
    }
683341
public function actionDeleteProduct($id)
    {
        if (($model = OrderProduct::findOne($id)) !== null) {
            $model->delete();
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $this->redirect(\Yii::$app->request->referrer);
    }
1152270
public function create()
    {
        $instance = self::createFreeShippingCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
740219
protected static function deleteFreeItemCouponByIdAsyncWithHttpInfo($free_item_coupon_id) 
    {
        $returnType = '';  
        $request = self::deleteFreeItemCouponByIdRequest($free_item_coupon_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
375678
public function removeContact($contact_id = null, $id = null)
    {
        if (is_null($contact_id) || is_null($id)) {
            throw new InvalidArgumentException('Null Contact or Group id.');
        }
        $ResourceName = $this->resourceName . ($id ? '/' . $id . '/contacts/' . $contact_id : null);

        list($responseStatus, , $responseBody) = $this->HttpClient->performHttpRequest(
            Common\HttpClient::REQUEST_DELETE,
            $ResourceName
        );
        if ($responseStatus !== Common\HttpClient::HTTP_NO_CONTENT) {
            return json_decode($responseBody);
        }
    }
671472
protected static function deletePaymentCardByIdAsyncWithHttpInfo($payment_card_id) 
    {
        $returnType = '';  
        $request = self::deletePaymentCardByIdRequest($payment_card_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1263441
public function delete($orderId, $fulfillmentId, FulfillmentEvent $fulfillmentEvent)
    {
        $endpoint = '/admin/orders/'.$orderId.'/fulfillments/'.$fulfillmentId.'/events/'.$fulfillmentEvent->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
        return;
    }
663207
protected static function deleteDiscountPromotionByIdAsyncWithHttpInfo($discount_promotion_id) 
    {
        $returnType = '';  
        $request = self::deleteDiscountPromotionByIdRequest($discount_promotion_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1083295
@Override
	public com.liferay.commerce.model.CommerceShippingMethod deleteCommerceShippingMethod(
		com.liferay.commerce.model.CommerceShippingMethod commerceShippingMethod)
		throws com.liferay.portal.kernel.exception.PortalException {
		return _commerceShippingMethodLocalService.deleteCommerceShippingMethod(commerceShippingMethod);
	}
209697
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceShippingMethod commerceShippingMethod : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceShippingMethod);
		}
	}
802606
public function removeAmastyGiftCard($codeId, $quote)
    {
        if (! $this->isAmastyGiftCardAvailable()) {
            return;
        }
        $connection = $this->resource->getConnection();
        try {
            $giftCardTable = $this->resource->getTableName('amasty_amgiftcard_quote');

            $sql = "DELETE FROM {$giftCardTable} WHERE code_id = :code_id AND quote_id = :quote_id";
            $connection->query($sql, ['code_id' => $codeId, 'quote_id' => $quote->getId()]);

            $this->updateTotals($quote);
        } catch (\Zend_Db_Statement_Exception $e) {
            $this->bugsnag->notifyException($e);
        }
    }
947611
public function removeCoupon(string $subscriptionId)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Removing Coupons from $subscriptionId");

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/deleteCoupon',
                ['subscriptionId' => $subscriptionId]
            )
        );
    }
88568
public function deleteOrder($transaction_id)
    {
        $response = $this->client->delete('transactions/orders/' . $transaction_id);
        return json_decode($response->getBody())->order;
    }
1372254
private function createNShippingDeleteForm(NewsletterShipping $nshipping)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('coreextra_newsletter_deleteshipping', array('id' => $nshipping->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }