Giter Site home page Giter Site logo

lidlplus-php-client's Introduction

lidlplus-php-client

Lidl Plus PHP API client

This library allows you to query your Lidl Plus receipts, coupons and stores. It even allows you to generate a JPEG receipt to use in your automation scripts, e.g. automatically add a receipt to your transactions.

Get your refresh Token

You first need to retrieve your refreshToken. This can be done with the nodeJS script getLidlRefreshToken.js. You might need to install additional node JS libraries first with npm (e.g. request or openid-client, puppeteer).

npm install puppeteer openid-client

Run the script and enter the country and language with the country you are using your account with.

How to use

First of all you need to get your refresh_token from your app as described above. Afterwards the library can be used as described below. Mind that the country code is essential to retrieve your purchases. If the country code does not match the country where you purchased someting, your will not be able to receive your transactions.

Tested and working countrieCodes: Netherlands (default, 'NL') and Germany ('DE').

require_once __DIR__ . 'vendor/autoload.php'; 

$lidl = new Net\Bluewalk\LidlPlus\LidlPlus('MyRefreshToken', 'CountryCode');
$receipts = $lidl->GetReceipts();

$latest = $lidl->GetReceiptJpeg($receipts->Records[0]->Id);

header('Content-type: image/jpeg');
print $latest;

Acknowledgments

This script is using a stripped down version of Kreative Software's barcode.php (https://github.com/kreativekorp/barcode).

Script to fetch refresh_token is based on based script of Bastiaan Steinmeier, https://github.com/basst85.

lidlplus-php-client's People

Contributors

bluewalk avatar sharknoon avatar unicodehorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lidlplus-php-client's Issues

Can't get refresh token

Hello,

I am unable to get the refresh token. When I execute the script getLidlRefreshToken.js, I get the following error:

grafik

After changing the puppeteer launch options to headless: false to debug and see what's happening, it seems to fail at the newly introduced mandatory second factor authentification:

grafik
(This image gives you the option to validate your lidl account by receiving an code via email or via telephone)

Thank you so much for this great library, unfortunately I cant use it because of the missing refresh token.

endpoints still invalid

Still, old endpoint is used for receipts.

When I try to get receipts for Belgium I get:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>

https://appgateway.lidlplus.com/tickets/api/v1/be/list/1 gives error above
https://appgateway.lidlplus.com/app/v24/be/tickets/list/1 gives internal server error

is it still working for you guys? are you getting receipts for your countries with above urls?

Cannot retrieve refresh Token

Hey,

sadly it is not working as it seems the method was changed. When using the MITM proxy the app is not working as if there is no connection. Tried to login through the website but no success on sniffing the token.

Any ideas?
Screenshot from 2020-10-25 13-55-27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.