Announcement

Collapse
No announcement yet.

Downloading order payment information

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Brennan
    replied
    Re: Downloading order payment information

    Here is a sample batch report to get you started.


    It assumes all your orders have the same payment type. If you accept paypal or POs or something like that, this breaks down because it will always pull the header row from the first order in batch report




    Code:
    <mvt:assign name="g.comma" value="asciichar(44)" />
    <mvt:assign name="g.new_line" value="asciichar(10)" />
    
    
    <mvt:foreach iterator="order" array="admin_order:orders">
    
    
    	<mvt:if expr="l.pos1 EQ 1">
    		<mvt:foreach iterator="field" array="order:payment:fields">
    			&mvt:field:label;&mvt:global:comma;
    		</mvt:foreach>
    		&mvt:global:new_line;
    	</mvt:if>
    
    
    
    
    	<mvt:foreach iterator="field" array="order:payment:fields">
    		&mvt:field:value;&mvt:global:comma;
    	</mvt:foreach>
    	&mvt:global:new_line;
    
    
    </mvt:foreach>

    This should output a single header row followed by the payment data for each order. Here is a sample output


    Code:
    
    Card Type:, Name on Card:, Card Number:, Expiration Date:, 
    Visa, Brennan Heyde, 4111111111111111, 2/2015,
    Visa, Test Order, 4111111111111111, 2/2015,

    To get it to output to a csv file, go to items, then assign the http_headers item.


    Then within that tab add the following two headers:


    Content-Type text/csv
    Content-Disposition attachment; filename="payment_export.csv"

    Leave a comment:


  • chetv
    replied
    Re: Downloading order payment information

    Brennan,
    Thanks again for the additional info. One of the problems we are having is entering your suggested statements for export in the proper fields. There are 2 fields in each of 2 lines but you wrote only 2 line statements and I can't figure out how to break them up. I tried several different combinations noting seemed to effect the exporting of data. Each time I only got the invoice printing on the screen. One time I did get something to download but it was a .mvc file so I discarded it. Please give us some more details in this area.
    Thanks,
    Chet

    Leave a comment:


  • Brennan
    replied
    Re: Downloading order payment information

    Hey Guys -

    I got some clarification from development. l.settings:order:pay_data used to be available up until the payment data got split out into its own table (for PCI reasons)

    That variable is no longer available on INVC or anywhere in runtime. The reason you are seeing it in the admin, is because there is a compatibility layer the code in the admin is using and it is able to access that data.

    The batch report is going to be the best way to access the data you need. Because the batch report is running it admin, it is able to access the payment data you need. But I wouldn't access that variable directly. It is going to be easier to use the available payments array to loop though the available payment data.
    Last edited by Brennan; 06-11-14, 09:00 AM.

    Leave a comment:


  • lesliekirk
    replied
    Re: Downloading order payment information

    I have changed the token to l.all_settings:order:pay_data per Bill's post and still nothing in the export. I am sooooo baffled as to why I can see what should be in the export when I use the VAR LIST. I can enter in an Order Number and BOOM, there is what should be in that field clear as day.

    Part of my confusion comes from trying to figure out how to use Brennan's suggestion to discover what token is needed instead of the l.all_settings:order:pay_data token.

    As Chet has asked previously, when he peeks inside his database and finds that there isn't any PAY_DATA field in the Orders. He's finding it in the OrderPayments. So is there a different token that Chet needs?

    Leslie

    Leave a comment:


  • chetv
    replied
    Re: Downloading order payment information

    Hi Brennan,

    Leslie and I have playing around with this export idea for a few days without success. Maybe if I make a simple request you can give us the answer. Instead of printing an order invoice can you just help us get an export of the invoice in something we can open in Excel, like csv. Everything I need is on the invoice.

    I know I don't have the export function working correctly per my previous post. You have got us close but no cigar!

    Leave a comment:


  • lesliekirk
    replied
    Re: Downloading order payment information

    If the data were encrypted would I have been able to see it when I looked at on the page using the Token List the way I did? Just wondering...

    Leave a comment:


  • wcw
    replied
    Re: Downloading order payment information

    In the export it is l.all_settings:order:pay_data, not l.settings:order:pay_data

    If the payment module puts non-encrypted data in that non-encrypted field, it should be showing in the export. It will not export encrypted data.

    Leave a comment:


  • lesliekirk
    replied
    Re: Downloading order payment information

    What is baffling me even more, is if I use the built-in Token List, I find the l.settings:order:pay_data and an entry for a specific order. I just don't understand why the something like =VI is not being pulled into the export. It should be noted that l.settings:order:pay_data is included in the tk_template_order_export.txt file that Bill provided in his example.

    Okay, I'm going to try and use Brennan's token in it's place....

    Leave a comment:


  • lesliekirk
    replied
    Re: Downloading order payment information

    Brennan, would Chet be able to use your tokens in place of the ones that are not working for him?

    Code:
    l.all_settings:order:pay_data
    is not pulling in the basic payment data into the Emporium Plus Tool Kit Template Order Export he has previous created.

    I'm "thinking" your example is to help him determine what to use in place of the non-working pay_data token.


    I have a question for Bruce (if you are following along) - would the Merchant Inspector help ferret out the exact tokens he would need based on his payment gateway?

    Leslie

    Leave a comment:


  • lesliekirk
    replied
    Re: Downloading order payment information

    I'm used my moderator foo and inserted the image Chet is referring to.

    Leslie

    Leave a comment:


  • chetv
    replied
    Re: Downloading order payment information

    Brennan,

    After trying out your suggestion and reading the invoice code I realized it would be easier to export the entire invoice data and save me the effort of my separate export we that we are already using. I need bill to; ship to; order content; shipping anyway. I tried your suggestion and tried to export the entire invoice but my lack of code writing is stopping me.

    export_order_info.jpg

    I did the assign, but am having trouble getting the export to work because I don't understand how I am to fill in HTTP headers. I tried attaching jpg or pdf but couldn't get it to work. Used Chrome. What goes in left box, what in right?
    Last edited by lesliekirk; 06-10-14, 04:03 AM.

    Leave a comment:


  • chetv
    replied
    Re: Downloading order payment information

    Brennan,
    Thanks, will try.

    Chet

    Leave a comment:


  • Brennan
    replied
    Re: Downloading order payment information

    The best way to do this is going to be to create batch report to output the data to a CSV. Miva does have this data saved in its database and a batch report is going to be the easiest way to get to it, especially if it is encrypted.

    If you go to manage orders and select a few orders then click the batch report button, choose Printable Invoice. This will give you an page you can print out, however it also has the payment data you are looking for. (It may ask you to put in your encryption key if you have order encryption turned on.

    What you would need to to is create a new batch report (Under Utilities) that only out the payment data you need as a comma separated list. If you look at the batch report code there is a foreach loop which loops through the payments array.

    Here is a simplified version of it:

    Code:
    <mvt:foreach iterator="field" array="order:payment:fields">
    	&mvt:field:label;
    	&mvt:field:value;
    </mvt:foreach>
    There is a field label and a field value. You most likely want the field label as a column header so you may need to see what data is available from Chase and use those as column headers.


    Once you have the report outputting data in the format you need, you can change the header value to force the report to output the file as a csv to download. To do that go to the Item Tab on the batch report page template you are creating and assign the http_headers item to the page.

    Then within that tab add the following two headers:

    Content-Type text/csv
    Content-Disposition attachment; filename="payment_export.csv"


    Hope this helps.

    Leave a comment:


  • Nerd Boy Inc
    replied
    Re: Downloading order payment information

    Dear Chet,

    Not know the inside the Payment Module you are using, I would guess yes, all of it should be in the databases somewhere.

    Leave a comment:


  • chetv
    replied
    Re: Downloading order payment information

    Yes I forgot to state we are using Chase Paymentech. We have the ability to import with a cross reference to coded data as long as the coding is consistent.

    I am going by what is available in manage orders. If it shows up in manage orders it has to be stored somewhere in my database, I assume?

    Leave a comment:

Working...
X