Skip to content

Instantly share code, notes, and snippets.

@ashleyfae
Created July 12, 2019 13:44
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/b329f107ded1fb9c730e4f5dead5e8ba to your computer and use it in GitHub Desktop.
Save ashleyfae/b329f107ded1fb9c730e4f5dead5e8ba to your computer and use it in GitHub Desktop.
RCP custom payment gateway - init() method
<?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