Shop PayPal: Extension and action examples
Use the action functions with records and Data objects supplied by your application. They pass each argument to the package operation and return its result.
These adapters show container registration. Use the owning package registry when a contract requires contributor discovery.
Contract adapters wrap an existing implementation. Call their registration function from your service provider with that implementation; tagged contracts keep their declared tag. Resolve the backend by its concrete class before registration so the replacement contract does not resolve itself. Static contract metadata uses one backend class per adapter.
Action captureWalletPayment
Section titled “Action captureWalletPayment”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\ShopPaypal;
function runCaptureWalletPayment(string $storeId, string $orderId): void{ \Capell\ShopPayPal\Actions\CaptureShopPayPalWalletPaymentAction::run($storeId, $orderId);}Action configureLiveAccount
Section titled “Action configureLiveAccount”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\ShopPaypal;
function runConfigureLiveAccount(string $storeId, string $merchantId, string $clientId, #[\SensitiveParameter] string $clientSecret, string $webhookId, string $successUrl, string $cancelUrl): \Capell\ShopPayPal\Models\ShopPayPalLiveAccount{ return \Capell\ShopPayPal\Actions\ConfigureShopPayPalLiveAccountAction::run($storeId, $merchantId, $clientId, $clientSecret, $webhookId, $successUrl, $cancelUrl);}Action setLiveMode
Section titled “Action setLiveMode”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\ShopPaypal;
function runSetLiveMode(string $storeId, bool $live): \Capell\ShopPayPal\Models\ShopPayPalLiveAccount{ return \Capell\ShopPayPal\Actions\SetShopPayPalLiveModeAction::run($storeId, $live);}Action startCheckout
Section titled “Action startCheckout”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\ShopPaypal;
function runStartCheckout(string $storeId, string $orderId): string{ return \Capell\ShopPayPal\Actions\StartShopPayPalCheckoutAction::run($storeId, $orderId);}Action startWalletPayment
Section titled “Action startWalletPayment”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\ShopPaypal;
function runStartWalletPayment(string $storeId, string $orderId): string{ return \Capell\ShopPayPal\Actions\StartShopPayPalWalletPaymentAction::run($storeId, $orderId);}