This repository contains the open source PHP SDK that allows you to access wallee from your PHP app.
https://app-wallee.com/doc/api/web-service
You can use Composer or install manually
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
composer require wallee/sdk
Alternatively you can download the package in its entirety. The Releases page lists all stable versions.
Uncompress the zip file you download, and include the autoloader in your project:
require_once '/path/to/php-sdk/autoload.php';
<?php
require_once(__DIR__ . '/autoload.php');
// Configuration
$spaceId = 405;
$userId = 512;
$secret = "FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=";
// Setup API client
$client = new \Wallee\Sdk\ApiClient($userId, $secret);
// Create API service instance
$transactionService = new \Wallee\Sdk\Service\TransactionService($client);
// Create transaction
$lineItem = new \Wallee\Sdk\Model\LineItemCreate();
$lineItem->setName('Red T-Shirt');
$lineItem->setUniqueId('5412');
$lineItem->setSku('red-t-shirt-123');
$lineItem->setQuantity(1);
$lineItem->setAmountIncludingTax(29.95);
$lineItem->setType(\Wallee\Sdk\Model\LineItemType::PRODUCT);
$transaction = new \Wallee\Sdk\Model\TransactionCreate();
$transaction->setCurrency("EUR");
$transaction->setLineItems(array($lineItem));
$transaction->setAutoConfirmationEnabled(true);
$createdTransaction = $transactionService->create($spaceId, $transaction);
// Create Payment Page URL:
$redirectionUrl = $transactionService->buildPaymentPageUrl($spaceId, $createdTransaction->getId());
header('Location: ' . $redirectionUrl);
Please see the license file for more information.