コード例 #1
0
 function OfuzApiClientPrivate($key = "", $format = '')
 {
     parent::OfuzApiClient($key, $format);
     $this->api_url = OFUZ_NET . "/api_private.php";
 }
コード例 #2
0
<?php

include_once "class/OfuzApiClient.class.php";
$api_key = '4a974e2d0d18d5257f064fd33972390e';
// replace this with your API key
$do_ofuz = new OfuzApiClient();
$iduser = $do_ofuz->setAuth($api_key);
$do_ofuz->format = "json";
// json,xml,php
//include_once('config.php');
/*if(!empty($_POST)){

    $id_invoice = $_POST["id"];
    $inv_num = $_POST["num"];
    $amt_paid = $_POST["amt_paid"];
    $chk_sum = $_POST["c"];
    $pay_type = $_POST["pay_type"];
    $ref_num = $_POST["ref_num"];
    
    if(md5($inv_num.$amt_paid.$api_key) == $chk_sum){
        $body = "\r\n".'id = '.$id_invoice;
        $body .= "\r\n".'num = '.$inv_num;
        $body .= "\r\n".'amt_paid = '.$amt_paid;
        $body .= "\r\n".'pay_type = '.$pay_type;
        $body .= "\r\n".'ref_num = '.$ref_num;

        //$to      = '*****@*****.**';
        $to      = '*****@*****.**';
        $subject = 'Curl Post For Invoice';
        $message = $body;
        $headers = 'From: info@sqlfusion.com' . "\r\n" .
コード例 #3
0
$api_call = new OfuzApiClient(OFUZ_API_KEY, "json");
$api_call->setObject(true);
$api_call->firstname = $_SESSION['do_User']->firstname;
$api_call->lastname = $_SESSION['do_User']->lastname;
$api_call->email = $_SESSION['do_User']->email;
//$idcontact = json_decode($api_call->get_contact_id());
if ($api_call->get_contact_id()) {
    $response = $api_call->getResponse();
    //print_r($response);
    $idcontact = $response[1][0]->idcontact;
} else {
    $api_call->getResponse()->msg;
}
//$api_call->clearRequest();
//$api_call->idcontact = $idcontact;
$api_call_sub = new OfuzApiClient(OFUZ_API_KEY, "json");
$api_call_sub->setObject(true);
$api_call_sub->idcontact = $response[1][0]->idcontact;
if ($api_call_sub->get_contact_subscription()) {
    $current_plan = $api_call_sub->getResponse()->line_item[0]->item;
    $idinvoice = $api_call_sub->getResponse()->idinvoice;
} else {
    $current_plan = "free";
    $idinvoice = 0;
    //echo $api_call_sub->getResponse()->msg;
}
if ($_SESSION['autologin_paid']) {
    if ($current_plan == "Ofuz99") {
        $_SESSION['do_User']->plan = '99';
        $_SESSION['do_User']->update();
    } elseif ($current_plan == "Ofuz24") {
コード例 #4
0
ファイル: api_test.php プロジェクト: jacquesbagui/ofuz
<?php

/**COPYRIGHTS**/
// Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com
/**COPYRIGHTS**/
include_once "class/OfuzApiClient.class.php";
$api_key = '4a974e2d0d18d5257f064fd33972390e';
// replace this with your API key
$do_ofuz = new OfuzApiClient();
$iduser = $do_ofuz->setAuth($api_key);
$do_ofuz->format = "json";
// json,xml,php
//include_once('config.php');
/*if(!empty($_POST)){

    $id_invoice = $_POST["id"];
    $inv_num = $_POST["num"];
    $amt_paid = $_POST["amt_paid"];
    $chk_sum = $_POST["c"];
    $pay_type = $_POST["pay_type"];
    $ref_num = $_POST["ref_num"];
    
    if(md5($inv_num.$amt_paid.$api_key) == $chk_sum){
        $body = "\r\n".'id = '.$id_invoice;
        $body .= "\r\n".'num = '.$inv_num;
        $body .= "\r\n".'amt_paid = '.$amt_paid;
        $body .= "\r\n".'pay_type = '.$pay_type;
        $body .= "\r\n".'ref_num = '.$ref_num;

        //$to      = '*****@*****.**';
        $to      = '*****@*****.**';
コード例 #5
0
$iduser = $user->validateAPIKey($api_key);
$idcontact = $_SESSION['do_User']->idcontact;
//check for invoice already generated but not paid, if yes redirect to payment page
if (!empty($idcontact)) {
    $invoice = new Invoice();
    $idinvoice = $invoice->getContactInvoiceDetailsForPlanUpgrade($idcontact, $iduser);
    //echo "idinvoice: ".$idinvoice;exit();
    if ($idinvoice != '0') {
        $do_api_user_rel = new UserRelations();
        //$pay_url =  'http://ofuz.localhost/pay/'.$do_api_user_rel->encrypt($idinvoice).'/'.$do_api_user_rel->encrypt($idcontact);
        $pay_url = $GLOBALS['cfg_ofuz_site_https_base'] . 'pay/' . $do_api_user_rel->encrypt($idinvoice) . '/' . $do_api_user_rel->encrypt($idcontact);
        @header("location:{$pay_url}");
        exit;
    }
}
$do_ofuz = new OfuzApiClient($api_key, 'php');
// $iduser = $do_ofuz->setAuth($api_key);
// $do_ofuz->format = "php";// json,xml,php
$do_ofuz->firstname = $_SESSION['do_User']->firstname;
$do_ofuz->lastname = $_SESSION['do_User']->lastname;
$response = $do_ofuz->search_contact();
$response = unserialize($response);
//echo'<pre>';print_r($response);echo'</pre>';
if ($response[stat] == 'fail') {
    $do_ofuz->firstname = $_SESSION['do_User']->firstname;
    $do_ofuz->lastname = $_SESSION['do_User']->lastname;
    $do_ofuz->position = '';
    $do_ofuz->company = '';
    $do_ofuz->phone_work = '';
    $do_ofuz->phone_home = '';
    $do_ofuz->mobile_number = '';
コード例 #6
0
<?php

include_once 'config.php';
include_once "class/OfuzApiClient.class.php";
if ($_SESSION['do_User']->api_key == '') {
    $_SESSION['do_User']->autoGenerateAPIKey();
}
$api_key = $_SESSION['do_User']->api_key;
//assigning API key
$do_ofuz = new OfuzApiClient();
$iduser = $do_ofuz->setAuth($api_key);
$do_ofuz->format = "json";
// json,xml,php
$response = $do_ofuz->get_contacts();
$response = json_decode($response);
$response_status = $response[0];
if ($response_status->{'stat'} == 'ok') {
    echo json_encode($response);
} else {
    echo '';
}