RCP custom payment gateway WIP
<?php | |
/** | |
* Authorize.net Payment Gateway | |
* | |
* @package rcp-authorize-net | |
* @copyright Copyright (c) 2019, Restrict Content Pro team | |
* @license GPL2+ | |
* @since 1.0 | |
*/ | |
namespace RCP\Anet; | |
use DateTime; | |
use Exception; | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
class Payment_Gateway extends \RCP_Payment_Gateway { | |
/** | |
* @since 1.0 | |
* @var string | |
* @access private | |
*/ | |
private $api_login_id; | |
/** | |
* @since 1.0 | |
* @var string | |
* @access private | |
*/ | |
private $transaction_key; | |
/** | |
* @since 1.0 | |
* @var string | |
* @access private | |
*/ | |
private $transaction_signature; | |
/** | |
* Get things going | |
* | |
* @access public | |
* @since 1.0 | |
* @return void | |
*/ | |
public function init() { | |
global $rcp_options; | |
$this->supports[] = 'one-time'; | |
$this->supports[] = 'recurring'; | |
$this->supports[] = 'fees'; | |
$this->supports[] = 'trial'; | |
if ( $this->test_mode ) { | |
$this->api_login_id = isset( $rcp_options['authorize_test_api_login'] ) ? sanitize_text_field( $rcp_options['authorize_test_api_login'] ) : ''; | |
$this->transaction_key = isset( $rcp_options['authorize_test_txn_key'] ) ? sanitize_text_field( $rcp_options['authorize_test_txn_key'] ) : ''; | |
$this->transaction_signature = isset( $rcp_options['authorize_test_signature_key'] ) ? sanitize_text_field( $rcp_options['authorize_test_signature_key'] ) : ''; | |
} else { | |
$this->api_login_id = isset( $rcp_options['authorize_api_login'] ) ? sanitize_text_field( $rcp_options['authorize_api_login'] ) : ''; | |
$this->transaction_key = isset( $rcp_options['authorize_txn_key'] ) ? sanitize_text_field( $rcp_options['authorize_txn_key'] ) : ''; | |
$this->transaction_signature = isset( $rcp_options['authorize_signature_key'] ) ? sanitize_text_field( $rcp_options['authorize_signature_key'] ) : ''; | |
} | |
require_once RCP_ANET_PATH . 'vendor/autoload.php'; | |
} | |
/** | |
* Process registration | |
* | |
* @access public | |
* @since 1.0 | |
* @return void | |
*/ | |
public function process_signup() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment