Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Technical documentation of the InPost Pay plugin for PrestraShop. The plugin adds the functionality of ordering via the InPost application to the
PrestaShop store by:

  • Adding a table in the database,

  • Adding the "Create cart from InPost Pay" button in the product listing,

  • Adding the "Create cart with InPost Pay" button in the product card,

  • Adding the "Create cart from InPost Pay" button in the shopping cart page,

  • Adding the "Create cart with InPost Pay" button in the order page,

  • Actions performed on standard hooks,

  • Adding a field in the order page,

  • Adding an administrative section,

  • Providing REST API,

  • Attaching a JS file served from the webserver and a file served from an external resource to the website.

Plugin: (12.09.2023) version 1.3.13:

View file
nameinpostizi.zip


Panel
bgColor#f0f0f0
titleBGColor#f0f0f0
titleContents
Table of Contents
minLevel2

Requirements

In order for the plugin to operate properly, it requires:

  • PrestaShop version not lower than 1.7.81.x0

  • PHP version not lower than 7.41


Installation

During installation, the plugin adds to the database the table described in

Follow the steps below to install the plugin:

  1. Download the packed PrestaShop plugin from InPost and do not unpack it

  2. Log in to your store's admin section

  3. From the menu on the left, select “Modules” → “Module Manager” and then “Load Module

  4. Place the module in the frame and the plug-in is installed

  5. Select "Configure" - and configure the plugin


Test Config

In this chapter, we describe the shortened configuration process required to perform functional tests of InPost Pay integration.

For initial setup, go to the module list and click “Configure” next to the Inpost Pay module.

After clicking it, a form will appear allowing you to configure the plugin.

Fill in the fields according to the list below

  1. Select the environment and display options
    a. Set the environment to “Sandbox” - this way no money will be debited from the account during the tests.
    b. Set the Show widget to “Testers” - this way the widget will be visible only to those people, who are supposed to see it. Setting another option will display the widget, no matter funcitioning, or not, to all visitors to your store.
     In order to display the widget in a web browser, enter the address of
     your store, adding ?showIzi=true.
    Example: https://mystore.com?showIzi=true

  2. Fill in the API access data you received from InPost in the fields
    a. Client
    b. Client Secret.

  3. Enable payment option

  4. From the list, select the addresses of consents required for your store. For example, terms and conditions. Hold down the CTRL key to select more than one.

  5. Enter the text that will be displayed in the InPost application next to the link to the required consents.

  6. Select the order status that will be given to orders paid via InPost Pay

  7. Connect the courier shipment with the system shipment. After selecting the shipping method from the drop-down list, the same availability and pricing rules for the selected method will apply to shipping by Courier in the InPost application

  8. Connect the shipment via the Parcel Locker with the system shipment. After selecting the shipping method from the drop-down list, the same availability and pricing rules for the selected method will apply to parcel locker shipping in the InPost application.

  9. Specify where the widget should be available on your website.

You can display it in the product list, product card and in the cart.

For each display location, you can specify which side the InPost Pay button will align to.

For each place, you can select separately whether the background on the page is light or dark, which will ensure the correct display of texts.

For each location, you can select the display option separately. The button can be amaranth or yellow.


Production Config

After the correct test configuration and making sure that the integration works in the Sandbox, InPost Pay should be made available to all users.

For setup, go to the module list and click “Configure” next to the Inpost Pay module. After clicking it, a form will appear allowing you to configure the plugin. Change the configuration according to the list below:

  1. Select the environment and display options
    a. Set the environment to “Oridyctuib” - this way money will be debited from the account during the tests
    b. Set the show widget to “All”


Full Config

After installing the plugin for configuration, go to "Modules" → "Module Manager" and enter Inpost in the search engine. Select the "InPost Pay" plugin. After clicking, a form will appear allowing you to configure the plugin.

This section sets the system access data, the types of payment methods supported and the information exchanged between InPost Pay and the store.

Access data to the sandbox environment can be obtained by writing at integracjapay@inpost.pl

You will receive production data after signing the InPost Pay service agreement,

Description of available options:

Environment

What is it used for:

How to set:

Determines whether the store sends data to the UAT, Sandbox or production environment

For integration testing, set the Sandbox environment. If the tests were successful and you want to enable the option of buying through InPost Pay, set the Production environment

 

Show widget

What is it used for:

How to set:

During testing, we do not want the InPost Pay widget to be displayed to all customers. Regardless of what environment is set, you can temporarily hide the widget and display it to selected people only. In order to display the widget in
tester-only mode, go to the homepage of the store, adding ?showIzi=true
At the end of the url, e.g.
https://outofthebox.pl?showIzi=true

When you configure the integration select
Testers
To show the widget to everyone after completing the configuration tests, set
All

Client ID

What is it used for:

How to set:

API Access Data

According to data received from InPost

Client Secret

What is it used for:

How to set:

API Access Data

According to data received from InPost

 

POS ID

What is it used for:

How to set:

To determine the POS position

According to data received from InPost

Enable payments according to the contract concluded with Aion

What is it used for:

How to set:

Determines whether your customers will be able to make payments through
payment gateways that are included in your agreement with Aion such as Blik, Apple Pay, card payment

Check Yes if these methods are to be made available

Enable payment on delivery according to the contract concluded with InPost

What is it used for:

How to set:

Determines whether your customers will be able to make cash on delivery payments according to the contract with InPost

Check Yes if these methods are to be made available

Order status for order paid by InPost Pay

What is it used for:

How to set:

Specifies the status of orders to be paid by InPost Pay

Select the status of the paid orders from the list

Order status

What is it used for:

How to set:

