Post BillPay Barcode - Calculating code
I am trying to create a Barcode, I have the following variables
Order Total: $25.35
Customer Number: 6
What I need:
Order Total: I need to take the order total convert it to cents and make it fixed 9 digit (000002535)
Customer Number: I need the Customer number to become a fixed 6 digits (000006)
083215<Order Total>100415556<Customer Number>80
will read
0832150000025351004155560000680
Thanks
Re: Post BillPay Barcode - Calculating code
Fine, so where are you facing the problem?
Re: Post BillPay Barcode - Calculating code
i don't know how to use php to convert the amount into cents and have 9 digits (ie $25.35 into 000002535) and get the customer number into a 6 digit number (ie 6 into 000006)
Re: Post BillPay Barcode - Calculating code
Code:
<?
$order_total=25.35;
$customer_number="6";
$len=strlen($customer_number);
$zeros="";
$modified_order_total=$order_total*100;
if($len<6)
{
for($i=6;$i>$len;$i--)
{
$zeros.="0";
}
}
$customer_number=$zeros.$customer_number;
$len=strlen($modified_order_total);
if($len<9)
{
for($i=6;$i>$len;$i--)
{
$zeros.="0";
}
}
$modified_order_total=$zeros.$modified_order_total;
$final_string="083215"."$modified_order_total"."100415556".$customer_number."80";
echo $final_string;
?>
Re: Post BillPay Barcode - Calculating code
This may be a lot to ask, but how do i go about creating a payment module with the ordter total being used from the check out and the customers id number being used, but then having the outcome (ie 083215<Order Total>100415556<Customer Number>80) producing an imahge using this sting
http://www.java4less.com/barcodes/1D/php/demo.php?GENERATE=1&CODETYPE=CODE39&CODE=100415556<Customer Number>80&CHECK_CHAR=N&IMG_TYPE=PNG&I=1&SUPPLEMENT=0&UPCE_SYSTEM=0&ROTATE=0&X=1& N=2&BAR_HEIGHT=50&QUITE_ZONE=10&BACK_COLOR=WHITE&BAR_COLOR=BLACK&FONT_COLOR=WHIT E&TEXT_FONT=DEFAULT-3&TEXT_SIZE=0&.
I am willing to pay you if you are able to do this for me.
please email me [email protected] to arrange this if you wish to proceed
Re: Post BillPay Barcode - Calculating code
I have sent you an email
Thanks