[Solved] Receipts & Plug 'n Pay payment plugin

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #86274

Hi,

My merchant provider requires that we present a receipt after each transaction to the customer so they can print it off for their records. How can I do this?

The receipt can be like an invoice, but unlike the invoice on the customer view order pages, it should also show:

- Payment Method along with the credit card type and the last 5 digits of the card.
- Transaction type: whether product purchase or service payment.
- Shipping Method

I'm thinking also it would be good to have the receipt listed with the Order/invoice also and should have their own set of control codes (receipt number).

I am not a coder, but I may be able to put most of these codes together (picking from the codes from other display view pages). But the receipt number and where to put these codes? I need your help with this.

Also, is there a plugin for Plug 'n Pay payment gateway?

Any help will be appreciated. Thank you in advance.

Winchester


See my solutions here: www.hikashop.com/en/forum/4-how-to/77605...nt-plugin.html#87849

Last edit: 11 years 9 months ago by trueblue. Reason: My solutions

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #86387

Hi,

By default the merchant should receive an email when a sale is done, the mail can be edited in System > Emails, it's the mail "ORDER_ADMIN_NOTIFICATION_SUBJECT".

You can edit it and add the informations like the payment method or shipping.. It should be in the var $order.

There is actually no plugin for Plug'n Pay, but you can ask to a thid developer to develop it for you or post your request in the commercial jobs section of this forum.
Here is some documentation for the plugin:
www.hikashop.com/fr/support/documentatio...r-documentation.html

The following user(s) said Thank You: trueblue

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #86395

Hi Xavier,

Thank you very much for helping. I needed also the receipt/invoice shows up on the thank you page. I think I figured where I can put this. In Display Views, there's a view called "after_end" and "end" in checkout. I was planning on testing these to see which one will output at the end, but it could make things faster if you could just tell me which one show up as the thank you page by default.

As for the Plug 'n Pay plugin. I'm working on a plugin for it, but it's going to take some time for me to finish it.

I am currently using the Authorize.net plugin for it. PnP has an emulator that can convert Authorize information (AIM). It works, but the problem is that it's sending or requesting (I'm not sure) a "PostAuth" also along with the "Sale". If I could turn this off I will be fine for now. Any idea how to do this?

Thank again Xavier

Winchester

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #86477

Any idea on how to stop the postauth from being sent when using the Authorize.com plugin?

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 9 months ago #86555

Hi,

If you're using the authorize.net plugin in AIM mode, that's the "end" file that you need to edit.

I'm not sure what you mean by "PostAuth" ? Are you talking about the fact that the payment is captured automatically ? That can actually be changed with the "instant capture" option of the plugin.

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #87358

Xavier wrote: Hi,

By default the merchant should receive an email when a sale is done, the mail can be edited in System > Emails, it's the mail "ORDER_ADMIN_NOTIFICATION_SUBJECT".

You can edit it and add the informations like the payment method or shipping.. It should be in the var $order.


Where do I find "System > Emails"?

I'm still trying to figure out how to edit the after_end page to show the invoice/order. I looked at the development documentation page you sent, but it does really explain anything properly. Not to mention, not all the functions are listed there it seems.


Xavier wrote: There is actually no plugin for Plug'n Pay, but you can ask to a thid developer to develop it for you or post your request in the commercial jobs section of this forum.
Here is some documentation for the plugin:
www.hikashop.com/fr/support/documentatio...r-documentation.html


While "auth" means "sale", "postauth" means "settled". Usually the "postauth" is sent as a "final payment" as in a multi-part payment. "preauth" would be the "first payment" and "postauth" the final.

Do you think it's possible that HikaShop is sending the postauth because of a setting or configuration is the shipment method, the payment method or system setting?



I have only a few more days to get this site ready and these are the last pieces to finish. Please please please help???

Thanks again in advanced,

Winchester

Last edit: 11 years 9 months ago by trueblue.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #87466

