# better-payment/trunk/includes/Blocks/ThirdPartyIntegration.php

Better Payment – Instant Payments, Donations, Fundraising with Subscriptions &amp; More, version trunk. 46 lines.

- Page: https://pluginprobe.com/plugins/better-payment/trunk/code/includes/Blocks/ThirdPartyIntegration.php
- Raw: https://pluginprobe.com/plugins/better-payment/trunk/raw/includes/Blocks/ThirdPartyIntegration.php
- Modified: 2026-04-21T06:11:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/better-payment/trunk/code/includes/Blocks/ThirdPartyIntegration.php#L10-L20`.

```php
<?php

namespace Better_Payment\Lite\Blocks;

use Better_Payment\Lite\Blocks\Settings as Settings;
use Better_Payment\Lite\Traits\HasSingletone as HasSingletone;

abstract class ThirdPartyIntegration {
	use HasSingletone;

	/**
	 * Returns concat URL with the endpoint and version.
	 *
	 * @param string $endpoint
	 * @param string $version
	 * @return string
	 */
	protected function url( $endpoint, $version = 'v1/' ) {
		return static::URL . $version . $endpoint;
	}

	public static function is_isset( $value, $default = '' ) {
		return isset( $_POST[ $value ] ) ? sanitize_text_field( $_POST[ $value ] ) : $default;
	}

	public function settings() {
		return Settings::get_instance();
	}

	public function add_ajax( array $actions = array() ) {
		if ( ! empty( $actions ) ) {
			foreach ( $actions as $action => $method ) {
				if ( is_string( $method ) ) {
					add_action( "wp_ajax_$action", array( $this, $method ) );
					add_action( "wp_ajax_nopriv_$action", array( $this, $method ) );
				} else {
					add_action( "wp_ajax_$action", array( $this, $method['callback'] ) );
					if ( isset( $method['public'] ) && $method['public'] == true ) {
						add_action( "wp_ajax_nopriv_$action", array( $this, $method['callback'] ) );
					}
				}
			}
		}
	}
}

```
