Jump to content

does this conform with standard and will it break


pcmad

Recommended Posts

i am trying to build a payment gate way library do you think this is the best way of going about it

 

requirements

code to be flexible for different naming conventions

to conform with standards

not to break

 

why i am thinking of doing it this way

one application  could have for addressline1 as add_1 while i different app will have it as add_line_1

 

$test2 = "yay"; 
$test = 'a:1:{s:6:"teatme";s:5:"test2";}'; // think of this a a db field 
$test = unserialize($test);
echo"<pre style=\"text-align:left;\">";
print_r($test);
echo"</pre>";
foreach ($test as $key => $value)
{
    $test[$key] = $$value; 
}
echo"<pre style=\"text-align:left;\">";
print_r($test);
echo"</pre>";

please give us your thoughts

 

Link to comment
Share on other sites

no that wont work because

 

the that values and variables that will be stored back into the array eg

 

$test2 = "yay";

 

foreach

{

      $test[$key] = $$value;

becomes

      $test[$key] = $test2;

becomes

      $test[$key] = "yay";

}

 

 

Link to comment
Share on other sites

flexibility and uniformity

 

basicy the loop is populating the array with data from the application  but some applications might not have the same variables

 

once array it processed it will then be set off to a payment gate way

 

 

Link to comment
Share on other sites

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.