Jump to content

Problematic value gathering in custom payment module


disgruntled

Recommended Posts

Hello, Im trying to modify the standard bank transfer payment module.

 

What i am doing is setting up a standing order specific module gives direct instructions on the invoice of what the client needs to do.

 

So, on the invoice the client gets the information that comes from the standingorder_link() function within the payment module.

 

So far so good i have manages to edit it to display the following.

 

Bank name: mybank

Account name: mycompany

Account No: ********

Sort Code: **-**-**

First Payment: (cant get this to show)

Second Payment: (not got to this yet)

Payment frequency: monthly

 

If you have set up a standing order using online banking you will know for the most part they ask you for various things i will lost below, so it is important that i can provide all these bits of information even if they then just head to the bank and ask them to do it.

 

Bank name

Account: name, number and sort code

First payment: date and amount

Second payment: date and amount

Payment frequency

 

So, To get to my point now that i have explained what i am doing exactly. here is the code below for what i have so far. ive broken it into smaller chunks here for readability but $code is actually on one line.

 

I need some help in pulling up the invoice date. I cant seem to figure, is it to come from the template. If so i need to $smarty->tpl_var[] in the function or, is it in $params[]. Either way i am stuck, i dont know what its named in either case

 

Code from whmcs 5.1.3

function standingorder_link($params) {

global $smarty;   
global $_LANG;    
$code = '<p>Please contact your bank/building society to make the arrange payment<br /><br />'

. nl2br($params['instructions']) . '<br />

First Payment: ' . $params['invoiceduedate'] . '<br />

Second Payment: <br />

Payment Frequency: Monthly <br />' 

. $_LANG['invoicerefnum'] . ': '.$params['invoiceid'] . '<br />

</p>'; 
return $code;
}

Edited by disgruntled
Added version Info
Link to comment
Share on other sites

Take a look at this post:

http://forum.whmcs.com/showthread.php?69482-5-2-1-feedback&p=300658#post300658

 

They moved the smarty variable in the client area - part of some ongoing code refactoring apparently. Anyway, they made retrieving the variables near impossible - the solution I'm using is only a stop gap for my customers for the moment, and requires PHP 5.3 or higher unfortunately.

Link to comment
Share on other sites

Thank you for your reply. I guess i am going to have to fall back onto some good old php/mysql grunt work.. and here was me thinking with whmcs using smarty those days were numbered.

 

Never mind. I will take a look at that post and thanks again.

 

 

 

EDIT: I just updated the first post with the version info, it seems the post your refering to isnt affecting mine, im not on 5.2 yet and until they fix the problems i wont be.

Edited by disgruntled
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated