PostFinance Checkout Magento 2.2

Documentation

1Prerequisites

If you don’t already have one, create a PostFinance Checkout account.

2Installation

  1. Update the composer.json file in the root directory of your Magento store and wait for Composer to finish updating the dependencies.

    composer require postfinancecheckout/magento-2-2
  2. Enable the extension and clear the static view files.

    bin/magento module:enable PostFinanceCheckout_Payment --clear-static-content
  3. Register the extension and initiate the database migrations.

    bin/magento setup:upgrade
  4. Recompile the Magento project.

    bin/magento setup:di:compile
  5. Clear the Magento store’s cache.

    bin/magento cache:flush

3Configuration

3.1Main Configuration

  1. Navigate to Stores → Configuration → Sales → PostFinance Checkout Payment in your Magento backend and in the section General enter the PostFinance Checkout User ID and Authentification Key that you can create in the setup assistant. Alternatively, you can manually create an application user.

    application user configuration
  2. You need to switch the configuration scope to Main Website to enter the space id.

    space configuration
  3. After saving the configuration, the payment methods are created in the Magento store and the necessary webhooks are set up.

The setup is now finished. You should see the payment methods in your checkout. To view the payment method configuration in the backend of Magento go to Stores → Configuration → Payment Methods. Make sure you are in the Website configuration scope to view the payment methods.

Most of the payment method configuration is done in PostFinance Checkout. After following the steps of the previous steps, the PostFinance Checkout payment method configurations will be synchronized automatically into the Magento store. There are just a few payment method settings in the Magento store in Stores → Configuration → Sales → Payment Methods.

payment method configuration

3.2Additional Configuration

3.2.1Line Items

By default the plugin calculates the line items as accurate as possible. The creation of the transaction is in that case possible only when correct data is transmitted.

The plugin allows you to control the line items calculation under Stores → Configuration → PostFinance Checkout Payment in the section Line Items:

line items magento2

There you have the possibility to set Enforce Consistency to No-

In this case the transaction is created even if the line items calculation is not 100% correct. This can happen if you are using for example third-party plugins (e.g. VAT calculation plugins, voucher plugins).

Note
This setting implies that the plugin is collecting wrong data (e.g. VAT) which might lead to wrong data in the system.

4Payment Method Configuration

4.1Setup

The PostFinance Checkout payment method configurations are synchronized automatically into the Magento store. There are just a few payment method settings in the Magento store in Stores → Configuration → Sales → Payment Methods. To see the PostFinance Checkout payment methods, you need to switch the configuration scope to Website

payment method configuration

Additional payment methods are directly added in PostFinance Checkout. This can be done in the setup assistant. Changes are synchronized automatically.

4.2Customization

If you want to change the payment method description, title, logo, etc you need to do this in the payment method configuration. Changes will be synchronized automatically.

4.3State mapping of Magento orders

Below you find a diagram that shows the state machine of Magento for orders including additional information for the state transitions.

magento2 state graph order
  1. If the transaction is authorized in PostFinance Checkout, the Magento order is marked as Hold Delivery. As long as the transaction is in PostFinance Checkout in state pending, the order will appear in Magento as Pending Payment. In case the transaction timed out the transaction will switch into cancel state.

  2. If the transaction fails during the authorization process, the Magento order is marked as Canceled.

  3. In case the delivery indication is pending, the order within Magento will move into Payment Review (in this case you have to decide the outcome of the delivery indication e.g. You have configured to manually check transactions without 3d Secure). In such situations a manual task is created and an alert appears in the PostFinance Checkout & Magento backends. You can then resolve the manual task within the PostFinance Checkout backend. This changes the transaction status, which is transmitted back to Magento. See more details in [On hold orders].

  4. If the transaction’s authorization is voided or the risk assessments indicate that the order should not be fulfilled, the order is marked as Processing.

  5. If the transaction in PostFinance Checkout is marked as fulfill, the Magento order is marked as Processing, indicating that it can now be fulfilled. Once the shipment has been created, we recommend to change the order’s status.

4.4State mapping of Magento invoices

Below you find a diagram that shows the state machine of Magento for Invoices including additional information for the state transitions.

