prestashop-new Posted August 13, 2015 Share Posted August 13, 2015 Hi, I am creating a Sage payment Gateway module so in my file I need to Pass the State name also 'C_STATE' => Tools::safeOutput($invoiceAddress->id_state), but this is only providing me the ID of the value. How to get the State Name so that I can pass it to Gateway. Also after successful transaction I am finding difficulties to capture values in prestashop. I am using SOAP. This is my code $params = array( 'M_ID' => 'xxxxxxx', 'M_KEY' => 'xxxxxxx', 'C_NAME' => Tools::safeOutput($customer->firstname) . ' ' . Tools::safeOutput($customer->lastname), 'C_ADDRESS' => Tools::safeOutput($invoiceAddress->address1.' '.$invoiceAddress->address2), 'C_CITY' => Tools::safeOutput($invoiceAddress->city), 'C_STATE' => Tools::safeOutput($invoiceAddress->id_state), 'C_ZIP' => Tools::safeOutput($invoiceAddress->postcode), 'C_COUNTRY' => 'USA', 'C_EMAIL' => Tools::safeOutput($invoiceAddress->email), 'C_CARDNUMBER' => Tools::safeOutput($_POST['x_card_num']), 'C_EXP' => Tools::safeOutput($_POST['x_exp_date_m'].$_POST['x_exp_date_y']), 'T_AMT' => number_format((float)$cart->getOrderTotal(true, 3), 2, '.', ''), 'T_ORDERNUM' => time(), $SOAP = new SoapClient('https://gateway.sagepayments.net/web_services/wsvtextensions/transaction_processing.asmx?WSDL'); $response = $SOAP->BANKCARD_SALE($params); $result = $response->BANKCARD_SALEResult->any; $result = new SimpleXMLElement($result); $resultvalue = $result->NewDataSet->Table1->MESSAGE; $resultvalue1 = $result->NewDataSet->Table1->REFERENCE; $resultvalue2 = $result->NewDataSet->Table1->ORDER_NUMBER; $arr = explode(' ',trim($resultvalue)); $arr1 = explode(' ',trim($resultvalue1)); $arr2 = explode(' ',trim($resultvalue2)); After this I am stucked. Can any one please guide. Link to comment Share on other sites More sharing options...
bellini13 Posted August 13, 2015 Share Posted August 13, 2015 $name = State::getNameById($invoiceAddress->id_state); 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted April 14, 2017 Share Posted April 14, 2017 $name = State::getNameById($invoiceAddress->id_state); I tried with State::getNameById((int)$order->current_state) but I can't get it working. ddd($order->current_state) is giving me proper id. Link to comment Share on other sites More sharing options...
bellini13 Posted April 14, 2017 Share Posted April 14, 2017 I tried with State::getNameById((int)$order->current_state) but I can't get it working. ddd($order->current_state) is giving me proper id. $order->current_state is not the State, but the current order status. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now