Integration of Paypal Pay in 4 code in Hikashop eCommerce system

  • Posts: 26
  • Thank you received: 0
4 months 2 days ago #335641

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.8.13
-- PHP version -- : 5.6.40
-- Browser(s) name and version -- : Google Chrome

Hi Nicolas and the community,

I am wondering if it is possible to integrate Paypal's latest Buy Now Pay Later feature that pay in 4 instalments into Hikashop system?

PayPal Australia provided code and instructions to add into the Hikashop system.

Can anyone able to assist to see if this implementation can be feasible and done with the "Display Views" where we can put the following paypal code into the cart price" and dynamically add value on the price in the single item/cart view?

<!-- In your code, dynamically update
data-pp-amount with the price or cart amount.
For example, data-pp-amount=“89.99”
for $89.99 product
-->
<div
    data-pp-message
    data-pp-style-layout="text"
    data-pp-style-logo-type="inline"
    data-pp-style-text-color="black"
    data-pp-amount="ENTER_VALUE_HERE">
</div>

Thank you

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

  • Posts: 74521
  • Thank you received: 11488
  • MODERATOR
4 months 2 days ago #335650

Hi,

It sure can be done.
Note that as per developer.paypal.com/ppdevdocs/docs/busi...es/credit-messaging/ you also need the line:

<script src="https://www.paypal.com/sdk/js?client-id=YOUR-CLIENT-ID&components=messages"></script>
where you replace YOUR-CLIENT-ID by the client ID provided to you by PayPal.
Then, where to put it depends a bit on the situation.
You could place the code on the product page, so that instead of adding the product to the cart, the customer could click on that button to directly be redirected to PayPal for the payment of that one product. In that case, you could edit product / show_default.php and and the amount would be available with:
<?php echo round($this->element->prices[0]->price_value_with_tax, 2); ?>
Or you could edit checkout / show_block_cart.php to add the code on the cart view of the checkout. There, you could add such code:
<?php echo round($cart->full_total->prices[0]->price_value_with_tax, 2); ?>[/code]
Note that you can't put your code before the line:
$cart = $this->checkoutHelper->getCart();
since that line initializes $cart which you need for the amount.

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

  • Posts: 26
  • Thank you received: 0
3 months 4 weeks ago #335801

Hi Nicolas,

Thanks for your reply and information provided.

I followed your suggestion and advice by inserting pieces of code to "show_block_cart.php" view under Checkout (under Display config) as shown in the attachments

1) Paypal messaging

<div
    data-pp-message
    data-pp-style-layout="text"
    data-pp-style-logo-type="inline"
    data-pp-style-text-color="black"
    data-pp-amount="<?php echo round($cart->full_total->prices[0]->price_value_with_tax, 2); ?>">
</div>

in Line 469 after hikashop_checkout_cart_final_total container

2) Paypal SDK head tag placed in the same show-block-cart view file in line 11.

After placing items on checkout and testing checkout, the final step of checkout did not show the Paypal Messaging that shows available to pay in 4 instalments.

I am not sure what went wrong as it did not work.

Our template framework uses Gantry5.

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

  • Posts: 74521
  • Thank you received: 11488
  • MODERATOR
3 months 3 weeks ago #335809

Hi,

So I had a look on the link you gave in your first message, and I can see you're using HikaShop 4.0.0 there and not the 4.4.3 as you said in your first message.
Also, because of that, you have the setting "checkout legacy" in the HikaShop configuration. That setting has been removed since HikaShop 4.4.0.
And since you activated that setting, you are using the old checkout system of HikaShop, from HikaShop 1.x and 2.x.
The old checkout system of HikaShop doesn't use show_block_cart.php so that's normal that you didn't see any changes.

With the legacy checkout, you need to edit instead checkout / cart.php and instead of

<?php echo round($cart->full_total->prices[0]->price_value_with_tax, 2); ?>
you need to use:
<?php echo round($this->full_total->prices[0]->price_value_with_tax, 2); ?>

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

  • Posts: 26
  • Thank you received: 0
3 months 3 weeks ago #335928

Hi Nicolas.

Thank you for your advice and information provided, muchly appreciated.
I tried putting the messaging code in legacy checkout cart file and it seems worked displaying (refer to attached screenshot)
However when I log in Paypal to view pay in 4 options and pay in 4 agreement, it didn't show in Paypal.

Any suggestions on how to get the data successfully passed to Paypal?

Thanks

Attachments:

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

  • Posts: 74521
  • Thank you received: 11488
  • MODERATOR
3 months 2 weeks ago #335940

Hi,

Reading a bit online, it seems that for the "pay in 4" to be available to the customer, PayPal needs to deem them qualified to be able to use that capability.
So maybe it thought you didn't qualify for some reason when you tried ?
I would recommend you to check with PayPal tech / merchant support about the situation as I'm not familiar with all that.

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

  • Posts: 26
  • Thank you received: 0
3 months 2 weeks ago #336022

Hi Nicholas.

Thank you for your reply.

I have had a look at PayPal documentation about creating button to display "Pay Later" as attached screenshot

I am not sure whether the value of total amount and items generated by Hikashop can be passed through as parameter values to PayPal and subsequently create order in Hikashop same time as PayPal order.

On other side I was thinking maybe using PayPal REST api plugin to install? www.hikashop.com/marketplace/product/236-paypal-rest.html to enable data to go through PayPal ?

Regards

Attachments:

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

  • Posts: 74521
  • Thank you received: 11488
  • MODERATOR
3 months 2 weeks ago #336024

Hi,

Well, I didn't see any information about being able to pass that in the documentation I read about your pay in 4 link.
So I'm not sure.
Did you provide a copy of the generated HTML (and maybe the link to the shop with the instructions to reproduce the issue) to the tech support of PayPal as he asks you in his message ?
He will be able to tell you if you're missing things with what you added.

PayPal REST can be used to process payments with PayPal. However, that won't help with your pay in 4 integration.

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

  • Posts: 26
  • Thank you received: 0
3 months 6 days ago #336197

Thank you Nicolas.
Apparently PayPal said that we must disable WPS (Website Payment Standard) processing in our account.
I had a look at Hikashop plugin integrations and could not find any reference relating to Website Payment Standard.
Only Paypal Pro and Paypal Checkout were listed in plugins, as per attached screenshot.

Attachments:

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

  • Posts: 74521
  • Thank you received: 11488
  • MODERATOR
3 months 5 days ago #336207

Hi,

From what I understand it means that a setting in your PayPal merchant account has to be changed. So nothing you can do in HikaShop itself.

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

  • Posts: 26
  • Thank you received: 0
2 months 2 weeks ago #336574

Hi Nicholas

Thanks for your reply.
I had a quick research and found this article wordpress.org/plugins/wp-express-checkout/ which seems generating paypal checkout and also pay in 4 option.

Just wondering if I install this will it affect Hikashop in terms of checkout page?

Thank you

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

  • Posts: 3437
  • Thank you received: 456
  • MODERATOR
2 months 2 weeks ago #336585

Hello,

You have the HikaShop Paypal Express Checkout payment plugin will work approximately as in the video of your link.
Learn more about this payment plugin, here .

Hope this will fit your needs.
Regards

Last edit: 2 months 2 weeks ago by Philip.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum