Checkout
[ALPHA] This provider for Checkout.com is in alpha stage. Use at your own risk. Any feedback is very welcome.
Using the provider
site/config/config.php
<?php
return [
'bnomei.kart.provider' => 'checkout',
// other options
];
API Credentials
https://www.checkout.com/docs
... config values or via an .env file (plugin).
.env
CHECKOUT_SECRET_KEY=XXX
CHECKOUT_PUBLIC_KEY=ZZZ
# CHECKOUT_ENDPOINT=
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.providers.checkout.checkout_options' => function (\Bnomei\Kart\Kart $kart) {
// configure the checkout based on current kart instance
// https://developer.squareup.com/reference/square/checkout-api/create-payment-link
return [];
},
'bnomei.kart.providers.checkout.checkout_line' => function (\Bnomei\Kart\Kart $kart, \Bnomei\Kart\CartLine $line) {
// add custom data to the current checkout line
// https://developer.squareup.com/docs/orders-api/create-orders#create-an-ad-hoc-line-item
return [];
},
// other options
];