The menu System > Emails is only available in the business edition of HikaShop.

The after_end page is in the folder "plugin / hikashoppayment" accessible via FTP. In the case of authorize.net you maybe have to edit the file "authorize_thankyou.php".

To turn off the postauth, I think that you have to edit the authorize.net plugin "plugin / hikashoppayment / authorize / authorize.php"

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #87497

Thanks for responding Xavier.

Ok. I fixed the postauth issue. It seems the Instant Capture option was not working properly. But, since I am using the Authorize.net payment plugin for Plug 'n Pay, I just modified authorize.php to bypass the param option.

authorize.php - At line 269 -- I replaced this code:

		if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
		if($this->element->payment_params->capture){
			$vars["x_type"] = 'AUTH_CAPTURE';
		}else{
			$vars["x_type"] = 'AUTH_ONLY';
		}

With this code:
		/*
		if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
		if($this->element->payment_params->capture){
			$vars["x_type"] = 'AUTH_CAPTURE';
		}else{
			$vars["x_type"] = 'AUTH_ONLY';
		}
		*/
		$vars["x_type"] = 'AUTH_ONLY'; // Removed config option and just use the one needed

Work just like it should now with Plug 'n Pay


I'm still having problems trying to figure out the receipt/invoice displaying on the after_end page. My problem is getting the page to grab the information from the checkout page. I also thought of grabbing the information from order history also, but like without proper documentation I'm lost. I'm just a designer.

I'm thinking though that this should be an option in future versions of HikaShop.

The email itself is fine as it is... We just need to show the invoice/order after the order is submitted so the customer can review it and print it if they want.. It could also be presented as a confirmation page (where it can be printed also) where they can review and confirm order before submitting.

Is there a way to show the full terms and condition for the customer to accept before payment? It's not very important though.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #87550

The invoice is reachable by the customer in the user control panel.

Do you have try to edit the view "checkout / after_end" to display the invoice inside ?

For the terms and condition, in the checkout options you can add the step "terms" and it will display a line "Please accept terms..." wih a checkbox and a link to display the terms in a popup.

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #87641

Xavier wrote: The invoice is reachable by the customer in the user control panel.

Do you have try to edit the view "checkout / after_end" to display the invoice inside ?

For the terms and condition, in the checkout options you can add the step "terms" and it will display a line "Please accept terms..." wih a checkbox and a link to display the terms in a popup.



Yes. I'm editing the checkout/after_end.php file. I think I need to capture the information from the checkout page so I can use it on the after_end page.

According to the Developer documentation, to load the information form an order I should use this code:
$orderClass = hikashop_get('class.order');

$order = $orderClass->loadFullOrder($order_id);

My problem is that I don't know where to go from here. Also, I don't this that code know what order_id to use. The only safe way to pass this on to $order_id is to grab it from the URL. so I tried adding this to code:
$order_id = $_GET['order_id'];

It works when I echo $order_id, but the sample code either not using it. I figure that I'm not using the sample codes properly.

The next issue is finding the right terms for the individual fields. I figure it would look something like this:
<?php echo $order->order_number; ?>

or
//At the top
<?php $order_id = $order->order_id; ?>

// In the field
<?php $order->order_number['$order_id']; ?>


If I can get any insight into how to use the sample code, I think I'll be able to figure out the rest.


Thank you very much for your help. I truly appreciate it.

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #87727

Could the reason why it's not working this way is because once the transaction is completed, the variables are cleared for security reasons?

If so, this would mean I should try to display the information from the customer's order history. Right? How would I do this?

On the authorize_end.php page, the variables would still be there, since this is actually the page that sends the payment information to the payment gateway, right?

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 9 months ago #87848

Hi,

When the translation is completed, the checkout session is cleared so some information are no more accessible.
I guess thatv variables would be accessible in the Joomla session.

You can use

