PaddleClient
PaddleClient class for interacting with the Paddle API
This class provides methods to manage customers, addresses, and transactions
using the Paddle payment platform API.
Information
| Property | Value |
|---|---|
| Namespace | NymarkType\Fountain |
__construct()
Initialize the PaddleClient with configuration from Kirby options
getCustomerData()
Get customer data (email, name) from customer id
Parameters
| Name | Type | Description |
|---|---|---|
$id |
string |
Unique Paddle ID for this customer entity, prefixed with ctm_ |
- Returns:
array|string— Customer data array or error message
createTransaction()
Create a new transaction and return the checkout URL
Parameters
| Name | Type | Description |
|---|---|---|
$email |
string|null |
Customer's email address |
$name |
?string |
|
$address |
array |
Customer's address data |
$cartData |
array |
Cart data |
$customData |
array |
Additional custom data |
- Returns:
array|string— Paddle checkout URL or error message
Throws:
Exception— If email is missing or input arrays are not associative
getTransaction()
Get transaction details
Parameters
| Name | Type | Description |
|---|---|---|
$transaction_id |
string |
Paddle transaction ID |
- Returns:
array|string— Transaction data or error message
getInvoice()
Get invoice link based on transaction ID.
Parameters
| Name | Type | Description |
|---|---|---|
$transaction |
string |
Transaction ID |
- Returns:
array|string|bool— Paddle invoice url
Source: /classes/PaddleClient.php