Coder Social home page Coder Social logo

app-php-sdk's Introduction

Shopware APP SDK for PHP

codecov PHPUnit PHPStan CS-Fixer Mutation testing badge

This SDK is independent of any Framework. It uses PSR Request/Response/HttpClient to be usable cross framework.

Features

  • Registration flow
  • Lifecycle handling (app activated, deactivated, uninstalled)
  • Convert actions (Webhook, ActionButton, Payment, ...) into structs
  • Framework agnostic (PSR Request/Response/HttpClient/Repository)
  • Events

Symfony Bundle

If you are using Symfony, you can use the Symfony Bundle to integrate the SDK. To get started with it, refer to the below documentation.

Documentation

Example

Checkout the example project for a simple working example.

app-php-sdk's People

Contributors

cyl3x avatar jankal avatar lernhart avatar mstegmeyer avatar shyim avatar sushmangupta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

app-php-sdk's Issues

PaymentResponse::authorized() not correctly transmitted

The payment state authorized apparently does not exist in Shopware core.

Error message:

Illegal transition "authorized" from state "ed6ef84314b14802bd57fcb48b3ad7e8". Possible transitions are: authorize, cancel, do_pay, fail, paid, paid_partially, pay, pay_partially, process_unconfirmed, remind

So I suggest changing the state name in PaymentResponse.php#L47 to authorize which results in the correct state transition.

Showpare Issuetracker: NEXT-26749

Resolve request to Context objects

Map specific Requests from Shopware to Structs/DTO

  • Webhook
  • AppAction Button
  • Iframe

Webhook

Example payload for a webhook request:

{
    "data": {
        "payload": {
            "changes": [
                "TestApp.config.email"
            ]
        },
        "event": "system_config.changed"
    },
    "source": {
        "url": "http://localhost:8000/",
        "eventId": "3e069abfb24f45a5a25e5c03c97ad47c",
        "appVersion": "1.0.0",
        "shopId": "ImbjsXWd9ZHbVDfr"
    },
    "timestamp": 1680530463
}

App Action

{
  "source": {
    "url": "http://localhost:8000/",
    "appVersion": "1.0.0",
    "shopId": "ImbjsXWd9ZHbVDfr"
  },
  "data": {
    "ids": [
      "3e069abfb24f45a5a25e5c03c97ad47c"
    ],
    "entity": "product",
    "action": "detail"
  }
}

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.