PDA

View Full Version : Four digits from credit card number?


EvanB
08-23-06, 09:23 PM
I'm new here and this might be in the wrong section of the forum, if it is, please move it :)

For the last six hours or so I've been trying to figure out a way to display only the last four digits of the credit card number on the invoice. I can do the entire credit card number in a textbox, which I thought was okay, but was later shot down as this was seen as a security risk.

Anyways, I've finally located g.MOD10_CardNumber, which contains the credit card number in numerical form. I know this sounds silly, but I'm pretty new to Miva and can't get the variable's value to a local variable. I need to do this in order to (I believe) substring it and cut out the first 11 or 12 digits. Please let me know if there's a way to do this, and if there is, how. Thanks much in advance.

PCINET - Andreas
08-23-06, 09:31 PM
What Miva version are you using?

EvanB
08-23-06, 09:35 PM
Miva version 5.04

Vic - WolfPaw Computers
08-23-06, 09:37 PM
Are you using OpenUI? And as Andreas asked, what version of Merchant?

I'm new here and this might be in the wrong section of the forum, if it is, please move it :)

For the last six hours or so I've been trying to figure out a way to display only the last four digits of the credit card number on the invoice. I can do the entire credit card number in a textbox, which I thought was okay, but was later shot down as this was seen as a security risk.

Anyways, I've finally located g.MOD10_CardNumber, which contains the credit card number in numerical form. I know this sounds silly, but I'm pretty new to Miva and can't get the variable's value to a local variable. I need to do this in order to (I believe) substring it and cut out the first 11 or 12 digits. Please let me know if there's a way to do this, and if there is, how. Thanks much in advance.

Vic - WolfPaw Computers
08-23-06, 09:39 PM
That woudl be your Miva VM Engine version, the version of Merchant is likely PR2.

I would invest in Weiland's Toolkit module (http://www.emporiumplus.com/merchant2/merchant.mvc?Screen=PROD&Store_Code=wcw&Product_Code=1AA00223), which will then let you evaluate the database variable and substring it out to display the last 4 digits.

EvanB
08-23-06, 09:47 PM
Thank you, Vic. I'll go ahead and check that out. If anyone else has a possible solution, please let me know. I really just need to substring g.MOD10_CardNumber to chop off the first 12 digits. If the tool kit's the best way, then we'll go with it :) Thanks again, and if you have another solution, please post it.

dreamingdigital
09-01-06, 05:37 PM
Couldn't you go like this? We'll put the CC num into a hidden form field because miva likes to give errors if you directly assign mvt's to javascript variables.

<form name="cc_form">
<input type="hidden" name="cc_num" value="&mvt:g.MOD10_CardNumber;">
</form>

<script type="text/javascript">
var the_cc_num = document.cc_form.cc_num.value;
if (the_cc_num != "") {
the_cc_num = the_cc_num.substring(7);
document.write("XXXX XXXX XXXX " + the_cc_num)
}
</script>

I didn't test it personally but we'll probably use something like that too. I just haven't templated that far yet. I may use my almost fav module that lets me parse and pass vars to PHP files to do it instead. I'm sure after I post this somebody will post a "real miva" way of doing it. I got the ball moving anyways.

Bruce - PhosphorMedia
09-05-06, 01:17 AM
except that relies on JS, which is not reliable.

dreamingdigital
09-15-06, 09:41 PM
Ok, I agree, using Javascript is a HACK.

So lets do it the mivascript way. But how?

I looked at the SMT doc page http://docs.smallbusiness.miva.com/en-US/merchant/5/webhelp/store_morph_technology_(smt)_-_working_with_page_templates.htm and found tools for "IN" and "EIN" wich are good but they just return a number. That's half the battle. Where's the string function to use it with?

I'm guessing it's not possible unless you use WCW's toolkit.

Vic - WolfPaw Computers
09-15-06, 10:17 PM
Look in the MIVA Script docs for glosub

dreamingdigital
09-16-06, 12:46 AM
I don't want to seem stupid but this is really difficult. Maybe I don't have the patience for this game. I've tried all afternoon and I'm wasting my time. I know people know how to do this. I've tried my best and failed miserably! Please can somebody just supply some code. Please?


<mvt:item name="ads-extfile" param="mvassign|l.all_settings:hello_world|l.all_settings :product:name|SUBSTR|'1,10')" />

<mvt:if expr="l.settings:hello_world">
&mvt:hello_world;
<mvt:else>
failed
</mvt:if>


I was able to create a variable and assign something to it but that's it. I can't do the substr or glosub's required to pull just part of the variable out and then display it on the screen.