Purchase Order Form Issues

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
ImmortalLogic
Lieutenant (LT)
Lieutenant (LT)
Posts: 61
Joined: Tue May 11, 2010 9:29 am

Purchase Order Form Issues

Post by ImmortalLogic » Mon Jan 04, 2016 11:33 am

Working with Able Gold 10, how can I include additional fields from my form in the Account Data for the PurchaseOrderPaymentForm.ascs.cs? The AccountData only seems to store the Purchase Order Number. What do I need to set to append additional fields to AccountData. Also is this account data a field in Payments (AccountDataEncrypted)? As you can see by my posts, I have had a rough time with this store.

In GetPayment() I have:


..... code....

AccountDataDictionary instrumentBuilder = new AccountDataDictionary();
PurchaseOrderNumber.Text = StringHelper.StripHtml(PurchaseOrderNumber.Text);
instrumentBuilder["PurchaseOrderNumber"] = PurchaseOrderNumber.Text;
payment.ReferenceNumber = PurchaseOrderNumber.Text;

BankName.Text = StringHelper.StripHtml(BankName.Text);
instrumentBuilder["BankName"] = BankName.Text;

BankAccount.Text = StringHelper.StripHtml(BankAccount.Text);
instrumentBuilder["BankAccount"] = BankAccount.Text;

BankPhoneNumber.Text = StringHelper.StripHtml(BankPhoneNumber.Text);
instrumentBuilder["BankPhoneNumber"] = BankPhoneNumber.Text;

TaxID.Text = StringHelper.StripHtml(TaxID.Text);
instrumentBuilder["TaxID"] = TaxID.Text;

payment.AccountData = instrumentBuilder.ToString();
return payment;

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Purchase Order Form Issues

Post by mazhar » Wed Jan 06, 2016 5:32 am

Also is this account data a field in Payments (AccountDataEncrypted)?
Yes in AccountData simply serves the decrypted contents from AccountDataEncrypted field in payments table.
how can I include additional fields from my form in the Account Data for the PurchaseOrderPaymentForm.ascs.cs
It should be very easy to add custom data since AccountDataDictionary is a dictionary structure. You can add new fields into dictionary by doing something like this

Code: Select all

instrumentBuilder["CustomField"] = "Custom Value Here";
when reading all you need to do is

Code: Select all

AccountDataDictionary instrumentBuilder = new AccountDataDictionary(payment.AccountData);
string value = instrumentBuilder.GetValue("CustomField");

User avatar
ImmortalLogic
Lieutenant (LT)
Lieutenant (LT)
Posts: 61
Joined: Tue May 11, 2010 9:29 am

Re: Purchase Order Form Issues

Post by ImmortalLogic » Thu Jan 07, 2016 12:22 pm

My problem is that I am not able to view the field results in the database. My PurchaseOrderPaymentForm as several fields but it doesn't appear that anything is added to the instrumentBuilder other than the default field, PurchaseOrderNumber (PurchaseOrderNumber.Text). The results from my custom fields are not added. When I view the Account Details (within the Admin) under Order - Payments (Default.aspx), I see the Purchase Order Number, but that is it. I know I must be missing something.

Thanks

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Purchase Order Form Issues

Post by jmestep » Thu Jan 07, 2016 11:27 pm

If you are going to want it to display for admins only, you could try intercepting the purchase order number and tacking information on to it.
instrumentBuilder["PurchaseOrderNumber"] = PurchaseOrderNumber.Text + "whatever";
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Purchase Order Form Issues

Post by jguengerich » Fri Jan 08, 2016 5:00 am

Make sure your code to save the fields in PurchaseOrderPaymentForm is running by using the debugger or by writing message() to the error log. You could check the AccountData field (i.e. see if all the dictionary entries are there) right before the "return Payment" statement, and right before the redirect to the receipt page.
What code are you using in Order/Payments/Default.aspx.cs to retrieve the fields?
Jay

User avatar
ImmortalLogic
Lieutenant (LT)
Lieutenant (LT)
Posts: 61
Joined: Tue May 11, 2010 9:29 am

Re: Purchase Order Form Issues

Post by ImmortalLogic » Fri Jan 08, 2016 12:16 pm

Thanks for your help. However, it appears that the file PurchaseOrderPaymentForm.ascs.cs which includes GetPayment() isn't functioning? I have commented out the code, even removed the file (the mobile and even the file in the Admin, and the back up files) and it still processes the PO number entered into the form. How is the Purchase Order Number entered into PurchaseOrderNumber.Text maintained? I ran a query on the Payments and the AccountDataEncrypted still has the Purchase Order Number. So, what is holding on to this entry and how is it sent to the database? I cannot see any associated files for it.

As of now, I am trying to see where it is going instead of actually reading it. With the debugger, there are no errors related to this issue.

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Purchase Order Form Issues

Post by jguengerich » Fri Jan 08, 2016 12:47 pm

Are you using the Web Application Project (WAP) or the Web Site Project (WSP)? If you are using the WAP, I think you need to recompile the project after you make changes. I only use the WSP, so I can't provide any help beyond that for the WAP. If you are using the WSP, it certainly shouldn't keep working if you remove the file. Are you sure you are editing the files in (or copying the edited files to) the location they are being served from?
Jay

User avatar
ImmortalLogic
Lieutenant (LT)
Lieutenant (LT)
Posts: 61
Joined: Tue May 11, 2010 9:29 am

Re: Purchase Order Form Issues

Post by ImmortalLogic » Tue Jan 12, 2016 12:40 pm

Are you using the Web Application Project (WAP) or the Web Site Project (WSP)?
I am using the WSP version.

I have checked the PurchaseOrderPaymentForm.ascx.cs in
\Mobile\
\Admin\
\Conlib\ <---- is the appropriate directory as I am performing transactions as a "customer" for testing. The form looks fine, but not sure where the data is going.

Anyone else run into this issue?

Post Reply