PayPal

PayPal has no dashboard to create products afaik, but they will be synced if you create some via their API.
Make sure to target the right endpoint as it has one each for sandbox and production environments.

Using the provider

site/config/config.php
<?php

return [
   'bnomei.kart.provider' => 'paypal',
   // other options
];

API Credentials

You can create the CLIENT ID and SECRET within the PayPal developer dashboard. Make sure to start testing your application in Sandbox-mode. You need to provide the credentials as config values or via an .env file (plugin).

.env
PAYPAL_CLIENT_ID=XXX
PAYPAL_CLIENT_SECRET=ZZZ
PAYPAL_ENDPOINT=https://api-m.sandbox.paypal.com
# PAYPAL_ENDPOINT=https://api.paypal.com

Customzing the Checkout

You can use callbacks to customise both the checkout process and each line item. The returned arrays from your callbacks will be merged with the defaults created by the plugin for this provider, allowing you to override those defaults. Check the relevant PHP class and the linked online documentation for the provider to learn more about the expected data structure.

<?php

return [
    'bnomei.kart.paypal.checkout_options' => function (\Bnomei\Kart\Kart $kart) {
        // configure the checkout based on current kart instance
        // https://developer.paypal.com/docs/api/orders/v2/#orders_create
        return [];
    },
    'bnomei.kart.paypal.checkout_line' => function (\Bnomei\Kart\Kart $kart, \Bnomei\Kart\CartLine $line) {
        // add custom data to the current checkout line
        return [];
    },
    // other options
];
Kirby Kart is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2025 Bruno Meilick All rights reserved.