/** * 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":7045,"date":"2025-06-19T01:52:32","date_gmt":"2025-06-19T01:52:32","guid":{"rendered":"https:\/\/hostamy.com\/?p=7045"},"modified":"2025-06-19T01:52:32","modified_gmt":"2025-06-19T01:52:32","slug":"7045-2","status":"publish","type":"post","link":"https:\/\/hostamy.com\/en_gb\/7045-2\/","title":{"rendered":""},"content":{"rendered":"
Online slots are a very popular game that attracts a wide crowd. The result of a slot game is entirely dependent on luck and doesn’t require any sort of strategy. This makes it attractive to a greater number of people. Some of these machines pay as much as ten thousand times your line bet which is an irresistible lure. You can play a slot machine online from the comfort of your home, your mobile device or on the move.\n<\/p>\n
When you play slot machines online, you can always select different variations of the identical game. Many online casinos let players play for free, but you can also play with real money. This is a good way to test different online casinos. This will let you see the games available and let you know whether it’s worth the time. Be sure to verify the payout percentages first. It’s better to be safe than regret, especially when it concerns your bank account.\n<\/p>\n
While playing slot machine games online, you must make sure to take necessary precautions. You must keep an eye on your account and report suspicious activities. You can also file anonymous complaints with the player protection agency if you get frustrated playing online casino. Your identity is secure and your account is safe. You can keep all the winnings in the event of a win without having to worry about losing any.\n<\/p>\n
While playing online slot machines, you should also be aware of any activity going on within your account. You should also be aware of your account’s activity. If you are unhappy with any online casino you should declare it anonymously to stop other players from stealing your identity. You can secure your identity by making the report anonymously so that you can prevent others from gaining access to your account. You shouldn’t play for real money. It is not a good idea to waste your time at a casino if you are bored.\n<\/p>\n
You must ensure that your account is safe. Be aware of any potential fraudulent activity. You should be aware of how to play online slots since gambling can be risky. A lot of these games are dependent on luck, therefore you should pick the game that suits your personality. You should look for hidden features in case you lose money playing one particular slot.\n<\/p>\n
If you prefer to play online slots, you must look for websites that allow you to wager on all the lines. You should wager on all lines if you want to win big. If you’re just beginning, you should not play on all lines since this will impact the payout. Use the “small ball theory” to increase your chances vulkan casino<\/a> of winning. You can find the top online casino sites.\n<\/p>\n The best method to play online slot machines is to join an online casino. This will save you time and money. If you’re a new player, you can also check out the website’s reviews before you begin playing. The review site can assist you in choosing the best casino. You can also look over the advantages of online slots before playing with real money. Make sure you choose the best slot machine for you.\n<\/p>\n In addition to these alternatives, you can locate a slot machine that has multipliers. Multipliers can be used to increase your winnings depending on the casino. The greater the number of multipliers a slot machine has, the higher the payout. The more multipliers, the better, because it could lead to higher stakes and winnings. This kind of multiplier can significantly boost the winnings of a player, and the more you win, the greater your odds of winning.\n<\/p>\n There are many things to think about before you play a online slots. There are many well-known slot machines however, you must be cautious of scams. Like any casino it is essential to be aware of the casino’s reputation. It’s worth it to spend your money and time choosing an honest casino. Once you’ve determined which game you like, it’s time to test it. Remember, the aim of the machine is to win, but you should be sportcash lonaci sportcash programme<\/a> aware the fact that every game is different and has a unique winning combination.<\/p>","protected":false},"excerpt":{"rendered":" How to Play a Slot Machine online Online slots are a very popular game that attracts a wide crowd. The result of a slot game is entirely dependent on luck and doesn’t require any sort of strategy. This makes it attractive to a greater number of people. Some of these machines pay as much as […]<\/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-7045","post","type-post","status-publish","format-standard","hentry","category-uncategorized","pmpro-has-access"],"yoast_head":"\n