magento2 state graph invoice
  1. If the transaction in PostFinance Checkout is authorized, the invoice status of the Magento order is set to Pending.

  2. If the transaction fails during the authorization process, the invoice status of the Magento order is set to Canceled.

  3. If the transaction’s authorization is voided, the invoice status of the Magento order is set to Canceled.

  4. Once the invoice is paid, the invoice status of the Magento order is set to Paid. This also applies if the invoice is not traceable due to external administration (invoice not applicable).

5Transaction Management

You can capture, cancel and refund transactions directly from within the Magento backend. Please note if you refund, void or capture transaction inside PostFinance Checkout the events will be synchronized into Magento. However, there are some limitations (see below).

5.1Complete (capture) an order

You have the possibility for your transactions to have the invoice created and the payment only authorized after the order is placed. Inside the connector configuration you have the option, if the payment method supports it, to define whether the payment should be completed immediately or deferred.

In order to capture a transaction, open the invoice and click on capture.

Note
When the completion is pending in PostFinance Checkout the invoice will stay in pending state.
magento2 capture

5.2Void a Transaction

In order to void a transaction, open the invoice and click on the cancel button. This will cancel the invoice and void the transaction.

Note
You can only void transactions that are not yet completed.
magento2 cancel

5.3Refund of a Transaction

You have the possibility to refund already completed transactions. In order to do so, open the invoice of the captured order and click on Credit Memo. In case the payment method does not support refund, you will not see the possibility to issue online refunds.

magento2 refund1

You can make refunds based on product quantity. In order to do so, enter the amount of products you wish to refund to your customer.

magento2 refund2

You can carry out as many individual refunds as you wish until you have reached the quantity of the original order. The status of the order then automatically switches to complete.

Note
It can take some time until you see the refund in Magento. Refunds will only be visible once they have been processed successfully.

5.4On Hold Orders

As long as the delivery should not be done the state of the order will be in On Hold. This happens when the transaction in PostFinance Checkout has not reached the fulfill state.

There are essentially two reasons why this can happen:

  • The transaction is not completed. In this case you have to complete the transaction as written above.

  • As long as we are not able to tell you if you should fulfill the order. The delivery decision is done automatically. If this does not happen within the defined time frame, PostFinance Checkout will generate a manual task which you should observe and follow the instructions. When there is a manual task we will also display it in the Magento Backend.

You can find more information about manual tasks in our Manual Task Documentation.

5.5Limitations of the Synchronization between PostFinance Checkout and Magento

Please note that captures, voids and refunds done in PostFinance Checkout are synchronized. However, there are some limitations. Inside PostFinance Checkout you are able to change the unit price and the quantity at once. This can not be done in the Magento backend. We therefore recommend that you perform the refunds always inside the Magento backend and not inside PostFinance Checkout. If a refund cannot be synchronized it will be sent to the processor but it could be that you do not see it inside your Magento backend.

You can find more information about Refunds in PostFinance Checkout in our Refund Documentation.

5.6Tokenization

In case the payment method supports tokenization you can store the payment details of your customer for future purchases. In order to use this feature make sure that the One-Click-Payment Mode in your payment method configuration is set to allow or force storage.

Note
Tokenization is not available for guest checkouts.

6Backend Orders

You can create orders inside Magento also from the Magento Backend. If you create the transaction from the backend and select a payment method created by PostFinance Checkout then we are using the Charge Flow Feature of PostFinance Checkout. This means that we first check if the payment method allows to charge the customer without customer interaction (i. e. invoice). If not and you did not select from the dropdown to use a token with stored payment information we are going to trigger the charge flow process you configured to ask the buyer for the payment details.

moto token

You can find more information about charge flows in our charge flow documentation.

7FAQ

7.1How can I make the payment methods appear in the checkout?

Make sure that you followed the Configuration section by stating your PostFinance Checkout space ID and application user’s access information in the Magento backend. By saving the configuration form the synchronization of the payment methods and the set up of the webhooks are initiated.

If this does not solve the problem, it could be that you use a special fee or coupon module that we do not support. Try to disable this plugin and see if it helps. The payment methods are only displayed if the plugin’s total calculation matches the actual order total.

7.2Is OneStepCheckout supported?

Our PostFinance Checkout Magento 2 Plugin supports the major one-step checkouts out of the box. In case you use one of the listed checkouts below we can guarantee operability with the latest build of the plugin.

The following OneStepCheckout for Magento 2 are supported:

8Support

If you need help, feel free to contact our support.