purchased.at PHP SDK
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bundle
examples
publish
src
tests/Purchase
.gitignore
LICENSE
README.md
composer.json
composer.phar
phpmd.xml
phpunit.xml

README.md

purchased.at PHP SDK

Installation

Quick and Simple

Download the bundled SDK from purchasedat_sdk.php and save it into your source directory.

Alternative: Composer

Add the following dependency (and repository) to your composer.json

{
    "require": {
        "purchased-at/sdk-php": "*"
    }
}

Quick Start

<?php

// make sure you place the purchasedat_sdk.php file is present on your server
require_once 'purchasedat_sdk.php';

$apiKey = 'REPLACE_WITH_API_KEY';

// be sure to specify the customer's e-mail address (mandatory!)
$options = new \PurchasedAt\PurchaseOptions('test-customer@purchased.at');

// test mode
$options->setTestEnabled(true);

?>

<html>
    <body>

        <button data-purchasedat-widget-open>Buy!</button>
        <?= \PurchasedAt\renderScript($apiKey, $options) ?>

    </body>
</html>