The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 03-01-2015, 01:05 AM
DMSDMS's Avatar
DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default


I am trying to get the method used to pay to show as text as we do for other details but it remains blank.

Example of the result:

Order Information:

Order: 6a2205v
Payment Method:
Buyer: testme@eomail.net
Created: 2015-02-27 03:14:00

Code:
$buffer .= 'Payment Method: ' . $paymentMethod . "\n";
Full code from file:

Code:
<?php
require_once('zenDesk.php');
require_once('ecwid.php');

if (!isset($_POST['owner_id'], $_POST['event_type'], $_POST['order_id'], $_POST['payment_status'])) {
    exit();
}

if ($_POST['event_type'] != 'new_order' || !($_POST['payment_status'] == 'ACCEPTED' || $_POST['payment_status'] == 'QUEUED')){
    exit();
}

$orderId = (int) $_POST['order_id'];
$res = getOrder($orderId);

if (!isset($res['orders'][0])) {
    exit();
}

$order = $res['orders'][0];

if (!($order['paymentStatus'] == 'ACCEPTED' || $order['paymentStatus'] == 'QUEUED')) {
    exit();
}

$containsOrder = false;
$link = new mysqli($SQL_LOCATION, $SQL_USERNAME, $SQL_PASSWORD, $SQL_DATABASE);

$email = $order['customerEmail'];
$vendorNumber = $order['vendorNumber'];

$categories = getCategories();

$buffer = file_get_contents('neworder.txt');
$buffer .= 'Order: ' . $vendorNumber . "\n";
$buffer .= 'Payment Method: ' . $paymentMethod . "\n";
$buffer .= 'Buyer: ' . $email . "\n";
$buffer .= 'Created: ' . $order['created'] . "\n\n";

foreach ($order['items'] as $item) {
    $pid = $item['productId'];
    $pid = $link->real_escape_string($pid);

    $result = $link->query("SELECT 1 FROM exclusions WHERE PID='$pid' LIMIT 1");
    $row = $result->fetch_row();
    $result->close();

    if ($row == null) {
        $containsOrder = true;
		
		$category = getCategoryName($categories, $item['categoryId']);
		$buffer .= 'Category: ' . $category . "\n\n";
		
        $buffer .= 'Name: ' . $item['name'] . "\n";

        foreach ($item['options'] as $option) {
		    if($option['type'] == 'FILE'){
				$buffer .= $option['name'] . ":\n";
				foreach ($option['value'] as $file) {
					$buffer .= $file['url'] . "\n";
 
				}
		    }elseif($option['type'] == 'CHECKBOX'){
$buffer .= "\n";
				$buffer .= $option['name'] . ":\n";
				foreach ($option['value'] as $check) {
					$buffer .= $check . "\n";

				}
$buffer .= "\n";
			}else{
				$buffer .= $option['name'] . ': ' . $option['value'] . "\n";
			}
        }

        $buffer .= 'Quantity: ' . $item['quantity'] . "\n";
        $buffer .= 'Price: $' . $item['price'] . "\n";
        $buffer .= "\n";
    }
}

if (!$containsOrder) {
    exit();
}

if (isset($order['orderComments'])) {
    $buffer .= "Comments:\n";
    $buffer .= $order['orderComments'];
}

$custom = array(
    '21642072' => $vendorNumber,
);

createTicket($email, $vendorNumber . ' - Order Received:  Please reply/track your order here.', $buffer, $custom);

function getCategoryName($categories, $categoryId) {
    foreach ($categories as $cat) {
		if($cat['id'] == $categoryId){
			return $cat['name'];
		}
	}
	
	return 'Unknown Category';
}

?>
bump

Last edited by Clara K; 03-02-2015 at 03:02 PM.
  #2  
Old 03-02-2015, 03:35 PM
DMSDMS's Avatar
DMSDMS DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default

Going to assume Clara has no clue what "bump" means.

Instead of editing my post to include a comment used to put it to the front as it has been unanswered, please get someone from staff to answer it.
  #3  
