Download the PHP package dalholm/omnipay-klarna without Composer
On this page you can find all versions of the php package dalholm/omnipay-klarna. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dalholm/omnipay-klarna
More information about dalholm/omnipay-klarna
Files in dalholm/omnipay-klarna
Package omnipay-klarna
Short Description Klarna Checkout gateway for Omnipay payment processing library
License MIT
Homepage https://github.com/dalholm/omnipay-klarna
Informations about the package omnipay-klarna
Omnipay: Klarna
This package is a modified version of omnipay-klarna-checkout by nyehandel and Intflow. With this package you can run on Laravel 8 and PHP 8. This package will also contain more functinallity then the original package.
Introduction
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.6+. This package implements Klarna Checkout support for Omnipay.
This package supports PHP 8
Installation
To install, simply add it to your composer.json
file:
Initialization
First, create the Omnipay gateway:
Then, initialize it with the correct credentials:
Usage
For general usage instructions, please see the main Omnipay repository.
General flow
- Create a Klarna order
- Update transaction (if required)
- Render the Iframe
- Respond to redirects to
checkoutUrl
orconfirmation_url
- Respond to checkout callbacks
- Respond to the request to
push_url
(indicates order was completed by client) with a ackowledgement - Extend authorization (if required)
- Update the merchant address (if required)
- Perform one or more void operations
Authorize
To create a new order, use the authorize
method:
This will return the order details as well as the checkout HTML snippet to render on your site.
Render Iframe
Klarna Checkout requires an iframe to be rendered when authorizing payments:
After submitting the form within the iframe,
Klarna will redirect the client to the provided confirmation_url
(success)
or checkout_url
(failure)`.
Update transaction
While an order has not been authorized (completed) by the client, it may be updated:
The response will contain the updated order data.
Update Merchant References
While an order has not been authorized (completed) by the client, it may be updated:
Response will be an Empty response (204)
Extend authorization
Klarna order authorization is valid until a specific date, and may be extended (up to a maximum of 180 days). The updated expiration date may then be retrieved with a fetch request
Capture
Fetch
A Klarna order is initially available through the checkout API. After it has been authorized, it will be available through the Order management API (and will, after some time, no longer be available in the checkout API). This fetch request will first check whether the order exitst in the checkout API. If that is not the case, or the status indicates the order is finished, it will also fetch the order from the order management API
API documentation | Checkout | Order management
Acknowlegde
Acknowledge a completed order
Refund
Void
You may release the remaining authorized amount. Specifying a specific amount is not possible.
Update customer address
This may be used when updating customer address details after the order has been authorized. Success op this operation is subject to a risk assessment by Klarna. Both addresses are required parameters.
Units
Klarna expresses amounts in minor units as described here.