HEX
Server: nginx/1.24.0
System: Linux ip-172-31-22-109 6.17.0-1012-aws #12~24.04.1-Ubuntu SMP Mon Apr 6 17:36:28 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /home/ubuntu/public/wp-content/plugins/woocommerce-xpay-plugin/check_transaction.php
<?php

define( 'WP_USE_THEMES', false ); // Don't load theme support functionality
require( '../../../wp-load.php' );



$uuid = $_REQUEST["trn_uuid"];
$community_id  = $_REQUEST["community_id"];
$order_id  = $_REQUEST["order_id"];
$wc_settings = new WC_Gateway_Xpay;
$url = $wc_settings->get_option("iframe_base_url"). "/api/v1/communities/".$community_id."/transactions/".$uuid."/";
$resp = httpGet($url, $wc_settings->get_option("payment_api_key"));
$resp = json_decode($resp, TRUE);
$order = wc_get_order( $order_id );
if ($resp["data"]["status"] == "SUCCESSFUL"){
    $order->update_status( 'completed', __( 'Awaiting approval', 'wc-gateway-xpay' ) );
}
echo ($resp["data"]["status"]);