Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleyfae/12f008b5080fc5eea522e338b59396d6 to your computer and use it in GitHub Desktop.
Save ashleyfae/12f008b5080fc5eea522e338b59396d6 to your computer and use it in GitHub Desktop.
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