Specifies what status names should appear in the InPost Pay app (right column) for orders in your store (right column)

Verify that the statuses below correspond to the statuses your customer receives in the order communication. Select the methods available to your customers

Maximum number of suggested products

What is it used for:

How to set:

Specifies the maximum number of products that will be suggested to your customer in the Inpost app for the products already in the cart. Suggested products are taken from the standard Prestashop mechanism

Please enter the maximum number of products


Consents

The section is used to set the consents displayed to customers in the InPost application when shopping with InPost Pay.

Description of available options:

Required consents

What is it used for:

How to set:

Specifies the page to which your customer will be redirected to read the consent The list of pages reflects the CMS pages available in the store

Check the consents required from your customers. You may select more than one by holding down the CTRL key and
clicking on the selected items

Required consents Text

What is it used for:

How to set:

Specifies the text displayed in the InPost application next to the required consents

Enter text of the message

Consents required once

What is it used for:

How to set:

Specifies the page to which your customer will be redirected to read the consent.

Check the consents required once from your customers. You may select more than one by holding down the CTRL key and clicking on the selected items.

Consents required once Text

What is it used for:

How to set:

Specifies the text displayed in the InPost application next to the consents that are required once

Enter text of the message

Additional consents

What is it used for:

How to set:

Specifies the page to which your customer will be redirected to read the consent

Select additional consents that can be selected by your customers Select several by holding down the CTRL key and clicking on the selected items

Additional consents Text

What is it used for:

How to set:

Specifies the text displayed in the InPost application next to the additional consents

Enter text of the message

Info

Tip:
If you want to create one checkbox in the app to approve more than one document, create a page to link to all the applicable consents

Order status

What is it used for:

How to set:

Specifies what status names should appear in the InPost Pay app (right column) for orders in your store (right column)

Verify that the statuses below correspond to the statuses your customer receives in the order communication


Net transport price

Section responsible for mapping forms of transport and determining the availability and prices of additional transport options.

Description of available options:
The settings of this section are analogous for all shipping types and for all options
 Below is a generic description of where the shipping type was used and the option for shipping options:

Courier/Parcel Locker

What is it used for:

How to set:

Determines which of the shipping methods available in the store determines the prices and rules for shipping types courier/parcel locker. The list includes standard shipping methods available in Prestashop

Select the shipment available in your store from the drop-down list

Options for PWW oaz COD

Info

Please Remember!
The following options must be set in accordance with your InPost agreement

Courier/Parcel Locker [option] net:

What is it used for:

How to set:

Specifies the price of the additional option

Enter the net amount

Courier/Parcel Locker [option] available from (date)

What is it used for:

How to set:

Determines from which day of the week this option is available

Select the day of the week from which the option will be available to your customers

Courier/Parcel Locker [option] available from (hour)

What is it used for:

How to set:

Determines from what time this option will be available

Select the time from which the option will be available to your customers

Courier/Parcel Locker [option] available to (day)

What is it used for:

How to set:

Determines to which day of the week this option is available

Select the day of the week to which the option will be available to your customers

Courier/Parcel Locker [option] available to (hour)

What is it used for:

How to set:

Determines to what time this option will be available

Select the time to which the option will be available to your customers


GUI Settings

Here you can set whether and where to display the InPost Pay widget. The section has been divided into subsections corresponding to the different subpages of your store.

Please Remember!
We set the GUI according to the Merchant Guide you received in the email from InPost.

Description of available options:

 Display

What is it used for:

How to set:

Determines whether the widget should be displayed in the respective subpage.

Check if the widget is to be displayed

 Alignment

What is it used for:

How to set:

Specifies the orientation of the widget in the space available to it. If your template only allocates a narrow space to the widget, this setting will not affect its appearance.

Select alignment from the drop-down list

Background

What is it used for:

How to set:

Determines whether the widget is on a light or dark background. This setting affects the font colour

Select from the drop-down list

Variant

What is it used for:

How to set:

The widget is available in 2 colour variants. Select the one that best suits your store

Select alignment from the drop-down list

 

Margin

What is it used for:

How to set:

Specifies the widget margins in the cart page

If the widget is displayed incorrectly in the cart page, adjust the display by adding a margin


Cart View

After configuring the plugin, the Create cart with InPost Pay button will appear in the cart, next to the products:

Display in a custom location

To display the widget in a custom place, use the code below in your template:

Code Block
\izi\InPostIzi::render(
 $productId = null,
$name = '',
$maskedPhoneNumber = '',
$inpost_basket_id = '',
$echo = true,
$addBasketId = false,
$variationId = '',
$count = 0,
$dark = false,
$yellow = false,
$cart = false,
$float = 'left',
$bindingPlace = 'BASKET_POPUP'
);

Parameter description:

Parameter

Description

Values

productId

ID of the product to be added to the cart before pairing

int

name

The customer name you receive from the API

string

maskedPhoneNumber

The masked phone number you receive from the API

string

inpost_basket_id

Cart ID you receive from API

string

echo

Display?

bool

addBasketId

Display cart id in HTML?

bool

variationId

Variation Id

int

count

Number of products in cart

int

dark

Display in dark mode?

bool

yellow

Display yellow variant?
Amaranth will be displayed by default

bool

cart

Are we on the shopping cart page?

bool

float

CSS Float

left | right | center

bindingPlace

Pairing point

PRODUCT_CARD |
BASKET_POPUP |
BASKET_SUMMARY


Uninstallation

Uninstalling the plugin deletes the plugin files. The database and data remain unchanged.


External resources

The plugin uses a JS file from an external resource located at https://izi.inpost.pl/inpostizi.js. The file contains the functions required to support the InPost Pay functionality.