PHPackages                             news-ladder/publisher-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. news-ladder/publisher-sdk

ActiveLibrary[API Development](/categories/api)

news-ladder/publisher-sdk
=========================

News Ladder PHP SDK to interact with the Publisher API

10[4 PRs](https://github.com/news-ladder/php-publisher-sdk/pulls)PHP

Since Dec 15Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/news-ladder/php-publisher-sdk)[ Packagist](https://packagist.org/packages/news-ladder/publisher-sdk)[ RSS](/packages/news-ladder-publisher-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

News Ladder SDK for the Publisher API
=====================================

[](#news-ladder-sdk-for-the-publisher-api)

The **News Ladder SDK** is designed to streamline handling transactions and HTTP requests for integration between the News Ladder system and publisher systems. It provides a straightforward way to manage and verify transactions, send requests, and handle origin configurations for allowed services.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
    - [Transaction](#transaction)
    - [Request](#request)
    - [Origins](#origins)
- [License](#license)

---

Overview
--------

[](#overview)

The News Ladder SDK simplifies integration between News Ladder REST APIs and publisher eco system. It includes classes for managing transactions, sending HTTP requests, and defining origin configurations. With clear methods and examples, it aims to speed up development and ensure robust operations.

---

Features
--------

[](#features)

- **Transaction Handling:** Verify and manage transactions with ease.
- **HTTP Request Management:** A utility class to send HTTP requests with payloads.
- **Origin Configuration:** Predefined constants for allowed origins and service URLs.
- **MIT Licensed:** Open-source and free to use.

---

Installation
------------

[](#installation)

The News Ladder SDK is available via Composer. Install it by running:

```
composer require news-ladder/publisher-sdk
```

Alternatively, update your `composer.json`:

```
{
    "require": {
        "news-ladder/publisher-sdk": "dev-main"
    }
}
```

Then, execute:

```
composer install
```

**Dependencies:**Ensure you are using **PHP 7.4+** with Composer installed.

---

Usage
-----

[](#usage)

### Transaction

[](#transaction)

The `Transaction` class represents a transaction in the News Ladder system. Use it to verify and manage transactions.

**Example:**

This object ist a transaction object. This key values are necessary for the `Transaction HTTP Request`.

```
{
    "domain":           "The domain from the 'become publisher' process",
    "magazineKey":      "The magazine key from the 'become publisher' process",
    "name":             "The name of the article, e.g., article title",
    "url":              "The URL of the article",
    "articleEID":       "The external page ID; can be a string or any identifier related to the article",
    "checkoutToken":    "The token from the URL's GET parameter"
}
```

```
