/** * 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":7133,"date":"2025-07-26T21:51:17","date_gmt":"2025-07-26T21:51:17","guid":{"rendered":"https:\/\/hostamy.com\/?p=7133"},"modified":"2025-07-26T21:51:17","modified_gmt":"2025-07-26T21:51:17","slug":"reward-roulette-enhance-your-online-online-casino-experience","status":"publish","type":"post","link":"https:\/\/hostamy.com\/en_gb\/reward-roulette-enhance-your-online-online-casino-experience\/","title":{"rendered":"Reward Roulette: Enhance Your Online Online Casino Experience"},"content":{"rendered":"
Are you an avid online gambling establishment gamer looking for an amazing game that supplies both the thrill of live roulette and the possibility to win additional incentives? Look no more than incentive live roulette! This unique variant of the timeless gambling establishment video game adds an additional layer of exhilaration and prospective profits to your gameplay. In this write-up, we will certainly explore the ins and outs of bonus offer live roulette, including its policies, approaches, and where to discover the best platforms to play. Get ready to take your online gambling establishment experience to the next degree!<\/p>\n
While typical live roulette is already an exciting video game, bonus live roulette takes it up a notch by introducing additional functions and incentives. The game adheres to the fundamental concepts of European or American roulette, with gamers betting on numbers, colors, and other feasible end results. Nonetheless, benefit roulette includes benefit ports or pockets to the wheel, offering gamers the chance to set off unique functions and win added prizes.<\/p>\n
These perk pockets can include multipliers, cost-free rotates, bonus offer rounds, and even dynamic prizes, depending on the details variation of the video game. By landing on among these perk pockets, players can take pleasure in improved payouts or added gameplay possibilities, making benefit roulette a thrilling and potentially extremely rewarding experience.<\/p>\n
While roulette is a game of chance, executing specific methods can help improve your possibilities of winning in perk live roulette. Below are a few suggestions to keep in mind:<\/p>\n
1.Understand the rules:<\/strong> Before starting to play, ensure you thoroughly recognize the guidelines and functions of the particular bonus offer roulette variant you choose. Knowing exactly how the perk pockets work and what incentives they provide will certainly aid you make notified choices and maximize your profits.<\/p>\n 2.Handle your bankroll:<\/strong> It’s vital to establish an allocate your gameplay and adhere to it. Identify just how much you are willing to spend and never ever exceed that quantity. This will help you stay clear of unneeded losses and ensure a much more pleasurable experience generally.<\/p>\n 3.Select the best variant:<\/strong> Different on the internet gambling establishments offer various bonus live roulette variations, each with its own collection of policies and functions. Make the effort to study and choose the variant that suits your choices and playing style the best. By doing this, you can optimize your possibilities of winning and have extra fun while playing.<\/p>\n 4.Practice with totally free versions:<\/strong> If you are new to benefit roulette or just intend to improve your abilities, search for on the internet casinos that supply free versions of the game. This allows you to familiarize yourself with the gameplay and examination out different methods without taking the chance of any type of real cash.<\/p>\n Now that you have a far better understanding of incentive live roulette and its strategies, you might be questioning where to discover the best systems to play. Right here are a few trusted online casino sites that provide incentive live roulette:<\/p>\n Reward roulette supplies an exhilarating twist to the conventional game, offering players with extra functions and possibilities to win big. By comprehending the guidelines, executing efficient methods, and playing on respectable systems, you can enhance your jet x casino<\/a> on the internet casino site experience and possibly win considerable benefits. Remember to constantly wager responsibly and enjoy checking out the amazing globe of benefit roulette!<\/p>\n Disclaimer:<\/strong> Gaming is a type of enjoyment and ought to be appreciated responsibly. While reward live roulette can use amazing incentives, there is always a risk of financial loss. Ensure to set limits for yourself and look for aid if you think your betting behaviors are becoming bothersome.<\/p>","protected":false},"excerpt":{"rendered":" Are you an avid online gambling establishment gamer looking for an amazing game that supplies both the thrill of live roulette and the possibility to win additional incentives? Look no more than incentive live roulette! This unique variant of the timeless gambling establishment video game adds an additional layer of exhilaration and prospective profits<\/p>","protected":false},"author":23,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-7133","post","type-post","status-publish","format-standard","hentry","category-uncategorized","pmpro-has-access"],"yoast_head":"\nWhere to Play Reward Roulette<\/h2>\n
\n
Final thought<\/h2>\n