Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Forbidden key name in getFormFields() ?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-10-2016, 05:32 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Forbidden key name in getFormFields() ?

Hi, I am making a new thread not to mess up the other one, but they are related.

So, I have been trying to build on the model of Tony's demo payment module.
We need to pass more information from the cart to gateway, notably the first, last name, the e-mail of the client, as well as the amount of payment. If I understand correctly, it should boil down to rewriting
the function.
Code:
getFormFields()

All my trials failed, and as a desperate attempt, I tried to put
Code:
protected function getFormFields() { return array( 'transactionID' => $this->transaction->getPublicTxnId(), 'returnURL' => $this->getReturnURL('transactionID'), 'x_first_name' => $this->getProfile()->getBillingAddress()->getFirstname(), 'x_last_name' => $this->getProfile()->getBillingAddress()->getLastname(), 'amount'=>300, ); }
and, to my surprise, I discovered that I couldn't redeploy
the store

I thought it was forbidden to pass a "constant" value from x-cart to gateway this way because there were better ways to do it, but it still
intrigued me, and I changed the line
Code:
'amount'=>300,
to
Code:
'useless_variable'=>300,
and then the cart passes correctly 'useless_variable' to the gateway

Thus, here is my question. Are there forbidden key name for the array that getFormFields() return? Is there a list of such key names?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:38 AM.

   

 
X-Cart forums © 2001-2020