/** * 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":7213,"date":"2025-07-31T10:28:33","date_gmt":"2025-07-31T10:28:33","guid":{"rendered":"https:\/\/hostamy.com\/?p=7213"},"modified":"2025-07-31T10:28:33","modified_gmt":"2025-07-31T10:28:33","slug":"the-enjoyment-and-excitement-of-online-gambling-enterprise-gamings","status":"publish","type":"post","link":"https:\/\/hostamy.com\/en_gb\/the-enjoyment-and-excitement-of-online-gambling-enterprise-gamings\/","title":{"rendered":"The Enjoyment and Excitement of Online Gambling Enterprise Gamings"},"content":{"rendered":"
Online gambling enterprise games have actually come to be significantly popular in recent times, providing players the possibility to experience the enjoyment and adventure of gambling from the comfort of their very own homes. With a wide plataforma gbet<\/a> range of video games available, from slots and table games to live dealer choices, online gambling enterprises satisfy all sorts of players, whether they casino 33 como registrarse<\/a> are novices or skilled gamblers. In this post, we will certainly check out the globe of on-line casino video games, the advantages they offer, and exactly how to select the appropriate system to improve your video gaming experience.<\/p>\n There are several benefits to playing online casino games online. One of one of the most substantial benefits is ease. Unlike conventional brick-and-mortar casinos, online systems come 24\/7, enabling players to gamble any time that suits them. This flexibility makes online gambling establishments suitable for those with active timetables or for gamers that like the convenience of their own homes.<\/p>\n Additionally, on the internet casino site video games provide a wide variety of options. Whether you prefer traditional table video games such as blackjack or live roulette, or you are a follower of the most recent video ports with immersive graphics and exciting attributes, there is a video game to fit every taste. On the internet gambling enterprises also supply the chance to attempt ready cost-free before playing with real money, enabling players to familiarize themselves with the policies and strategies before risking their own funds.<\/p>\n Another advantage of on-line gambling establishments is the capacity for profitable benefits and promotions. Numerous platforms supply welcome bonuses, complimentary spins, and commitment programs to bring in and maintain players. These offers can significantly boost your bankroll and offer added chances to win. It is necessary to check out the terms of these bonus offers to understand the wagering needs and any type of constraints.<\/p>\n When choosing an on the internet gambling establishment to play your favorite video games, it is necessary to think about a number of factors to guarantee a risk-free and delightful experience. Firstly, you should check the gambling establishment’s licensing and laws. Trusted on-line casino sites operate under a valid permit provided by an identified regulatory authority, making certain fair play and the defense of players’ funds.<\/p>\n It’s additionally essential to assess the video game selection and software program suppliers. Developed on-line gambling establishments team up with leading software application programmers to use a diverse variety of top notch games. Popular companies include Microgaming, NetEnt, Playtech, and Development Pc gaming for online dealership games.<\/p>\n Furthermore, settlement alternatives are another essential element to think about. Trustworthy on-line gambling enterprises provide a selection of safe and hassle-free banking techniques, including credit\/debit cards, e-wallets, and financial institution transfers. In addition, they prioritize quick and problem-free withdrawals, permitting gamers to enjoy their earnings without unneeded hold-ups.<\/p>\n Client assistance is an additional crucial aspect to consider. A trustworthy online casino should supply punctual and practical customer service using numerous channels, such as real-time conversation, email, or telephone. Effective support makes certain that any type of issues or questions are fixed promptly, boosting the total gaming experience.<\/p>\n While on-line casino site games can be enjoyable and satisfying, it is essential to approach gaming responsibly. Establish a budget plan and stay with it, never ever wagering greater than you can manage to shed. It’s additionally vital to take normal breaks and prevent chasing losses. Gambling ought to be viewed as a form of enjoyment and not a means to make money.<\/p>\n On-line gambling enterprise games provide a convenient and thrilling means to enjoy wagering from the convenience of your very own home. With a wide option of games, rewarding perks, and the possibility of big wins, on the internet gambling establishments offer endless enjoyment for players of all degrees of experience. By choosing a trusted platform and exercising liable betting, you can improve your pc gaming experience and maximize this interesting globe of online gambling establishment games.<\/p>\n Bear in mind to have fun, stay within your spending plan, and wager responsibly!<\/p>","protected":false},"excerpt":{"rendered":" Online gambling enterprise games have actually come to be significantly popular in recent times, providing players the possibility to experience the enjoyment and adventure of gambling from the comfort of their very own homes. With a wide plataforma gbet range of video games available, from slots and table games to<\/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-7213","post","type-post","status-publish","format-standard","hentry","category-uncategorized","pmpro-has-access"],"yoast_head":"\nBenefits of Playing Online Online Casino Gamings<\/h2>\n
\n
Choosing the Right Online Casino Site<\/h2>\n
Liable Gaming<\/h2>\n
\n
Final thought<\/h3>\n