bulldots-bulletpoint/laravel-joyn

Simple Laravel package for the Joyn API

1 2021-05-12 13:13 UTC

This package is auto-updated.

Last update: 2024-05-29 05:09:43 UTC


README

#Laravel Joyn API Package

Latest Version on Packagist Total Downloads

Laravel Joyn API Package.

Generate a Joyn QR code that the user can scan after buying products from the shop.

Installation

You can install the package via composer:

composer require bulldots-bulletpoint/laravel-joyn

Usage

###Example:

A user buys something from your webshop. After the payment is done an email is send to the user to verify that the order is payed.

You can add the joyn qr code to that email. Example:

Here we add the code in the webhookController

        //Http/Controllers/Front/webhookController.php
        ...

        $joyn = new JoynController();
        $auth = $joyn->getAuthorization();
        $result = $joyn->setLoyaltyToken($auth,$order->reference,$payment->paymentData['amount']);

        Mail::send("emails.orderConfirmation", [
            "order"  => $order,
            "joyn"   => $result,
            "status" => "Your order is payed and confirmed."
        ]);

        ...

And then you edit the OrderConfirmation mail template:

    //resources/views/emails/orderConfirmation.blade.php
    ...

    <p>Joyn points</p>
    <p>Scan QR-Code below with the Joyn-app</p>
    <img src="{{$joyn['qrCodeUrl']}}" alt="Joyn QR-Code">
    <p>Can't read the QR-Code? <a href="{{$joyn['tokenUrl']}}">Click here</a></p>
    
    ...

joyn-qr-code

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email louise@bulldots.be or olivier@bulldots.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Joyn - Public API documentation

https://developer.joyn.be