Jump to content

Recommended Posts

Hi

 

This is my first so i would like to say hello. I am a novice when it comes to php code and i am just trying to get my head around a few things. So i have set a shop and got everything sorted but i need to put more information in a payment confirmation email that we receive after an order is placed. At the moment we receive this:

 

The status of payment {$PAYMENT_ID} for order {$ORDER_ID} changed.

 

I located the code so i could go about adding parameters to the code so that i get the payment id,order id (which is already there) but i also wanted the product name and amount. So i tried adding {$PRODUCT_NAME} like this and also amount like this {$PRICE}. But anything i tried when i made a test purchase just showed up as code. But the payment and order id showed up fine. What am i doing wrong? If anyone could help that would great.

<?php

if ( !function_exists('tep_href_link') ) {
require_once(DIR_WS_FUNCTIONS . 'html_output.php');
}

if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_TEXT_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_TEXT_TITLE', 'Payone');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_TEXT_DESCRIPTION')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_TEXT_DESCRIPTION', '<b>PAYONE Payment Module</b><br />'.(defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS') && strtolower(constant('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS'))=='true'?'(<a style="color:red" href="'.tep_href_link('payone_trans.php?method='.strtolower($sMethod)).'">Show Transactions</a>)<br />':''));
}

if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod->_sCMethod .'_EXTCOST')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_EXTCOST', 'Schipping, Discounts, Surcharges');
}

if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ERROR_HEADING')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ERROR_HEADING', 'Error:');
}

if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS_TITLE', 'Enable PAYONE Module');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ALLOWED_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ALLOWED_TITLE' , 'Allowed Zones');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ZONE_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ZONE_TITLE', 'Payment Zone');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ICONS_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ICONS_TITLE', 'Icons');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_API_URL_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_API_URL_TITLE', 'PAYONE API URL');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MID_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MID_TITLE', 'PAYONE MID');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_FE_URL_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_FE_URL_TITLE', 'PAYONE Frontend URL <font color="ff0000">* Required</font>');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PORTALID_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PORTALID_TITLE', 'PAYONE PortalID <font color="ff0000">* Required</font>');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AID_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AID_TITLE', 'PAYONE AID <font color="ff0000">* Required</font>');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_KEY_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_KEY_TITLE', 'Merchant key <font color="ff0000">* Required</font>');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_REQUEST_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_REQUEST_TITLE', 'Instant Capture');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MODE_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MODE_TITLE', 'Operation Mode');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SEND_CART_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SEND_CART_TITLE', 'Send Shopping Cart');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_NAME_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_NAME_TITLE', 'Display Name');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_ADDRESS_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_ADDRESS_TITLE', 'Display address');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AUTOSUBMIT_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AUTOSUBMIT_TITLE', 'AutoSubmit option');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PAYTO_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PAYTO_TITLE', 'Note to customer');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_NOTIFY_MAIL_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_NOTIFY_MAIL_TITLE', 'Notification e-mail');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ORDER_STATUS_ID_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ORDER_STATUS_ID_TITLE', 'Set Order Status');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SORT_ORDER_TITLE')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SORT_ORDER_TITLE', 'Sort order of display');
}


