Manual Credit Card Variables / loadCC(){ function

  • Posts: 2
  • Thank you received: 0
13 years 5 months ago #19450

Hello Al1!
I am trying to set up HikaShop with plugnpay. I see in the creditcard.php file the loadCC() function which pulls info. I see you can pull variables like cc_number, cc_year, how do you pull the amount, and other info I will need to use to post to the form that my CC gateway requires?

I guess I'm looking for something like getUserState( HIKASHOP_COMPONENT.'.ordertotal'); Or is there another way to pull this info?


Thanks!

function loadCC(){
$app =& JFactory::getApplication();
$this->cc_number = $app->getUserState( HIKASHOP_COMPONENT.'.cc_number');
if(!empty($this->cc_number)){
$this->cc_number = base64_decode($this->cc_number);
}
$this->cc_month = $app->getUserState( HIKASHOP_COMPONENT.'.cc_month');
if(!empty($this->cc_month)){
$this->cc_month = base64_decode($this->cc_month);
}
$this->cc_year = $app->getUserState( HIKASHOP_COMPONENT.'.cc_year');
if(!empty($this->cc_year)){
$this->cc_year = base64_decode($this->cc_year);
}
$this->cc_CCV = $app->getUserState( HIKASHOP_COMPONENT.'.cc_CCV');
if(!empty($this->cc_CCV)){
$this->cc_CCV = base64_decode($this->cc_CCV);
}
$this->cc_owner = $app->getUserState( HIKASHOP_COMPONENT.'.cc_owner');
if(!empty($this->cc_owner)){
$this->cc_owner = base64_decode($this->cc_owner);
}
}

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
13 years 5 months ago #19462

The order information cannot be retrieved like that.
In the onAfterOrderConfirm or onAfterOrderCreate function, the first parameter is $order which contains all the information on the order.
The total is in $order->order_full_price
I invite you to look at the developer documentation: www.hikashop.com/en/support/documentatio...r-documentation.html

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
13 years 5 months ago #19472

Thank you, I have been looking through the documentation page. I see the signatures of the functions and the $order object in the code, but is there a comprehensive list somewhere?

Thanks again!

Last edit: 13 years 5 months ago by crazytodde.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
13 years 5 months ago #19473

There is no list for that. You should just do a var_dump of the variable and you will see all the fields available.
Alternatively, you can look at the other payment plugins (paypal for example) already available to see how you can use the information in there.

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum