settings = $settings; } public function is_configured(): bool { return '' !== $this->get_secret_key(); } public function get_mode(): string { return $this->settings->get_stripe_mode(); } public function get_secret_key(): string { return $this->settings->get_stripe_secret_key(); } public function get_publishable_key(): string { return $this->settings->get_stripe_publishable_key(); } public function get_webhook_secret(): string { return $this->settings->get_stripe_webhook_secret(); } public function get_price_cents(): int { return (int) round( (float) $this->settings->get_default_price() * 100 ); } public function get_currency(): string { return strtolower( Constants::DEFAULT_CURRENCY ); } public function get_checkout_action_url(): string { return admin_url( 'admin-post.php' ); } public function get_success_url( int $article_id ): string { return add_query_arg( array( 'articlevault_payment' => 'success', 'session_id' => '{CHECKOUT_SESSION_ID}', ), get_permalink( $article_id ) ); } public function get_cancel_url( int $article_id ): string { return add_query_arg( array( 'articlevault_payment' => 'cancelled', ), get_permalink( $article_id ) ); } public function get_webhook_url(): string { return home_url( '/?' . Constants::STRIPE_WEBHOOK_QUERY_VAR . '=1' ); } }