Floob Posted December 12, 2002 Posted December 12, 2002 Hi, I am trying to pass some variables to Protx. Can someone help with my syntax? $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&"; $plain .= "Currency=" . $currency . "&"; $plain .= "Description=" . STORE_NAME . "&"; $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&"; $plain .= "CustomerEMail=" . $order['customers_email_address'] . "&"; The green fields are passed and work fine. The orange field is passed, but with a value of STORE_OWNER_EMAIL as opposed to my actual email address. The red field is not even passed. Any ideas? I'd really appreciate any help. Cheers, Floob.
Aodhan Posted December 12, 2002 Posted December 12, 2002 Hi, I am trying to pass some variables to Protx. Can someone help with my syntax? $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&"; $plain .= "Currency=" . $currency . "&"; $plain .= "Description=" . STORE_NAME . "&"; $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&"; $plain .= "CustomerEMail=" . $order['customers_email_address'] . "&"; The green fields are passed and work fine. The orange field is passed, but with a value of STORE_OWNER_EMAIL as opposed to my actual email address. The red field is not even passed. Any ideas? I'd really appreciate any help. Cheers, Floob. Change it to this: $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&" . $plain .= "Currency=" . $currency . "&" . $plain .= "Description=" . STORE_NAME . "&" . $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&" . $plain .= "CustomerEMail=" . $order'customers_email_address'] . "&"; Basically, if you want to keep adding to a string, use the . at the end of each line. PHP will keep thinking this is a single line until it hits the ; at the end.
Aodhan Posted December 12, 2002 Posted December 12, 2002 Hi, I am trying to pass some variables to Protx. Can someone help with my syntax? $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&"; $plain .= "Currency=" . $currency . "&"; $plain .= "Description=" . STORE_NAME . "&"; $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&"; $plain .= "CustomerEMail=" . $order['customers_email_address'] . "&"; The green fields are passed and work fine. The orange field is passed, but with a value of STORE_OWNER_EMAIL as opposed to my actual email address. The red field is not even passed. Any ideas? I'd really appreciate any help. Cheers, Floob. Change it to this: $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&" . $plain .= "Currency=" . $currency . "&" . $plain .= "Description=" . STORE_NAME . "&" . $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&" . $plain .= "CustomerEMail=" . $order'customers_email_address'] . "&"; Basically, if you want to keep adding to a string, use the . at the end of each line. PHP will keep thinking this is a single line until it hits the ; at the end. Oops :oops: Take out the $plain .= from every line after the first.... Aodhan
mattice Posted December 12, 2002 Posted December 12, 2002 Basically, if you want to keep adding to a string, use the . at the end of each line. PHP will keep thinking this is a single line until it hits the ; at the end. Am I missing something here? So is using .= to extend a variable. There is no difference in your method or the original example posted except for coding style... : $this = 'foo'; $this .= '-bar'; echo $this; // output: foo-bar $this = 'foo' . '-bar'; echo $this; // output: foo-bar "Politics is the art of preventing people from taking part in affairs which properly concern them"
Aodhan Posted December 12, 2002 Posted December 12, 2002 Basically, if you want to keep adding to a string, use the . at the end of each line. PHP will keep thinking this is a single line until it hits the ; at the end. Am I missing something here? So is using .= to extend a variable. There is no difference in your method or the original example posted except for coding style... : True. Just as a personal preference, I like not using the variable name on each line. I thought there might have been something in with the ; statements that was interrupting the concatenation. Aodhan
Floob Posted December 12, 2002 Author Posted December 12, 2002 let me post a larger block: function process_button() { global $order, $currencies, $currency; $plain = "VendorTxCode=" . STORE_NAME . date('Ymdhis') . "&"; $plain .= "Amount=" . number_format($order->info['total'] * $currencies->get_value($currency), 2) . "&"; $plain .= "Currency=" . $currency . "&"; $plain .= "Description=" . STORE_NAME . "&"; [color=orange]$plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&";[/color] [color=red]$plain .= "CustomerEMail=" . $order['customers_email_address'] . "&";[/color] $plain .= "SuccessURL=" . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true) . "&"; $plain .= "FailureURL=" . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true); $crypt = base64Encode(SimpleXor($plain, MODULE_PAYMENT_PROTX_FORM_PASSWORD)); $process_button_string = tep_draw_hidden_field('VPSProtocol', '2.20') . tep_draw_hidden_field('TxType', 'PAYMENT') . tep_draw_hidden_field('Vendor', MODULE_PAYMENT_PROTX_FORM_VENDOR_NAME) . tep_draw_hidden_field('Crypt', $crypt); Issue lines highlighted. So can you see the problem?
Floob Posted December 12, 2002 Author Posted December 12, 2002 This is used within the scope of the protx form module if that helps. As I say from the above, the two that dont work are: $plain .= "VendorEMail=" . STORE_OWNER_EMAIL . "&"; $plain .= "CustomerEMail=" . $order['customers_email_address'] . "&"; Orange is passed, but with STORE_OWNER_EMAIL as the value Red doesnt even pass accross Thanks for any pointers Floob
Floob Posted December 12, 2002 Author Posted December 12, 2002 Ok - I fixed one. $plain .= "VendorEMail=" . STORE_OWNER_EMAIL_ADDRESS . "&"; Notice the ADDRESS at the end. I still have a problem with this one. $plain .= "CustomerEMail=" . $order['customers_email_address'] . "&"; Any ideas?
Ajeh Posted December 12, 2002 Posted December 12, 2002 Trying using $order->customer['email_address'] instead
Floob Posted December 12, 2002 Author Posted December 12, 2002 Thanks very much for your reply. I'll try it out. I thought the value was 'customers_email_address' because this is the field name in the database. Is that not the case?
Floob Posted December 12, 2002 Author Posted December 12, 2002 I tried it and it worked fine!!!!!!!!!!!!!!!!!! Thanks so much :D :D :D
Ajeh Posted December 12, 2002 Posted December 12, 2002 A lot of times, the variables drop off the first part of the field name. Also, never hurts to do a search on the key word (something kinda unique to it) in a field name just for giggles to see if that is the case. Glads things are now working for you. I have found the harder I have to bang my head against the keyboard the more likely it is that I have a typo or spelling error in a variable. :shock: php doesn't kill you for those errors ... it silently allows you to make a fool of yourself for hours on end ... wonder how I know this? 8)
wider Posted January 31, 2003 Posted January 31, 2003 Hi you PHP- Heroes, I'm trying to pass the variable for 'ORDER Number' through to PROTX as part of the 'VENDOR TX CODE' field. I'm not really getting lucky using $inside_id, or tep_db_insert_id(). Any ideas? Thanks for your help! German
Bazza-UK Posted August 5, 2003 Posted August 5, 2003 Having exactly the same problem with mine. We work by order number, so it would make much more sense to work by order number on the ProtX system too. Any ideas anybody? Thanks in advance Baz :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.