コード例 #1
0
<?php

require_once dirname(__FILE__) . '/../../../../vendor/braintree/braintree_php/lib/Braintree.php';
Braintree\Configuration::environment('production');
Braintree\Configuration::merchantId('n548vrvhgb7ff3jm');
Braintree\Configuration::publicKey('t639rjppfmt8ncmn');
Braintree\Configuration::privateKey('0b1344f7ceb652389173603af7b682c1');
//define('SUBSCRIPTION_PLAN_ID', 'cwn6');
define('SUBSCRIPTION_PLAN_ID', '5tpb');
// Braintree\Configuration::environment('sandbox');
// Braintree\Configuration::merchantId('n887h3wthpjvcqjh');
// Braintree\Configuration::publicKey('dvjrk8sy53mmq2p5');
// Braintree\Configuration::privateKey('3eefe6e70118b8bf1912e6b438fab9c8');
// define('SUBSCRIPTION_PLAN_ID', 'm2gm');
/* The function that creates the HTML on the front-end, based on the parameters
* supplied in the product-catalog shortcode */
function Insert_Subscribe_Now($atts)
{
    /** @var string $redirect_page
     * @var string $login_page
     * @var string $Time
     * @var string $Salt
     * @var string $omit_fields
     */
    // Include the required global variables, and create a few new ones
    global $wpdb, $user_message, $feup_success;
    global $ewd_feup_fields_table_name, $ewd_feup_user_table_name, $ewd_feup_user_fields_table_name;
    $CheckCookie = CheckLoginCookie();
    $Sql = "SELECT * FROM wp_ewd_feup_fields WHERE Field_Show_In_Front_End='Yes' ORDER BY `Field_Order` ASC";
    $Fields = $wpdb->get_results($Sql);
    $User = $wpdb->get_row($wpdb->prepare("SELECT * FROM wp_ewd_feup_users WHERE Username='******'", $CheckCookie['Username']));
コード例 #2
0
<?php

session_start();
require_once "../vendor/autoload.php";
if (file_exists(__DIR__ . "/../.env")) {
    $dotenv = new Dotenv\Dotenv(__DIR__ . "/../");
    $dotenv->load();
}
Braintree\Configuration::environment(getenv('BT_ENVIRONMENT'));
Braintree\Configuration::merchantId(getenv('BT_MERCHANT_ID'));
Braintree\Configuration::publicKey(getenv('BT_PUBLIC_KEY'));
Braintree\Configuration::privateKey(getenv('BT_PRIVATE_KEY'));