Versions Compared

Key

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

Technical documentation of the InPost Pay plugin for Woocommerce. The plugin adds the functionality of ordering via the InPost application to the
 Woocommerce 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: (31.08.2023) version 1.3.43

View file
nameinpost-izi-pay-woocommerce.zip

Changelog:

  • 23.08.2023r - 1.3.42

  • 23.08.2023r - 1.3.41

  • 23.08.2023r - 1.3.40

  • 17.08.2023r - 1.3.38

  • 08.08.2023r

  • 31.07.2023r

  • 18.07.2023r


Na tej stronie

Table of Contents

Requirements

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

  • Woocommerce version not lower than 7.30.0

  • PHP version not lower than 7.41


Installation

During installation, the plugin adds to the database the table described in https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/132382721/InPost+Pay+-+Woocommerce#Baza-danych .

Follow the steps below to install the plugin:

  1. Download the packed Woocommerce 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 “Plugins” and then “Add New

  4. At the top of the page, select “Send the plugin to the server” then “Select file” and look for the packed plugin downloaded in step 1

  5. Click “Install

  6. In the next window, click “Activate 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 store's administration section and click “InPost Pay” in the menu on the left. 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. Fill in the POS ID field with a random string (123abc)

  4. Enable payment option

  5. Add the consents that will be required in your store. For a detailed description of each option, see chapter 6 Full config

  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 on the product card and in the cart.
    For each display location, you can specify to which side the InPost Pay button will be aligned.
    For each location, you can separately select whether the background of the page is light or dark, which ensures 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 "Production" - this way the money will be debited from
    the account during testing.
    b. Set show widget to “All”

  2. Set the POS ID field according to the contract with InPost


Full Config

The configuration was divided into sections allowing you to adjust the operation of the plugin to the needs of your store

After installing the plugin, you will see a new “InPost Pay” menu in the menu on the left side of the administration section

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

API Settings

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 sandbox or production
 environment data

When you test the integration, set the Sandbox environment.
 Once the tests were successful and you want to enable the possibility of purchase by 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 main page of the store and add a ? at the end of url addressshowIzi=true
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 for the plugin to work.

According to data received from InPost

Client Secret

What is it used for:

How to set:

API access data for the plugin to work.

According to data received from InPost

POS ID

What is it used for:

How to set:

API Access Data

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 this method is 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

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 WooCommerce 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.

Adding:
 After each saving of forms, you will be able to add another consent.

Deletion:
Leave the consent description blank and save the form to delete the consent.

Description of available options:

Consent address

What is it used for:

How to set:

Specifies the page to which your customer will be redirected to read the consent The pages visible in the list are standard
Pages available in Wordpress.

Select one of your store pages from the drop-down list

Description displayed in the app

What is it used for:

How to set:

Specifies the description displayed in the app

Enter the description to be displayed

Required

What is it used for:

How to set:

Determines whether the consent is required

Enter the consent requirement from the list

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.


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:

Add VAT to the transport price

What is it used for:

How to set:

Specifies whether to add VAT to the shipping costs.

Check if the shipping amounts in the app are the same as in the store.

Pricing and shipping availability map type with

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 type. The list includes standard shipping methods available in
Woocommerce.

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

Options for PWW oaz COD

Note

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

Price

What is it used for:

How to set:

Shipping option Net Price

Enter the amount of the price

Available from

What is it used for:

How to set:

Determines from what day of the week and what time the option becomes available

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

Available until

What is it used for:

How to set:

Determines until what day of the week and what time the option becomes available

Select the day and time until 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.

Info

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

Location

What is it used for:

How to set:

For cart subpages and Woocommerce orders, it allows you to add widgets in different parts of the subpage. The correct operation of each of the available options is conditioned by the correct
 implementation by the template used by your store

Select the part of the subpage from the drop-down list

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 its display by adding a margin.


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


Cart View

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


Uninstallation

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