Old 03-02-2015, 05:04 PM
Clara K's Avatar
Clara K Clara K is offline
Ecwid Team
 
Join Date: Nov 2014
Posts: 655
Default

Dear Dustin,

Thanks a lot for your message!

I am very sorry that merging your posts looked confusing.

Please let us know what you would like to achieve using this script so that we could help you.

Thank you!
__________________
Clara
Ecwid Customer Care Team

Help Center


⬇ Please click Thanks if my reply helped you.
  #4  
Old 03-02-2015, 05:35 PM
DMSDMS's Avatar
DMSDMS DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default

I would like to achieve what both the title and post indicate.

For it to show the payment method using $paymentMethod...
  #5  
Old 03-04-2015, 07:22 AM
Clara K's Avatar
Clara K Clara K is offline
Ecwid Team
 
Join Date: Nov 2014
Posts: 655
Default

Quote:
Originally Posted by dustinmsigmon View Post
I would like to achieve what both the title and post indicate.

For it to show the payment method using $paymentMethod...
Hello!

I am very sorry, but I am afraid I still do not understand what you are trying to achieve with this script.

Could you please provide us with more details about where this script will be placed, what it should do and what is the final goal of it? This will help a lot.

Thank you!
__________________
Clara
Ecwid Customer Care Team

Help Center


⬇ Please click Thanks if my reply helped you.
  #6  
Old 03-04-2015, 07:23 AM
DMSDMS's Avatar
DMSDMS DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default

Just escalate this to engineering as anyone that created your own api would understand this post.
  #7  
Old 03-04-2015, 07:39 AM
DMSDMS's Avatar
DMSDMS DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default

I find it worrisome you asked "where this script will be placed, what it should do and what is the final goal of it? " when all 3 are in the post.

1) where this script will be placed: A web server to use the api to show the payment method.

2) what it should do: Display the payment method

3) and what is the final goal of it: To display the payment method.

I suggest re-reading the actual post as both the example and full script was provided. All methods work to display text except the payment method. I should not have to be explaining this (again).

Please just have someone that knows your api look at this and stop trying to ask questions when the answers are provided in the post.

I know this may come off as rude but I have now waited 3 days for something that I assume has not even been passed to someone on your team for it to be answered.
  #8  
Old 03-04-2015, 02:08 PM
Clara K's Avatar
Clara K Clara K is offline
Ecwid Team
 
Join Date: Nov 2014
Posts: 655
Default

Dear Dustin,

Thanks a lot for your messages!

As far as I can see, you are creating a custom script using Ecwid API.

API offered by Ecwid may be used for customizing Ecwid and extending its basic functionality according to your needs.

One can develop various modules and plugins to implement a great variety of features becoming enabled by means of API integration. Please find more information here: http://api.ecwid.com/#using-ecwid-api
In fact, such a task as creating a custom script that will be using API is strictly about programming. It goes to people who possess special education, knowledge in IT, practical programming skills and experience. To be able to do this people have to study this area for several years.

I am afraid, we cannot check your script for possible errors as this is a custom solution and not a part of Ecwid. We suggest that you contact a professional programmer regarding this matter.
__________________
Clara
Ecwid Customer Care Team

Help Center


⬇ Please click Thanks if my reply helped you.
  #9  
Old 03-04-2015, 03:25 PM
DMSDMS's Avatar
DMSDMS DMSDMS is offline
 
Join Date: Mar 2011
Posts: 52
Default

I did not ask you to check the script for errors. I supplied it to show it being used in the way your documentation states to.

Confirm that after 3 days you actually forwarded this to your engineers so they can confirm the $paymentMethod works correctly in their own test environment.
  #10  
Old 03-04-2015, 07:36 PM
Thematizr.com's Avatar
Thematizr.com Thematizr.com is offline
Webpartner
 
Join Date: Jul 2012
Posts: 379
Default

Are you using that script to respond to ION notifications?
__________________
Check out our latest ready-made designs for Ecwid:

Termion | Helata | Martina

Get 1 year of access to all our current and future themes.

Follow us on Twitter: @thematizr
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:41 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.