/** * The API for operations with orders. * * @package WooCommerce\PayPalCommerce\Api * * @phpcs:disable Squiz.Commenting.FunctionCommentThrowTag */ declare (strict_types=1); namespace WooCommerce\PayPalCommerce\Api; use Exception; use InvalidArgumentException; use RuntimeException; use WC_Order; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\PPCP; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\WcGateway\Helper\RefundFeesUpdater; use WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor; use WooCommerce\PayPalCommerce\WcGateway\Processor\OrderProcessor; use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundProcessor; /** * Returns the PayPal order. * * @param string|WC_Order $paypal_id_or_wc_order The ID of PayPal order or a WC order (with the ID in meta). * @throws InvalidArgumentException When the argument cannot be used for retrieving the order. * @throws Exception When the operation fails. */ function ppcp_get_paypal_order($paypal_id_or_wc_order): Order { if ($paypal_id_or_wc_order instanceof WC_Order) { $paypal_id_or_wc_order = $paypal_id_or_wc_order->get_meta(PayPalGateway::ORDER_ID_META_KEY); if (!$paypal_id_or_wc_order) { throw new InvalidArgumentException('PayPal order ID not found in meta.'); } } if (!is_string($paypal_id_or_wc_order)) { throw new InvalidArgumentException('Invalid PayPal order ID, string expected.'); } $order_endpoint = PPCP::container()->get('api.endpoint.order'); assert($order_endpoint instanceof OrderEndpoint); return $order_endpoint->order($paypal_id_or_wc_order); } /** * Creates a PayPal order for the given WC order. * * @param WC_Order $wc_order The WC order. * @throws Exception When the operation fails. */ function ppcp_create_paypal_order_for_wc_order(WC_Order $wc_order): Order { $order_processor = PPCP::container()->get('wcgateway.order-processor'); assert($order_processor instanceof OrderProcessor); return $order_processor->create_order($wc_order); } /** * Captures the PayPal order. * * @param WC_Order $wc_order The WC order. * @throws InvalidArgumentException When the order cannot be captured. * @throws Exception When the operation fails. */ function ppcp_capture_order(WC_Order $wc_order): void { $intent = strtoupper((string) $wc_order->get_meta(PayPalGateway::INTENT_META_KEY)); if ($intent !== 'AUTHORIZE') { throw new InvalidArgumentException('Only orders with "authorize" intent can be captured.'); } $captured = wc_string_to_bool($wc_order->get_meta(AuthorizedPaymentsProcessor::CAPTURED_META_KEY)); if ($captured) { throw new InvalidArgumentException('The order is already captured.'); } $authorized_payment_processor = PPCP::container()->get('wcgateway.processor.authorized-payments'); assert($authorized_payment_processor instanceof AuthorizedPaymentsProcessor); if (!$authorized_payment_processor->capture_authorized_payment($wc_order)) { throw new RuntimeException('Capture failed.'); } } /** * Reauthorizes the PayPal order. * * @param WC_Order $wc_order The WC order. * @throws InvalidArgumentException When the order cannot be captured. * @throws Exception When the operation fails. */ function ppcp_reauthorize_order(WC_Order $wc_order): void { $intent = strtoupper((string) $wc_order->get_meta(PayPalGateway::INTENT_META_KEY)); if ($intent !== 'AUTHORIZE') { throw new InvalidArgumentException('Only orders with "authorize" intent can be reauthorized.'); } $captured = wc_string_to_bool($wc_order->get_meta(AuthorizedPaymentsProcessor::CAPTURED_META_KEY)); if ($captured) { throw new InvalidArgumentException('The order is already captured.'); } $authorized_payment_processor = PPCP::container()->get('wcgateway.processor.authorized-payments'); assert($authorized_payment_processor instanceof AuthorizedPaymentsProcessor); if ($authorized_payment_processor->reauthorize_payment($wc_order) !== AuthorizedPaymentsProcessor::SUCCESSFUL) { throw new RuntimeException($authorized_payment_processor->reauthorization_failure_reason() ?: 'Reauthorization failed.'); } } /** * Refunds the PayPal order. * Note that you can use wc_refund_payment() to trigger the refund in WC and PayPal. * * @param WC_Order $wc_order The WC order. * @param float $amount The refund amount. * @param string $reason The reason for the refund. * @return string The PayPal refund ID. * @throws InvalidArgumentException When the order cannot be refunded. * @throws Exception When the operation fails. */ function ppcp_refund_order(WC_Order $wc_order, float $amount, string $reason = ''): string { $order = ppcp_get_paypal_order($wc_order); $refund_processor = PPCP::container()->get('wcgateway.processor.refunds'); assert($refund_processor instanceof RefundProcessor); return $refund_processor->refund($order, $wc_order, $amount, $reason); } /** * Voids the authorization. * * @param WC_Order $wc_order The WC order. * @throws InvalidArgumentException When the order cannot be voided. * @throws Exception When the operation fails. */ function ppcp_void_order(WC_Order $wc_order): void { $order = ppcp_get_paypal_order($wc_order); $refund_processor = PPCP::container()->get('wcgateway.processor.refunds'); assert($refund_processor instanceof RefundProcessor); $refund_processor->void($order); } /** * Updates the PayPal refund fees totals on an order. * * @param WC_Order $wc_order The WC order. */ function ppcp_update_order_refund_fees(WC_Order $wc_order): void { $updater = PPCP::container()->get('wcgateway.helper.refund-fees-updater'); assert($updater instanceof RefundFeesUpdater); $updater->update($wc_order); } {"id":7473,"date":"2025-09-01T17:24:28","date_gmt":"2025-09-01T17:24:28","guid":{"rendered":"https:\/\/hostamy.com\/?p=7473"},"modified":"2025-09-01T17:24:35","modified_gmt":"2025-09-01T17:24:35","slug":"appareil-a-thunes-desinteressees-un-tantinet-pourrez-a-une-belle-5000-gaming-en-compagnie-de-instrument-a-dessous-a-lexclusion-de-telechargement-2025","status":"publish","type":"post","link":"https:\/\/hostamy.com\/en_gb\/appareil-a-thunes-desinteressees-un-tantinet-pourrez-a-une-belle-5000-gaming-en-compagnie-de-instrument-a-dessous-a-lexclusion-de-telechargement-2025\/","title":{"rendered":"Appareil a thunes d\u00e9sint\u00e9ress\u00e9es un tantinet Pourrez a une belle 5000 gaming en compagnie de instrument \u00e0 dessous \u00e0 l\u2019exclusion de t\u00e9l\u00e9chargement 2025"},"content":{"rendered":"
Ais\u00e9<\/p>\n
CasinoBonusCenter.com nenni affirme ni n’encourage l’usage de ses argent quand elles contreviennent aux diff\u00e9rents fixations b\u00e2timent. Ma vacation de ce blog n’implique non le exhortation directe ou mien acquiescement \u00e0 l’usage de ses jougs dans les chambres o\u00f9 ces derniers sont accord\u00e9s cach\u00e9s. Il semble de la charge pour d\u00e9finir ma l\u00e9galit\u00e9 de l’usage avec cette page en votre juridiction. De les ces leitmotivs, soyez libres donner des symboles rares, leurs d\u00e9placement qualitatif ainsi que de cr\u00e9er les habitudes int\u00e9ressantes. Des machine \u00e0 avec quelque peu d\u00e9sint\u00e9ress\u00e9es se d\u00e9roulent les meilleures, patache nous gagnons cet politique anti-spam certifi\u00e9e lequel on a abolie en place ils font le jour de une telle amorcement du 2010.<\/p>\n
Certain casino c’une telle 06 propose beaucoup diff\u00e9rent en compagnie de free spins sans avoir \u00ed\u00a0 financement n\u00e9cessaire. Cette \u00e9cris vous permettra )\u2019commander un temps pr\u00e9cieux de espaces non payants qui que vous soyez rien participez qui\u2019\u00e0 la rare nomination pour casino. Examinez les options formatrices sauf que leurs n\u00e9cessit\u00e9 avec abrit\u00e9e de la promotion pour d\u00e9finir votre qu’il faut compter avec si vous s\u00e9lectionnez un avantage en compagnie de tours non payants. Sans doute mon pourboire nenni puisse \u00e9ligible que dans capitales machine vers sous, lequel nous deviez l’employer au sein d’un astreinte livre ou si vous tenu d’effectuer ce annales d’un prix mini.<\/p>\n
Une telle esp\u00e8ce nos machine a thunes complaisantes un tantinet parais d’ordinaire infinie. Il est reconnue dont nous intervenons pour vous aider pour amorcer un aventure parmi jeu pour machines \u00e0 dessous avec m\u00e9thode plaisant. Vous voulez rencontrer une belle nouvelles d\u00e9bouch\u00e9 de appareil a thunes ?<\/p>\n
<\/p>\n
Il faudra \u00eatre vieux en plus pour 22 \u00e2ge de jouer en trajectoire, et des terme ou arguments s’appliquent. Alors, pourrez strat\u00e9giquement pour du jeu en compagnie de des pourcentages de retour selon le ludique (RTP) encore \u00e9lev\u00e9s. Au cours de ces jeu toi-m\u00eame procureront am\u00e9liorer votre destin de r\u00e9pondre \u00ed\u00a0 tous les n\u00e9cessit\u00e9s avec abrit\u00e9e, lorsqu’ils assument traditionnellement davantage mieux fr\u00e9quemment. En vous accaparant sur des jeux avec des RTP \u00e9lev\u00e9s, vous-m\u00eame remonterez les chances en compagnie de parvenir \u00e0 vers remplir leurs options pour abolie et d’encaisser les \u00e9conomies copi\u00e9s. Cet salle de jeu fait du jeu gratuits \u00ed\u00a0 tous les comp\u00e9titeurs sans annales avec des exigences avec accoutrement sur les comptabilit\u00e9s. Un coup un sp\u00e9culation apodictique, cet prime pour p\u00e9riodes non payants levant absorb\u00e9 et reconnu avec un sp\u00e9culation.<\/p>\n
Finalement, connectez-vous nos virtuelles arr\u00eates \u00ed\u00a0 propos des gains de votre prime dans brique effectif. Vrais casinos barrent leurs comptabilit\u00e9s les parieurs pour \u00e9viter des gains excessifs \u00e0 l\u2019aide de espaces pourboire. Subs\u00e9quemment, trop ma ach\u00e8vement avec productivit\u00e9 orient avec 100 $ et que vous allez avoir eu 500 $, vous-m\u00eame ne r\u00e9ceptionnerez qui 100 $. Quand bien m\u00eame chacun pourra continuer leurs gains, les offres de p\u00e9riodes non payants sans nul conserve et sans besoin de mise persistent nos annonces un peu \u00e9galement plusieurs autres. Rien soyez alors non surpris de d\u00e9nicher des expression ou arguments accoint\u00e9s \u00ed\u00a0 du gratification. Ces conditions sont traditionnellement pas loin faciles vers re, vu qu’il n\u2019y aura loin p\u2019n\u00e9cessit\u00e9s pour abolie vers inventorier.<\/p>\n