$order_id = JRequest::getInt('order_id');
in order to retrieve the order id. It would be more secure.
After that, I don't understand your
$order->order_number['$order_id'];
because the variable is between simple quotes so it would be used as text and, the order_number is not an array.
What do you want to display ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 31
  • Thank you received: 10
11 years 9 months ago #87849

1: To show invoice after the order is submitted. I used this code below in Display -> View -> checkout -> after_end:

<?php
	$app=& JFactory::getApplication();
	echo '<iframe src="'.hikashop::completeLink('order&task=show&order_id='.$app->getUserState('com_hikashop.order_id').'&tmpl=component').'" class="hika-terms-iframe" scrolling="no" style="width:100%; height:1200px; margin-top:30px; border:none;" seamless="seamless"></iframe>';
?>

Note: I'm sure there's a better way to do this using Joomla code elements, but I can't seems to find it anywhere. This brings the salesorder into an iframe.

If you want you can just redirect it to the salesorder which is located in you Order History with this:
$app=& JFactory::getApplication();
$app->redirect(hikashop::completeLink('order&task=show&order_id='.$app->getUserState('com_hikashop.order_id'),false,true));

2: To fix the PostAuth sent when using Authorize.net plugin with Plug 'n Pay. (Note: It seems to be an issue even with Authorize.net with AIM method)

Look for: [JOOMLA_ROOT]plugins/hikashoppayment/authorize/authorize.php and replace line 269:
		if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
		if($this->element->payment_params->capture){
			$vars["x_type"] = 'AUTH_CAPTURE';
		}else{
			$vars["x_type"] = 'AUTH_ONLY';
		}

with
		/*
		if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
		if($this->element->payment_params->capture){
			$vars["x_type"] = 'AUTH_CAPTURE';
		}else{
			$vars["x_type"] = 'AUTH_ONLY';
		}
		*/
		$vars["x_type"] = 'AUTH_ONLY'; // Removed config option and just use the one needed

Note: This effectively bypass the "Instant Capture" option in the Authorize.net payment plugin configuration which doesn't seems to work anyway.

3: To show the Term & Conditions text (instead of just the link to it). In HikaShop, go to Display -> Views -> checkout -> terms and replace this code:
<div id="hikashop_checkout_terms" class="hikashop_checkout_terms">
	<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
	<?php
		$text = JText::_('PLEASE_ACCEPT_TERMS_BEFORE_FINISHING_ORDER');
		$terms_article = $this->config->get('checkout_terms');
		if(!empty($terms_article)){
			JHTML::_('behavior.modal');
			$text = '<a href="'.JRoute::_('index.php?option=com_content&view=article&id='.$terms_article.'&tmpl=component').'" class="modal" rel="{handler: \'iframe\', size: {x: 450, y: 480}}" target="_blank">'.$text.'</a>';
		}
	?>
	<label for="hikashop_checkout_terms_checkbox"><?php echo $text; ?></label>
</div>

With this code:
<div id="hikashop_checkout_terms" class="hikashop_checkout_terms">
	<?php
		$text = JText::_('PLEASE_ACCEPT_TERMS_BEFORE_FINISHING_ORDER');
		$terms_article = $this->config->get('checkout_terms');
		if(!empty($terms_article)){
			echo '<iframe src="'.JRoute::_('index.php?option=com_content&view=article&id='.$terms_article.'&tmpl=component').'" scrolling="auto" style="width:100%; height:545px; margin-top:30px; border:none;" seamless="seamless"></iframe>';
		}
	?>
	<br /><br />
	<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
	<label for="hikashop_checkout_terms_checkbox"><?php echo $text; ?></label>
</div>


Note: I used an iframe to display the Terms & Conditions. It is best to alter your Checkout Workflow, placing the "terms" on a step on it's own. The customer still has to check the box to continue with the checkout process.

I hope this can help someone else.

Last edit: 11 years 9 months ago by trueblue. Reason: Moved the note from the last code tags
The following user(s) said Thank You: Jerome, Xavier

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

Time to create page: 0.098 seconds
Powered by Kunena Forum