private function __construct() { self::do_not_cache(); // never cache the checkout pages $this->load_cache(); $this->load_invoice(); $this->payment_processor = SI_Payment_Processors::get_payment_processor(); $this->load_pages(); $this->handle_action(isset($_REQUEST[self::CHECKOUT_ACTION]) ? $_REQUEST[self::CHECKOUT_ACTION] : ''); }
/** * Cancel a recurring payment * * @return void */ public function cancel() { if ($this->get_status() == self::STATUS_RECURRING) { do_action('sa_cancelling_recurring_payment', $this); // cancel the actual payment $payment_processor = SI_Payment_Processors::get_payment_processor(); $payment_processor->cancel_recurring_payment($this); $this->set_status(self::STATUS_CANCELLED); // notify plugins that this has been cancelled $purchase_id = $this->get_purchase(); do_action('sa_recurring_payment_cancelled', $this, $purchase_id); } }
/** * The payment link for invoices * @param integer $id * @param string $type * @return string */ function si_get_payment_link($id = 0, $type = '') { if (!$id) { $id = get_the_ID(); } if ($type == '') { $processor = SI_Payment_Processors::get_payment_processor(); $type = $processor->get_slug(); } $url = add_query_arg(array(SI_Checkouts::CHECKOUT_QUERY_VAR => $type, 'nonce' => wp_create_nonce(SI_Controller::NONCE)), si_get_payment_url($id)); return apply_filters('si_get_payment_link', esc_url_raw($url), $id, $type); }
/** * The payment link for invoices * @param integer $id * @param string $type * @return string */ function si_get_payment_link($id = 0, $type = '') { if (!$id) { global $post; $id = $post->ID; } if ($type == '') { $processor = SI_Payment_Processors::get_payment_processor(); $type = $processor->get_slug(); } $url = add_query_arg(array(SI_Checkouts::CHECKOUT_QUERY_VAR => $type, 'nonce' => wp_create_nonce(SI_Controller::NONCE)), si_get_payment_url($id)); return esc_url_raw($url); }