X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Last Four of Credit Card in Invoice Emails (https://forum.x-cart.com/showthread.php?t=46089)

GFaulkner 01-21-2010 10:54 AM

Re: Last Four of Credit Card in Invoice Emails
 
I am trying to do a similar thing with the credit card number. Can you send over your finalized code that works?

Thanks,
Greg

rshandel 01-26-2010 08:26 AM

Re: Last Four of Credit Card in Invoice Emails
 
In payment_cc.php

Replace code between



#
# Make order details
#


and
#
# Only logged users can submit orders
#


with this:
Code:


#rs
            $store_card_number=$card_number;
            $card_number = substr($card_number,-4);
#/rs
$_order_details_rval = array();
foreach (func_order_details_fields() as $_details_field => $_field_label) {
    if (isset($GLOBALS[$_details_field])) {
        $_order_details_rval[] = $_field_label.": ".stripslashes($GLOBALS[$_details_field]);
    }
}
#rs
        $card_number = $store_card_number;
#/rs
$order_details = implode("\n", $_order_details_rval);

$customer_notes = $Customer_Notes;



Then after
#
# If successful - Store CC number in database
#

add
Code:

#rs
$new_card_number==substr($card_number,-4);
#/rs


Find
Code:

            "card_number" => addslashes(text_crypt($card_number)),


Replace with:
Code:


            #"card_number" => addslashes(text_crypt($card_number)),
#rs
            "card_number" => addslashes(text_crypt($new_card_number)),
#/rs


In payment_ccend.php:

add

Code:

  #rs
            $store_card_number=$card_number;
            $card_number = substr($card_number,-4);
  #/rs



after

Code:


if ($bill_error) {
    $request = $current_location.DIR_CUSTOMER."/error_message.php?".$sessurl."error=".$bill_error.$reason;
}
else {



add

Code:

  #rs 
            $card_number = $store_card_number;
  #/rs 



after

Code:


    if (!empty($active_modules['SnS_connector'])) {
        func_generate_sns_action("CartChanged");
    }


Good luck!


All times are GMT -8. The time now is 12:52 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.