itelmenko/php-paddle-client

Paddle.com API Client PHP library

1.0.3 2022-04-25 08:10 UTC

This package is auto-updated.

Last update: 2024-04-18 19:10:23 UTC


README

This library provides convenient way of querying Paddle API from php code.

Requirements

PHP 7.2 or later.

Installation via Composer

composer require itelmenko/php-paddle-client

Usage

$client = new \Paddle\Client();
$client->setVendorId(111);
$client->setVendorAuthCode('dlkegvke3klge3mg3...');
$price = new \Paddle\Price($order->amount, new \Paddle\Currency('USD'));
$invoice = new \Paddle\Invoice();

$invoice->addPrice(5.95)
    ->setPassthrough('order-id-2464')
    ->setReturnUrl('https://yourdomain.com/return')
    ->setQuantity(1, FALSE)
    ->setExpires(time())
    ->setCustomerEmail('user@mail.com');

$invoice->setProductId(111111);

$url = $client->createPaymentUrl($invoice);