if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_STATUS_DESC', 'Do you want to accept PAYONE payments?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ALLOWED_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ALLOWED_DESC' , 'Please enter the zones <b>separately</b> which should be allowed to use this modul (e. g. AT,DE (leave empty if you want to allow all zones))');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ZONE_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ZONE_DESC', 'If a zone is selected, only enable this payment method for that zone.');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ICONS_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ICONS_DESC' , 'Please enter the icons <b>separately</b> which should be displayed using this module (e. g. icon1.gif,icon2.gif )');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_API_URL_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_API_URL_DESC', 'Please enter PAYONE FinanceGate API Channel URL');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MID_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MID_DESC', 'Your MerchantID at PAYONE');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_FE_URL_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_FE_URL_DESC', 'Please enter PAYONE FinanceGate Frontend URL');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PORTALID_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PORTALID_DESC', 'Your PortalID at PAYONE');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AID_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AID_DESC', 'Your AccountID at PAYONE');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_KEY_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_KEY_DESC', 'Your own Merchant Key');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_REQUEST_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_REQUEST_DESC', 'Select if you just want to make a preauthorization or a direct authorization?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MODE_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_MODE_DESC', 'The mode you are working in (test = Test Mode, live = Live Payment');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SEND_CART_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SEND_CART_DESC', 'Send the shopping cart contents to the payment gateway?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_NAME_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_NAME_DESC', 'Show the customers name in the payment window again?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_ADDRESS_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_DISPLAY_ADDRESS_DESC', 'Show the customers address in the payment window again?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AUTOSUBMIT_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_AUTOSUBMIT_DESC', 'Do you want to AutoSubmit payments?');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PAYTO_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_PAYTO_DESC', 'Type here notice that will be displayed to the customer after successfull payment.<br> Use {\$txid} to display real transaction id.');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_NOTIFY_MAIL_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_NOTIFY_MAIL_DESC', 'Type here email you want to send to payment status change information.');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ORDER_STATUS_ID_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_ORDER_STATUS_ID_DESC', 'Set the status of orders made with this payment module to this value');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SORT_ORDER_DESC')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_SORT_ORDER_DESC', 'Sort order of display. Lowest is displayed first.');
}

if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_SUBJECT')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_SUBJECT', 'Payone new status');
}
if (!defined('MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_TEXT')) {
 define('MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_TEXT', '
Dear Administrator,

The status of payment {$PAYMENT_ID} for order {$ORDER_ID} changed.

Old status: {$PAYMENT_STATUS_OLD}
New status: {$PAYMENT_STATUS_NEW}
');
}
?>

The last few lines from dear Administrator is where i want to add parameters for the name of a product and the price. Thanks.

I think this is vague. Are you using an API? Maybe there is an option/function there to get an array object of the cart / cart.

If not maybe you can use the order id or the payment id to dig into the database to search for the related products / product name.

Your webshop system wouldn't happen to be OSC or ZenCart, would it?

 

In any case, you'll need to find the function that uses the MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_TEXT constant (whatever $sMethod is), and then check to see if it uses the E-Word. If it does, then it'll need to have the two variables defined and accessible from the calling function, if not then you'll need to figure out how to add them to the context that parses the e-mail.

Your webshop system wouldn't happen to be OSC or ZenCart, would it?

 

In any case, you'll need to find the function that uses the MODULE_PAYMENT_PAYONE_'. $sMethod .'_EMAIL_TEXT constant (whatever $sMethod is), and then check to see if it uses the E-Word. If it does, then it'll need to have the two variables defined and accessible from the calling function, if not then you'll need to figure out how to add them to the context that parses the e-mail.

 

Yes it is Osc. Thankyou for your answers but i really am not too sure where to go and dig into the files. The module that this is from is an add-on and there is only a few files that came with it. I have had alook through them but i have not come across anything that is relevent. The code i posted here is the sourcecode of the module. Thanks again for your answers.

If this is indeed a new site, then drop OSC right now. Use something that's not 10+ years out of date instead, and you'll find that your job becomes a whole lot easier. Magento is, apparently, a very popular and good alternative today.

 

Even ZenCart is better than OSC, though that's not saying a whole lot to be honest.

Osc was recommended to me. The shop is on a sub domain so changing would not be a problem it is just a time issue as it took me so long to set it up how it is with it been my first go. I would have to choose one that my merchant has a module for but i could see myself changing in the future.

OSC was outdated the last time I worked with it, and it was 8 years ago. So whomever recommended it to you can't have paid much attention to things, or perhaps they only knew about OSC. In either case, I'd verify any advice that person gave with a third party.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.