Esempio n. 1
0
            $dsp->AddBackButton("\" OnClick=\"javascript: refreshParent()");
            $dsp->AddContent();
        } else {
            $dsp->NewContent(t('Transaktionsfehler oder unerlaubter Zugriff'));
            $dsp->AddSmartyTpl('javascript', 'paypal');
            $dsp->AddSingleRow("<font color=\"red\">" . t('Bitte melden sie sich beim einem Admin damit der die Zahlung pr&uuml;fen kann.') . "</font>");
            $dsp->AddDoubleRow(t('Vorname'), $_POST['first_name']);
            $dsp->AddDoubleRow(t('Nachname'), $_POST['last_name']);
            $dsp->AddDoubleRow(t('E-Mail'), $_POST['payer_email']);
            $dsp->AddDoubleRow(t('Zahlungsnummer'), $_POST['txn_id']);
            $dsp->AddDoubleRow(t('Zahlungsdatum'), $_POST['payment_date']);
            $dsp->AddBackButton("\" OnClick=\"javascript: refreshParent()");
            $dsp->AddContent();
        }
        break;
    case 5:
        $result = fsockPost($cfg['paypal_url'], $_POST);
        if (eregi("VERIFIED", $result)) {
            create_csv_file("ext_inc/paypal/ipn_success.txt.php", $_POST);
        } else {
            create_csv_file("ext_inc/paypal/ipn_error.txt.php", $_POST);
        }
        break;
    case 10:
        $dsp->NewContent(t('Fehler'));
        $dsp->AddSingleRow(t('Die Transaktion konnte nicht durchgef&uuml;hrt werden.'));
        $dsp->AddBackButton("\" OnClick=\"javascript: refreshParent()");
        $dsp->AddContent();
        break;
}
echo $smarty->fetch('modules/paypal/templates/sendbox.htm');
        $ticker = "";
        continue;
    }
    if ("" == $ticker && FALSE === strpos($line, "FREQ=\"9\" FX=\"")) {
        continue;
    }
    //skip beginning
    if (FALSE !== strpos($line, "FREQ=\"9\" FX=\"")) {
        $ticker = find_code("FREQ=\"9\" FX=\"", "\" SERIES_NAME", 0, $line);
        $keys[] = $ticker;
    }
    if (FALSE === strpos($line, "OBS_STATUS")) {
        continue;
    }
    // skip garbage
    // do stuff with $line
    //<frb:Obs OBS_STATUS="A" OBS_VALUE="0.8126" TIME_PERIOD="2013-11-27" />
    //<frb:Obs OBS_STATUS="ND" OBS_VALUE="-9999" TIME_PERIOD="2013-11-28" />
    if (FALSE !== strpos($line, "-9999")) {
        continue;
    }
    if (strlen($line) < 10) {
        continue;
    }
    $val = find_code("OBS_VALUE=\"", "\" TI", 0, $line);
    $tm = find_code("TIME_PERIOD=\"", "\" />", 0, $line);
    //echo $val.":".$tm."\n";
    $currency["{$tm}"][$ticker] = $val;
}
create_csv_file($keys, $currency, $cname);
Esempio n. 3
0
<?php

//log successful transaction to file or database
include_once '../include/global_config.inc.php';
create_csv_file("logs/ipn_success.txt", $_POST);
include "../include/dbconfig.php";
$email = $sales_email;
#$paypal_id;
function doTheCurl()
{
    $req = 'cmd=_notify-validate';
    foreach ($_POST as $key => $value) {
        $value = urlencode(stripslashes($value));
        $req .= "&{$key}={$value}";
    }
    $ch = curl_init();
    // check to see if this is sandbox or not
    if ($_POST["test_ipn"] == 1) {
        curl_setopt($ch, CURLOPT_URL, "https://www.sandbox.paypal.com/cgi-bin/webscr");
    } else {
        curl_setopt($ch, CURLOPT_URL, "https://www.paypal.com/cgi-bin/webscr");
    }
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $fp = curl_exec($ch);
    curl_close($ch);
    return $fp;
}
function doTheHttp()
{
Esempio n. 4
0
<?php

include_once '../include/global_config.inc.php';
create_csv_file("logs/ipn_error.txt", $_POST);
?>