rename variables

1.9.x
Francis Gonzales 12 years ago
parent 9f4876c815
commit daa94d70f2
  1. 20
      plugin/buy_courses/js/funciones.js
  2. 4
      plugin/buy_courses/resources/plugin.css
  3. 8
      plugin/buy_courses/src/ajax.php
  4. 63
      plugin/buy_courses/src/expresscheckout.php
  5. 17
      plugin/buy_courses/src/function.php
  6. 470
      plugin/buy_courses/src/paypalfunctions.php
  7. 3
      plugin/buy_courses/src/pending_orders.php
  8. 3
      plugin/buy_courses/src/process.php
  9. 36
      plugin/buy_courses/src/process_confirm.php
  10. 180
      plugin/buy_courses/src/success.php
  11. 33
      plugin/buy_courses/view/configuration.tpl
  12. 2
      plugin/buy_courses/view/list.tpl
  13. 2
      plugin/buy_courses/view/paymentsetup.tpl
  14. 49
      plugin/buy_courses/view/process.tpl
  15. 4
      plugin/buy_courses/view/process_confirm.tpl

@ -26,19 +26,19 @@ $(document).ready(function () {
});
});
$(".guardar").click(function () {
var vvisible = $(this).parent().parent().prev().prev().children().attr("checked");
var vprice = $(this).parent().parent().prev().children().attr("value");
var courseid = $(this).parent().parent().attr("id");
$.post("function.php", {tab: "save_mod", id: courseid, visible: vvisible, price: vprice},
$(".save").click(function () {
var visible = $(this).parent().parent().prev().prev().children().attr("checked");
var price = $(this).parent().parent().prev().children().attr("value");
var id_course = $(this).attr('id');
$.post("function.php", {tab: "save_mod", id_course: id_course, visible: visible, price: price},
function (data) {
if (data.status == "false") {
alert("Error database");
alert("Database Error");
} else {
$("#course" + data.id).children().attr("style", "display:''");
$("#course" + data.id).children().next().attr("style", "display:none");
$("#course" + data.id).parent().removeClass("fmod")
$("#course" + data.id).parent().children().each(function () {
$("#course" + data.id_course).children().attr("style", "display:''");
$("#course" + data.id_course).children().next().attr("style", "display:none");
$("#course" + data.id_course).parent().removeClass("fmod")
$("#course" + data.id_course).parent().children().each(function () {
$(this).removeClass("btop");
});
}

@ -72,4 +72,8 @@ select#lsessions, select#lcourses, select#lexercises, select#status {
.height5 {
height: 5px;
}
.margin-left-fifty{
margin-left: 50px !important;
}

@ -1,15 +1,15 @@
<?php
require_once '../../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
require_once '../config.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once '../lib/buy_course_plugin.class.php';
$language_file = array('course_description');
// Get the name of the database course.
$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
$course_info = api_get_course_info($_GET['code']);
$code = Database::escape_string($_GET['code']);
$course_info = api_get_course_info($code);
echo Display::tag('h2', $course_info['name']);
echo '<br />';

@ -1,47 +1,44 @@
<?php
require_once("paypalfunctions.php");
// ==================================
// PayPal Express Checkout Module
// ==================================
//'------------------------------------
//' The paymentAmount is the total value of
//' the shopping cart, that was set
//' earlier in a session variable
//' by the shopping cart page
//'------------------------------------
require_once 'paypalfunctions.php';
/**
* PayPal Express Checkout Module
*
* The paymentAmount is the total value of
* the shopping cart, that was set
* earlier in a session variable
* by the shopping cart page
*/
$paymentAmount = $_SESSION["Payment_Amount"];
//'------------------------------------
//' The currencyCodeType and paymentType
//' are set to the selections made on the Integration Assistant
//'------------------------------------
/**
* The currencyCodeType and paymentType
* are set to the selections made on the Integration Assistant
*/
$currencyCodeType = "EUR";
$paymentType = "Sale";
//'------------------------------------
//' The returnURL is the location where buyers return to when a
//' payment has been succesfully authorized.
//'
//' This is set to the value entered on the Integration Assistant
//'------------------------------------
/**
* The returnURL is the location where buyers return to when a
* payment has been succesfully authorized.
* This is set to the value entered on the Integration Assistant
*/
$returnURL = "http://www.nosolored.me/pluging/paypal/confirm.php";
//'------------------------------------
//' The cancelURL is the location buyers are sent to when they hit the
//' cancel button during authorization of payment during the PayPal flow
//'
//' This is set to the value entered on the Integration Assistant
//'------------------------------------
/**
* The cancelURL is the location buyers are sent to when they hit the
* cancel button during authorization of payment during the PayPal flow
*
* This is set to the value entered on the Integration Assistant
*/
$cancelURL = "http://www.nosolored.me/pluging/paypal/error.php";
//'------------------------------------
//' Calls the SetExpressCheckout API call
//'
//' The CallShortcutExpressCheckout function is defined in the file PayPalFunctions.php,
//' it is included at the top of this file.
//'-------------------------------------------------
/**
* Calls the SetExpressCheckout API call
* The CallShortcutExpressCheckout function is defined in the file PayPalFunctions.php,
* it is included at the top of this file.
*/
$resArray = CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {

@ -1,8 +1,7 @@
<?php
require_once '../../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
require_once '../config.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once 'buy_course_plugin.class.php';
require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
@ -144,7 +143,7 @@ if ($_REQUEST['tab'] == 'courses_filter') {
$content .= '<div class="btn-toolbar right">';
$content .= '<a class="ajax btn btn-primary" title="" href="' . $server . 'main/inc/ajax/course_home.ajax.php?a=show_course_information&code=' . $course['code'] . '">' . get_lang('Description') . '</a>&nbsp;';
if ($course['enrolled'] != "YES") {
$content .= '<a class="btn btn-success" title="" href="' . $server . 'plugin/buy_courses/process.php?code=' . $course['id'] . '">' . $buy_name . '</a>';
$content .= '<a class="btn btn-success" title="" href="' . $server . 'plugin/buy_courses/src/process.php?code=' . $course['id'] . '">' . $buy_name . '</a>';
}
$content .= '</div>';
$content .= '</div>';
@ -224,23 +223,23 @@ if ($_REQUEST['tab'] == 'delete_account') {
}
if ($_REQUEST['tab'] == 'save_mod') {
$_REQUEST['id'] = intval($_REQUEST['id']);
$id = substr($_REQUEST['id'], 5);
$_REQUEST['id'] = Database::escape_string($_REQUEST['id']);
$idCourse = intval($_REQUEST['id_course']);
$visible = ($_REQUEST['visible'] == "checked") ? 1 : 0;
$price = mysql_real_escape_string($_REQUEST['price']);
$price = Database::escape_string($_REQUEST['price']);
$obj = $_REQUEST['obj'];
$sql = "UPDATE $tableBuyCourse
SET visible = " . $visible . ",
price = '" . $price . "'
WHERE id_course = '" . $id . "';";
WHERE id_course = '" . $idCourse . "';";
$res = Database::query($sql);
if (!res) {
$content = $plugin->get_lang('ProblemToSaveTheMessage') . Database::error();
echo json_encode(array("status" => "false", "content" => $content));
} else {
echo json_encode(array("status" => "true", "id" => $id));
echo json_encode(array("status" => "true", "id_course" => $idCourse));
}
}

@ -9,33 +9,27 @@ $PROXY_PORT = '808';
$SandboxFlag = $pruebas;
//'------------------------------------
//' PayPal API Credentials
//' Replace <API_USERNAME> with your API Username
//' Replace <API_PASSWORD> with your API Password
//' Replace <API_SIGNATURE> with your Signature
//'------------------------------------
//$API_UserName="vendedor_api1.calidadeorigen.com";
//$API_Password="1385456693";
//$API_Signature="An5ns1Kso7MWUdW4ErQKJJJ4qi4-AmFnLvPhhq5VHgESNLWwWusSKk4T";
/**
* PayPal API Credentials
* Replace <API_USERNAME> with your API Username
* Replace <API_PASSWORD> with your API Password
* Replace <API_SIGNATURE> with your Signature
*/
$API_UserName = $paypal_username;
$API_Password = $paypal_password;
$API_Signature = $paypal_firma;
// BN Code is only applicable for partners
// BN Code is only applicable for partners
$sBNCode = "PP-ECWizard";
/*
' Define the PayPal Redirect URLs.
' This is the URL that the buyer is first sent to do authorize payment with their paypal account
' change the URL depending if you are testing on the sandbox or the live PayPal site
'
' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
/**
* Define the PayPal Redirect URLs.
* This is the URL that the buyer is first sent to do authorize payment with their paypal account
* change the URL depending if you are testing on the sandbox or the live PayPal site
*
* For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
* For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
if ($SandboxFlag == true) {
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
@ -51,28 +45,26 @@ $version = "93";
if (session_id() == "")
session_start();
/* An express checkout transaction starts with a token, that
identifies to PayPal your transaction
In this example, when the script sees a token, the script
knows that the buyer has already authorized payment through
paypal. If no token was found, the action is to send the buyer
to PayPal to first authorize payment
*/
/*
'-------------------------------------------------------------------------------------------------------------------------------------------
' Purpose: Prepares the parameters for the SetExpressCheckout API Call.
' Inputs:
' paymentAmount: Total value of the shopping cart
' currencyCodeType: Currency code value the PayPal API
' paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
' returnURL: the page where buyers return to after they are done with the payment review on PayPal
' cancelURL: the page where buyers return to when they cancel the payment review on PayPal
'--------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* An express checkout transaction starts with a token, that
* identifies to PayPal your transaction
* In this example, when the script sees a token, the script
* knows that the buyer has already authorized payment through
* paypal. If no token was found, the action is to send the buyer
* to PayPal to first authorize payment
*/
/**
* Purpose: Prepares the parameters for the SetExpressCheckout API Call.
* Inputs:
* paymentAmount: Total value of the shopping cart
* currencyCodeType: Currency code value the PayPal API
* paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
* returnURL: the page where buyers return to after they are done with the payment review on PayPal
* cancelURL: the page where buyers return to when they cancel the payment review on PayPal
*/
function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $extra)
{
//------------------------------------------------------------------------------------------------------------------------------------
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount;
@ -82,17 +74,15 @@ function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $payment
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType;
$nvpstr = $nvpstr . $extra;
//echo $nvpstr;
//exit;
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
//'---------------------------------------------------------------------------------------------------------------
//' Make the API call to PayPal
//' If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
//' If an error occured, show the resulting errors
//'---------------------------------------------------------------------------------------------------------------
/**
* Make the API call to PayPal
* If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
* If an error occured, show the resulting errors
*/
$resArray = hash_call("SetExpressCheckout", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
@ -103,33 +93,29 @@ function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $payment
return $resArray;
}
/*
'-------------------------------------------------------------------------------------------------------------------------------------------
' Purpose: Prepares the parameters for the SetExpressCheckout API Call.
' Inputs:
' paymentAmount: Total value of the shopping cart
' currencyCodeType: Currency code value the PayPal API
' paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
' returnURL: the page where buyers return to after they are done with the payment review on PayPal
' cancelURL: the page where buyers return to when they cancel the payment review on PayPal
' shipToName: the Ship to name entered on the merchant's site
' shipToStreet: the Ship to Street entered on the merchant's site
' shipToCity: the Ship to City entered on the merchant's site
' shipToState: the Ship to State entered on the merchant's site
' shipToCountryCode: the Code for Ship to Country entered on the merchant's site
' shipToZip: the Ship to ZipCode entered on the merchant's site
' shipToStreet2: the Ship to Street2 entered on the merchant's site
' phoneNum: the phoneNum entered on the merchant's site
'--------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* Purpose: Prepares the parameters for the SetExpressCheckout API Call.
* Inputs:
* paymentAmount: Total value of the shopping cart
* currencyCodeType: Currency code value the PayPal API
* paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
* returnURL: the page where buyers return to after they are done with the payment review on PayPal
* cancelURL: the page where buyers return to when they cancel the payment review on PayPal
* shipToName: the Ship to name entered on the merchant's site
* shipToStreet: the Ship to Street entered on the merchant's site
* shipToCity: the Ship to City entered on the merchant's site
* shipToState: the Ship to State entered on the merchant's site
* shipToCountryCode: the Code for Ship to Country entered on the merchant's site
* shipToZip: the Ship to ZipCode entered on the merchant's site
* shipToStreet2: the Ship to Street2 entered on the merchant's site
* phoneNum: the phoneNum entered on the merchant's site
*/
function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL,
$cancelURL, $shipToName, $shipToStreet, $shipToCity, $shipToState,
$shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum
)
{
//------------------------------------------------------------------------------------------------------------------------------------
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType;
$nvpstr = $nvpstr . "&RETURNURL=" . $returnURL;
@ -148,11 +134,11 @@ function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
//'---------------------------------------------------------------------------------------------------------------
//' Make the API call to PayPal
//' If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
//' If an error occured, show the resulting errors
//'---------------------------------------------------------------------------------------------------------------
/**
* Make the API call to PayPal
* If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
* If an error occured, show the resulting errors
*/
$resArray = hash_call("SetExpressCheckout", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
@ -163,40 +149,37 @@ function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType
return $resArray;
}
/*
'-------------------------------------------------------------------------------------------
' Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call.
'
' Inputs:
' None
' Returns:
' The NVP Collection object of the GetExpressCheckoutDetails Call Response.
'-------------------------------------------------------------------------------------------
*/
/**
*
* Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call.
*
* Inputs:
* None
* Returns:
* The NVP Collection object of the GetExpressCheckoutDetails Call Response.
*/
function GetShippingDetails($token)
{
//'--------------------------------------------------------------
//' At this point, the buyer has completed authorizing the payment
//' at PayPal. The function will call PayPal to obtain the details
//' of the authorization, incuding any shipping information of the
//' buyer. Remember, the authorization is not a completed transaction
//' at this state - the buyer still needs an additional step to finalize
//' the transaction
//'--------------------------------------------------------------
//'---------------------------------------------------------------------------
//' Build a second API request to PayPal, using the token as the
//' ID to get the details on the payment authorization
//'---------------------------------------------------------------------------
/**
* At this point, the buyer has completed authorizing the payment
* at PayPal. The function will call PayPal to obtain the details
* of the authorization, incuding any shipping information of the
* buyer. Remember, the authorization is not a completed transaction
* at this state - the buyer still needs an additional step to finalize
* the transaction
*
* Build a second API request to PayPal, using the token as the
* ID to get the details on the payment authorization
*/
$nvpstr = "&TOKEN=" . $token;
//'---------------------------------------------------------------------------
//' Make the API call and store the results in an array.
//' If the call was a success, show the authorization details, and provide
//' an action to complete the payment.
//' If failed, show the error
//'---------------------------------------------------------------------------
/**
* Make the API call and store the results in an array.
* If the call was a success, show the authorization details, and provide
* an action to complete the payment.
* If failed, show the error
*/
$resArray = hash_call("GetExpressCheckoutDetails", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
@ -205,366 +188,197 @@ function GetShippingDetails($token)
return $resArray;
}
/*
'-------------------------------------------------------------------------------------------------------------------------------------------
' Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call.
'
' Inputs:
' sBNCode: The BN code used by PayPal to track the transactions from a given shopping cart.
' Returns:
' The NVP Collection object of the GetExpressCheckoutDetails Call Response.
'--------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call.
* Inputs:
* sBNCode: The BN code used by PayPal to track the transactions from a given shopping cart.
* Returns:
* The NVP Collection object of the GetExpressCheckoutDetails Call Response.
*/
function ConfirmPayment($FinalPaymentAmt)
{
/* Gather the information to make the final call to
finalize the PayPal payment. The variable nvpstr
holds the name value pairs
*/
/**
* Gather the information to make the final call to
* finalize the PayPal payment. The variable nvpstr
* holds the name value pairs
*/
//Format the other parameters that were stored in the session from the previous calls
$token = urlencode($_SESSION['TOKEN']);
$paymentType = urlencode($_SESSION['PaymentType']);
$currencyCodeType = urlencode($_SESSION['currencyCodeType']);
$payerID = urlencode($_SESSION['payer_id']);
$serverName = urlencode($_SERVER['SERVER_NAME']);
$nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName;
/* Make the call to PayPal to finalize payment
If an error occured, show the resulting errors
*/
/**
* Make the call to PayPal to finalize payment
* If an error occured, show the resulting errors
*/
$resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
/* Display the API response back to the browser.
If the response from PayPal was a success, display the response parameters'
If the response was an error, display the errors received using APIError.php.
*/
/**
* Display the API response back to the browser.
* If the response from PayPal was a success, display the response parameters
* If the response was an error, display the errors received using APIError.php.
*/
$ack = strtoupper($resArray["ACK"]);
return $resArray;
}
/*
'-------------------------------------------------------------------------------------------------------------------------------------------
' Purpose: This function makes a DoDirectPayment API call
'
' Inputs:
' paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
' paymentAmount: total value of the shopping cart
' currencyCode: currency code value the PayPal API
' firstName: first name as it appears on credit card
' lastName: last name as it appears on credit card
' street: buyer's street address line as it appears on credit card
' city: buyer's city
' state: buyer's state
' countryCode: buyer's country code
' zip: buyer's zip
' creditCardType: buyer's credit card type (i.e. Visa, MasterCard ... )
' creditCardNumber: buyers credit card number without any spaces, dashes or any other characters
' expDate: credit card expiration date
' cvv2: Card Verification Value
'
'-------------------------------------------------------------------------------------------
'
' Returns:
' The NVP Collection object of the DoDirectPayment Call Response.
'--------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* Purpose: This function makes a DoDirectPayment API call
* Inputs:
* paymentType: paymentType has to be one of the following values: Sale or Order or Authorization
* paymentAmount: total value of the shopping cart
* currencyCode: currency code value the PayPal API
* firstName: first name as it appears on credit card
* lastName: last name as it appears on credit card
* street: buyer's street address line as it appears on credit card
* city: buyer's city
* state: buyer's state
* countryCode: buyer's country code
* zip: buyer's zip
* creditCardType: buyer's credit card type (i.e. Visa, MasterCard ... )
* creditCardNumber: buyers credit card number without any spaces, dashes or any other characters
* expDate: credit card expiration date
* cvv2: Card Verification Value
* Returns:
* The NVP Collection object of the DoDirectPayment Call Response.
*/
function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCardNumber,
$expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip,
$countryCode, $currencyCode)
{
//Construct the parameter string that describes DoDirectPayment
$nvpstr = "&AMT=" . $paymentAmount;
$nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCode;
$nvpstr = $nvpstr . "&PAYMENTACTION=" . $paymentType;
$nvpstr = $nvpstr . "&CREDITCARDTYPE=" . $creditCardType;
$nvpstr = $nvpstr . "&ACCT=" . $creditCardNumber;
$nvpstr = $nvpstr . "&EXPDATE=" . $expDate;
$nvpstr = $nvpstr . "&CVV2=" . $cvv2;
$nvpstr = $nvpstr . "&FIRSTNAME=" . $firstName;
$nvpstr = $nvpstr . "&LASTNAME=" . $lastName;
$nvpstr = $nvpstr . "&STREET=" . $street;
$nvpstr = $nvpstr . "&CITY=" . $city;
$nvpstr = $nvpstr . "&STATE=" . $state;
$nvpstr = $nvpstr . "&COUNTRYCODE=" . $countryCode;
$nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR'];
$resArray = hash_call("DoDirectPayment", $nvpstr);
return $resArray;
}
/**
*
* '-------------------------------------------------------------------------------------------------------------------------------------------
* hash_call: Function to perform the API call to PayPal using API signature
* @methodName is name of API method.
* @nvpStr is nvp string.
* returns an associtive array containing the response from the server.
*
* '-------------------------------------------------------------------------------------------------------------------------------------------
*/
function hash_call($methodName, $nvpStr)
{
//declaring of global variables
global $API_Endpoint, $version, $API_UserName, $API_Password, $API_Signature;
global $USE_PROXY, $PROXY_HOST, $PROXY_PORT;
global $gv_ApiErrorURL;
global $sBNCode;
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//turning off the server and peer verification(TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php
if ($USE_PROXY)
if ($USE_PROXY) {
curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . ":" . $PROXY_PORT);
}
//NVPRequest for submitting to server
$nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode);
$nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) .
"&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) .
"&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode);
//setting the nvpreq as POST FIELD to curl
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
//getting response from server
$response = curl_exec($ch);
//convrting NVPResponse to an Associative Array
//converting NVPResponse to an Associative Array
$nvpResArray = deformatNVP($response);
$nvpReqArray = deformatNVP($nvpreq);
$_SESSION['nvpReqArray'] = $nvpReqArray;
if (curl_errno($ch)) {
// moving to display page to display curl errors
$_SESSION['curl_error_no'] = curl_errno($ch);
$_SESSION['curl_error_msg'] = curl_error($ch);
//Execute the Error handling module to display errors.
} else {
//closing the curl
curl_close($ch);
}
return $nvpResArray;
}
/*'----------------------------------------------------------------------------------
Purpose: Redirects to PayPal.com site.
Inputs: NVP string.
Returns:
----------------------------------------------------------------------------------
*/
/**
* Purpose: Redirects to PayPal.com site.
* Inputs: NVP string.
*/
function RedirectToPayPal($token)
{
global $PAYPAL_URL;
// Redirect to paypal.com here
$payPalURL = $PAYPAL_URL . $token;
header("Location: " . $payPalURL);
exit;
}
/*'----------------------------------------------------------------------------------
/**
* This function will take NVPString and convert it to an Associative Array and it will decode the response.
* It is usefull to search for a particular key and displaying arrays.
* @nvpstr is NVPString.
* @nvpArray is Associative Array.
----------------------------------------------------------------------------------
*/
* It is usefull to search for a particular key and displaying arrays.
* @nvpstr is NVPString.
* @nvpArray is Associative Array.
*/
function deformatNVP($nvpstr)
{
$intial = 0;
$nvpArray = array();
while (strlen($nvpstr)) {
//postion of Key
$keypos = strpos($nvpstr, '=');
//position of value
$valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&') : strlen($nvpstr);
/*getting the Key and Value values and storing in a Associative Array*/
$keyval = substr($nvpstr, $intial, $keypos);
$valval = substr($nvpstr, $keypos + 1, $valuepos - $keypos - 1);
//decoding the respose
$nvpArray[urldecode($keyval)] = urldecode($valval);
$nvpstr = substr($nvpstr, $valuepos + 1, strlen($nvpstr));
}
return $nvpArray;
}

@ -2,9 +2,8 @@
/**
* Initialization
*/
require_once '../config.php';
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'lib/buy_course_plugin.class.php';
$plugin = Buy_CoursesPlugin::create();
$_cid = 0;

@ -2,9 +2,8 @@
/**
* Initialization
*/
require_once '../config.php';
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'lib/buy_course_plugin.class.php';
$plugin = Buy_CoursesPlugin::create();
$_cid = 0;

@ -1,15 +1,16 @@
<?php
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
require_once '../../../main/inc/global.inc.php';
require_once '../config.php';
require_once '../../../main/inc/lib/mail.lib.inc.php';
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once 'lib/buy_course_plugin.class.php';
if ($_POST['payment_type'] == '') {
header('Location:process.php');
}
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
$tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL);
if (isset($_POST['Aceptar'])) {
// Save the user, course and reference in a tmp table
$user_id = $_SESSION['bc_user_id'];
@ -22,24 +23,25 @@ if (isset($_POST['Aceptar'])) {
eval($asignacion);
}
$sql = "INSERT INTO plugin_bc_temporal (user_id, name, course_code, title, reference, price) VALUES ('" . $user_id . "', '" . $name . "','" . $course_code . "','" . $title . "','" . $reference . "','" . $price . "');";
$sql = "INSERT INTO $tableBuyCourseTemporal (user_id, name, course_code, title, reference, price)
VALUES ('" . $user_id . "', '" . $name . "','" . $course_code . "','" . $title . "','" . $reference . "','" . $price . "');";
$res = Database::query($sql);
// Notify the user and send the bank info
$accountsList = listAccounts();
$texto = '<div align="center"><table style="width:70%"><tr><th style="text-align:center"><h3>Datos Bancarios</h3></th></tr>';
$text = '<div align="center"><table style="width:70%"><tr><th style="text-align:center"><h3>Datos Bancarios</h3></th></tr>';
foreach ($accountsList as $account) {
$texto .= '<tr>';
$texto .= '<td>';
$texto .= '<font color="#0000FF"><strong>' . htmlspecialchars($account['name']) . '</strong></font><br />';
$text .= '<tr>';
$text .= '<td>';
$text .= '<font color="#0000FF"><strong>' . htmlspecialchars($account['name']) . '</strong></font><br />';
if ($account['swift'] != '') {
$texto .= 'SWIFT: <strong>' . htmlspecialchars($account['swift']) . '</strong><br />';
$text .= 'SWIFT: <strong>' . htmlspecialchars($account['swift']) . '</strong><br />';
}
$texto .= 'Cuenta Bancaria: <strong>' . htmlspecialchars($account['account']) . '</strong><br />';
$texto .= '</td></tr>';
$text .= 'Cuenta Bancaria: <strong>' . htmlspecialchars($account['account']) . '</strong><br />';
$text .= '</td></tr>';
}
$texto .= '</table></div>';
$text .= '</table></div>';
$plugin = Buy_CoursesPlugin::create();
$asunto = utf8_encode($plugin->get_lang('bc_subject'));
@ -60,7 +62,7 @@ if (isset($_POST['Aceptar'])) {
$message = str_replace("{{name}}", $name, $message);
$message = str_replace("{{course}}", $title_course, $message);
$message = str_replace("{{reference}}", $reference, $message);
$message .= $texto;
$message .= $text;
api_mail($name, $email, $asunto, $message);
// Return to course list
@ -73,14 +75,14 @@ $_SESSION['bc_currency_type'] = $currencyType;
$server = $_POST['server'];
if ($_POST['payment_type'] == "PayPal") {
$sql = "SELECT * FROM plugin_bc_paypal WHERE id='1';";
$sql = "SELECT * FROM $tableBuyCoursePaypal WHERE id='1';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$pruebas = ($row['sandbox'] == "YES") ? true: false;
$paypal_username = $row['username'];
$paypal_password = $row['password'];
$paypal_firma = $row['signature'];
require_once("function/paypalfunctions.php");
require_once("paypalfunctions.php");
// PayPal Express Checkout Module
$paymentAmount = $_SESSION["Payment_Amount"];
$currencyCodeType = $currencyType;
@ -119,7 +121,7 @@ if ($_POST['payment_type'] == "Transference") {
$_cid = 0;
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
$tpl = new Template('Tipo de pago');
$tpl = new Template('PaymentType');
$code = $_SESSION['bc_course_code'];
$courseInfo = courseInfo($code);

@ -2,31 +2,31 @@
use ChamiloSession as Session;
require_once '../config.php';
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'lib/buy_course_plugin.class.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
$tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL);
$plugin = Buy_CoursesPlugin::create();
/*
==================================================================
// DATOS DE PAYPAL //
==================================================================
*/
$sql = "SELECT * FROM plugin_bc_paypal WHERE id='1';";
/**
* Paypal data
*/
$sql = "SELECT * FROM $tableBuyCoursePaypal WHERE id='1';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$pruebas = ($row['sandbox'] == "YES") ? true: false;
$paypal_username = $row['username'];
$paypal_password = $row['password'];
$paypal_firma = $row['signature'];
require_once("function/paypalfunctions.php");
require_once("paypalfunctions.php");
/**
* PayPal Express Checkout Call
*/
/*==================================================================
PayPal Express Checkout Call
===================================================================
*/
// Check to see if the Request object contains a variable named 'token'
$token = "";
if (isset($_REQUEST['token'])) {
@ -35,28 +35,26 @@ if (isset($_REQUEST['token'])) {
// If the Request object contains the variable 'token' then it means that the user is coming from PayPal site.
if ($token != "") {
$sql = "SELECT * FROM plugin_bc_paypal WHERE id='1';";
$sql = "SELECT * FROM $tableBuyCoursePaypal WHERE id='1';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$paypal_username = $row['username'];
$paypal_password = $row['password'];
$paypal_firma = $row['signature'];
require_once("function/paypalfunctions.php");
/*
'------------------------------------
' Calls the GetExpressCheckoutDetails API call
'
' The GetShippingDetails function is defined in PayPalFunctions.jsp
' included at the top of this file.
'-------------------------------------------------
*/
require_once 'paypalfunctions.php';
/**
* Calls the GetExpressCheckoutDetails API call
* The GetShippingDetails function is defined in PayPalFunctions.jsp
*included at the top of this file.
*/
$resArray = GetShippingDetails($token);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCESSWITHWARNING") {
/*
' The information that is returned by the GetExpressCheckoutDetails call should be integrated by the partner into his Order Review
' page
*/
/**
* The information that is returned by the GetExpressCheckoutDetails
* call should be integrated by the partner into his Order Review page
*/
$email = $resArray["EMAIL"]; // ' Email address of payer.
$payerId = $resArray["PAYERID"]; // ' Unique PayPal customer account identification number.
$payerStatus = $resArray["PAYERSTATUS"]; // ' Status of payer. Character length and limitations: 10 single-byte alphabetic characters.
@ -94,7 +92,7 @@ if ($token != "") {
if (!isset($_POST['paymentOption'])) {
//PANTALLA DE CONFIRMACION DEL PEDIDO
// Confirm the order
$_cid = 0;
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
@ -125,49 +123,41 @@ if (!isset($_POST['paymentOption'])) {
$tpl->display_one_col_template();
} else {
/*==================================================================
PayPal Express Checkout Call
===================================================================
*/
/**
* PayPal Express Checkout Call
*/
$PaymentOption = $_POST['paymentOption'];
$sql = "SELECT * FROM plugin_bc_paypal WHERE id='1';";
$sql = "SELECT * FROM $tableBuyCoursePaypal WHERE id='1';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$paypal_username = $row['username'];
$paypal_password = $row['password'];
$paypal_firma = $row['signature'];
require_once("function/paypalfunctions.php");
require_once("paypalfunctions.php");
if ($PaymentOption == "PayPal") {
/*
'------------------------------------
' The paymentAmount is the total value of
' the shopping cart, that was set
' earlier in a session variable
' by the shopping cart page
'------------------------------------
*/
/**
* The paymentAmount is the total value of
* the shopping cart, that was set
* earlier in a session variable
* by the shopping cart page
*/
$finalPaymentAmount = $_SESSION["Payment_Amount"];
/*
'------------------------------------
' Calls the DoExpressCheckoutPayment API call
'
' The ConfirmPayment function is defined in the file PayPalFunctions.jsp,
' that is included at the top of this file.
'-------------------------------------------------
*/
/**
* Calls the DoExpressCheckoutPayment API call
* The ConfirmPayment function is defined in the file PayPalFunctions.jsp,
* that is included at the top of this file.
*/
$resArray = ConfirmPayment($finalPaymentAmount);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
/*
'********************************************************************************************************************
'
' THE PARTNER SHOULD SAVE THE KEY TRANSACTION RELATED INFORMATION LIKE
' transactionId & orderTime
' IN THEIR OWN DATABASE
' AND THE REST OF THE INFORMATION CAN BE USED TO UNDERSTAND THE STATUS OF THE PAYMENT
'
'********************************************************************************************************************
*/
/**
* THE PARTNER SHOULD SAVE THE KEY TRANSACTION RELATED INFORMATION LIKE transactionId & orderTime
* IN THEIR OWN DATABASE
* AND THE REST OF THE INFORMATION CAN BE USED TO UNDERSTAND THE STATUS OF THE PAYMENT
*/
$transactionId = $resArray["PAYMENTINFO_0_TRANSACTIONID"]; // ' Unique transaction ID of the payment. Note: If the PaymentAction of the request was Authorization or Order, this value is your AuthorizationID for use with the Authorization & Capture APIs.
$transactionType = $resArray["PAYMENTINFO_0_TRANSACTIONTYPE"]; //' The type of transaction Possible values: l cart l express-checkout
@ -180,44 +170,45 @@ if (!isset($_POST['paymentOption'])) {
$taxAmt = $resArray["PAYMENTINFO_0_TAXAMT"]; //' Tax charged on the transaction.
$exchangeRate = $resArray["PAYMENTINFO_0_EXCHANGERATE"]; //' Exchange rate if a currency conversion occurred. Relevant only if your are billing in their non-primary currency. If the customer chooses to pay with a currency other than the non-primary currency, the conversion occurs in the customer's account.
/*
' Status of the payment:
'Completed: The payment has been completed, and the funds have been added successfully to your account balance.
'Pending: The payment is pending. See the PendingReason element for more information.
*/
/**
* Status of the payment:
* Completed: The payment has been completed, and the funds have been added successfully to your account balance.
* Pending: The payment is pending. See the PendingReason element for more information.
*/
$paymentStatus = $resArray["PAYMENTINFO_0_PAYMENTSTATUS"];
/*
'The reason the payment is pending:
' none: No pending reason
' address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile.
' echeck: The payment is pending because it was made by an eCheck that has not yet cleared.
' intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.
' multi-currency: You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.
' verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment.
' other: The payment is pending for a reason other than those listed above. For more information, contact PayPal customer service.
*/
/**
* The reason the payment is pending:
* none: No pending reason
* address: The payment is pending because your customer did not include a confirmed
* shipping address and your Payment Receiving Preferences is set such that you want to
* manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile.
* echeck: The payment is pending because it was made by an eCheck that has not yet cleared.
* intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism.
* You must manually accept or deny this payment from your Account Overview.
* multi-currency: You do not have a balance in the currency sent, and you do not have your
* Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.
* verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment.
* other: The payment is pending for a reason other than those listed above. For more information, contact PayPal customer service.
*/
$pendingReason = $resArray["PAYMENTINFO_0_PENDINGREASON"];
/*
'The reason for a reversal if TransactionType is reversal:
' none: No reason code
' chargeback: A reversal has occurred on this transaction due to a chargeback by your customer.
' guarantee: A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.
' buyer-complaint: A reversal has occurred on this transaction due to a complaint about the transaction from your customer.
' refund: A reversal has occurred on this transaction because you have given the customer a refund.
' other: A reversal has occurred on this transaction due to a reason not listed above.
*/
/**
* The reason for a reversal if TransactionType is reversal:
* none: No reason code
* chargeback: A reversal has occurred on this transaction due to a chargeback by your customer.
* guarantee: A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.
* buyer-complaint: A reversal has occurred on this transaction due to a complaint about the transaction from your customer.
* refund: A reversal has occurred on this transaction because you have given the customer a refund.
* other: A reversal has occurred on this transaction due to a reason not listed above.
*/
$reasonCode = $resArray["PAYMENTINFO_0_REASONCODE"];
//INSERTAMOS LOS REGISTROS NECESARIOS EN LAS TABLAS DE BASES DE DATOS PARA DAR AL USUARIO DE ALTA
// Insert the user information to activate the user
if ($paymentStatus == "Completed") {
$user_id = $_SESSION['bc_user_id']; //api_get_user_id();
$user_id = $_SESSION['bc_user_id'];
$course_code = $_SESSION['bc_course_codetext'];
$all_course_information = CourseManager::get_course_information($course_code);
@ -232,21 +223,15 @@ if (!isset($_POST['paymentOption'])) {
$_SESSION['bc_message'] = 'EnrollToCourseXSuccessful';
$_SESSION['bc_url'] = $url;
$_SESSION['bc_success'] = true;
//$message = sprintf($plugin->get_lang('EnrollToCourseXSuccessful'), $url);
} else {
$_SESSION['bc_message'] = 'ErrorContactPlatformAdmin';
$_SESSION['bc_success'] = false;
//$message = $plugin->get_lang('ErrorContactPlatformAdmin');
}
//Activamos al usuario su cuenta
// Activate the use
$TABLE_USER = Database::get_main_table(TABLE_MAIN_USER);
// 1. set account inactive
$sql = "UPDATE " . $TABLE_USER . " SET active='1' WHERE user_id='" . $_SESSION['bc_user_id'] . "'";
Database::query($sql);
//Logueamos al user
// a uid is given (log in succeeded)
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
$track_e_login = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
@ -264,7 +249,6 @@ if (!isset($_POST['paymentOption'])) {
if (Database::num_rows($result) > 0) {
// Extracting the user data
$uData = Database::fetch_array($result);
$_user = _api_format_user($uData, false);
@ -283,7 +267,7 @@ if (!isset($_POST['paymentOption'])) {
header('location:' . api_get_path(WEB_PATH));
}
//Eliminamos las variables
// Delete variables
unset($_SESSION['bc_user_id']);
unset($_SESSION['bc_course_code']);
unset($_SESSION['bc_course_codetext']);

@ -15,28 +15,27 @@
{% set i = 0 %}
{% for course in courses %}
{{ i%2==0 ? '
<tr class="row_even">' : '
<tr class="row_odd">' }}
{{ i%2 == 0 ? '<tr class="row_even">' : '<tr class="row_odd">' }}
{% set i = i + 1 %}
<td>
{{ $visibility[course.visibility] }}
<a href="{{ server }}courses/{{course.code}}/index.php">{{course.title}}</a>
<span class="label label-info">{{ course.visual_code }}</span>
</td>
<td>{{course.code}}</td>
{{ visibility[course.visibility] }}
<a href="{{ server }}courses/{{course.code}}/index.php">{{course.title}}</a>
<span class="label label-info">{{ course.visual_code }}</span>
</td>
<td>
{{course.code}}
</td>
<td class="ta-center">
{% if course.visible == 1 %}
<input type="checkbox" name="visible" value="1" checked="checked" size="6" />
{% else %}
<input type="checkbox" name="visible" value="1" size="6" />
{% endif %}
{% if course.visible == 1 %}
<input type="checkbox" name="visible" value="1" checked="checked" size="6" />
{% else %}
<input type="checkbox" name="visible" value="1" size="6" />
{% endif %}
</td>
<td><input type="text" name="price" value="{{course.price}}" class="span1 price" /> {{ currency }}</td>
<td class=" ta-center" id="course{{ course.id }}">
<div class="confirmado"><img src="{{ confirmation_img }}" alt="ok"/></div>
<div class="modificado" style="display:none"><img src="{{ save_img }}" alt="guardar"
class="cursor guardar"/></div>
<td class=" ta-center" id="course{{ course.id }}">
<div class="confirmed"><img src="{{ confirmation_img }}" alt="ok"/></div>
<div class="modified" style="display:none"><img id="{{course.id_course}}" src="{{ save_img }}" alt="save" class="cursor save"/></div>
</td>
</tr>
{% endfor %}

@ -38,7 +38,7 @@
<div class="row">
<div class="span">
<div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title="" href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">
<a class="ajax" rel="gb_page_center[778]" title="" href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">
<img alt="" src="{{ server }}{{ course.course_img }}">
</a>
</div>

@ -16,7 +16,7 @@
{% endif %}
{% endfor %}
</select>
<input type="button" id="save_currency" class="btn btn-primary" value="Guardar" />
<input type="button" id="save_currency" class="btn btn-primary" value="Save" />
{% if paypal_enable == "true" %}
<hr />

@ -24,7 +24,7 @@
<div class="span">
<div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">
<img alt="" src="{{ server }}{{ course.course_img }}">
</a>
</div>
@ -40,39 +40,36 @@
<div class="cleared"></div>
<div class="btn-toolbar right">
<a class="ajax btn btn-primary" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}
</a>
</div>
</div>
</div>
</div>
</div>
<div class="cleared"></div>
<hr/>
<div align="center">
<form action="../src/process_confirm.php" method="post">
<table>
<tr>
<th>
<legend><h3> M&eacute;todos de Pago:</h3></legend>
</th>
</tr>
{% if paypal_enable == "true" %}
<tr><td><input type="radio" id="payment_type-p" name="payment_type" value="PayPal" /> {{ 'paypal'|get_lang }}</td></tr>
{% endif %}
{% if transference_enable == "true" %}
<tr><td><input type="radio" id="payment_type-tra" name="payment_type" value="Transference" />{{ 'BankTransference'|get_lang }}</td></tr>
{% endif %}
<tr><td>
<form class="form-horizontal span3 offset4" action="../src/process_confirm.php" method="post">
<fieldset>
<legend align="center">{{ 'PaymentMethods'|get_lang }}</legend>
<div align="center" class="control-group">
<div class="controls margin-left-fifty">
{% if paypal_enable == "true" %}
<label class="radio">
<input type="radio" id="payment_type-p" name="payment_type" value="PayPal" > Paypal
</label>
{% endif %}
{% if transference_enable == "true" %}
<label class="radio">
<input type="radio" id="payment_type-tra" name="payment_type" value="Transference" > {{ 'BankTransference'|get_lang }}
</label>
{% endif %}
</div>
</br>
<input type="hidden" name="currency_type" value="{{ currency }}" />
<input type="hidden" name="server" value="{{ server }}"/>
<input type="submit" class="btn btn-success" value="{{ 'confirmar_compra'|get_lang }}"/>
</td></tr>
</table>
</form>
</div>
<input align="center" type="submit" class="btn btn-success" value="{{ 'confirm_order'|get_lang }}"/>
</div>
</fieldset>
</form>
<div class="cleared"></div>
</div>

@ -24,7 +24,7 @@
<div class="span">
<div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">
<img src="{{ server }}{{ course.course_img }}">
</a>
</div>
@ -40,7 +40,7 @@
<div class="cleared"></div>
<div class="btn-toolbar right">
<a class="ajax btn btn-primary" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">{{
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">{{
'Description'|get_lang }}</a>
</div>

Loading…
Cancel
Save