<commit_before><?php
require_once('./lib/Stripe.php');
require_once('./config.php');

Stripe::setApiKey($config['stripe_sk']);


if (isset($_POST['token'])) {
    $token  = $_POST['token'];
    $amount = $_POST['amount'];

    // Create the charge on Stripe's servers - this will charge the user's card
    try {
        $charge = Stripe_Charge::create(array(
            'amount' => $amount,
            'currency' => 'usd',
            'card' => $token,
            'description' => 'elementary OS download')
        );
        echo 'OK';
    } catch(Stripe_CardError $e) {
        echo 'error';
    }
} else { 
    echo $config['stripe_pk'];
}<commit_msg>Add cookie set to payment.php<commit_after><?php
require_once('./lib/Stripe.php');
require_once('./config.php');

Stripe::setApiKey($config['stripe_sk']);


if (isset($_POST['token'])) {
    $token  = $_POST['token'];
    $amount = $_POST['amount'];

    // Create the charge on Stripe's servers - this will charge the user's card
    try {
        $charge = Stripe_Charge::create(array(
            'amount' => $amount,
            'currency' => 'usd',
            'card' => $token,
            'description' => 'elementary OS download')
        );
        // Set an insecure, HTTP only cookie for 10 years in the future.
        setcookie('has_paid_freya', $amount, time()+315360000, '/', '.elementaryos.org', 0, 1);
        echo 'OK';
    } catch(Stripe_CardError $e) {
        echo 'error';
    }
} else { 
    echo $config['stripe_pk'];
}
{'fraction_non_alphanumeric': 0.1765489673550966, 'fraction_numerical': 0.008660892738174551, 'mean_word_length': 2.5933014354066986, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4469010', 'n_tokens_mistral': 500, 'n_tokens_neox': 477, 'n_words': 110}