Created
July 12, 2019 13:44
-
-
Save ashleyfae/b329f107ded1fb9c730e4f5dead5e8ba to your computer and use it in GitHub Desktop.
RCP custom payment gateway - init() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 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'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment