ArtisanPack UI
DocsEcommerce PaypalInstallation Overview

Installation Overview

Ecommerce Paypal v1.0.0

Everything you need to install the PayPal gateway and connect it to your PayPal account. - Requirements - PHP, Laravel, the engine, and optional packages...

Everything you need to install the PayPal gateway and connect it to your PayPal account.

In this section

  • Requirements - PHP, Laravel, the engine, and optional packages
  • PayPal App and Credentials - Creating sandbox and live REST apps, credentials, webhooks, and going live
  • Configuration - Every configuration key, its environment variable, and the store settings that override it
  • Front-End Setup - Tailwind sources, the published JS module, and CSP

Install via Composer

composer require artisanpack-ui/ecommerce-paypal

The service provider is auto-discovered. It registers the package with the engine's SatelliteRegistry first; when the satellite has been uninstalled, nothing else is wired.

Run the install command

php artisan ecommerce-paypal:install

It:

  1. Publishes the config to config/artisanpack/ecommerce-paypal.php. If that file already exists it asks before overwriting it; without a terminal it keeps your file. --force overwrites without asking.
  2. Publishes the prebuilt JS module (dist/paypal-checkout.js) to public/vendor/ecommerce-paypal, replacing an older copy.
  3. Asks whether to publish and run the migrations. --migrate does both without asking (it runs migrate --force). Otherwise run php artisan migrate yourself; the migrations also load from the package without publishing.
  4. Prints the Tailwind @source line, the Content-Security-Policy sources, and the next steps.

See Artisan Commands.

Publishing

Tag Publishes to Use it to
ecommerce-paypal-config config/artisanpack/ecommerce-paypal.php Change defaults (the install command does this)
ecommerce-paypal-assets public/vendor/ecommerce-paypal Serve paypal-checkout.js (the install command does this)
ecommerce-paypal-migrations database/migrations/ecommerce-paypal Publish the migrations
ecommerce-paypal-views resources/views/vendor/ecommerce-paypal Override Blade views
ecommerce-paypal-lang lang/vendor/ecommerce-paypal Override translations

Republish the assets after every upgrade, so the browser gets the module that matches the PHP code:

php artisan vendor:publish --tag=ecommerce-paypal-assets --force

The config loads under artisanpack.ecommerce-paypal:

config( 'artisanpack.ecommerce-paypal.intent' ); // 'capture'

The migrations load from the package, so publishing them is optional. If your app calls the engine's Ecommerce::ignoreMigrations(), the package's migrations aren't loaded either: publish them and run them from their folder, which php artisan migrate doesn't scan on its own. php artisan ecommerce-paypal:install --migrate does both for you; by hand:

php artisan migrate --path=database/migrations/ecommerce-paypal

Views and translations load under the ecommerce-paypal:: namespace. A published view doesn't pick up fixes in later releases, so prefer the extension points.

Tables

Table Holds
ecommerce_paypal_customers The PayPal vault customer id for each engine customer, per mode
ecommerce_paypal_payment_tokens Saved payment methods: the PayPal token id, gateway, type (paypal, card, venmo), display data (brand, last digits, expiry, email), default flag, mode, and last use. Soft-deleted

No card number, CVV, or other card data is ever stored. Payment details for an order are kept on the engine's order and cart meta (orders.meta.paypal, cart.meta.paypal).

Routes

Route Path When
Webhooks (engine) POST ecommerce/webhooks/paypal Always, through the engine's ecommerce.webhooks route
artisanpack.ecommerce-paypal.apple-pay.domain-association GET /.well-known/apple-developer-merchantid-domain-association Unless methods.apple_pay.serve_domain_association is off. See Apple Pay
artisanpack.ecommerce.account.paypal-payment-methods GET {account prefix}/payment-methods With storefront-livewire installed and its routes on. See Saved Payment Methods
ecommerce.api.me.paypal.payment-methods.* {api_prefix}/{version}/me/paypal/payment-methods With the engine's REST API on (artisanpack.ecommerce.features.rest). See Saved Payment Methods

Uninstalling

The package registers a satellite uninstaller with the engine. php artisan ecommerce:satellite:uninstall keeps the PayPal data by default, so a reinstall picks up the stored customers and saved methods. With --purge, after the engine's confirmation, the current mode's saved tokens are deleted at PayPal (methods already removed are skipped, since PayPal deleted them), and the engine then rolls back the package's migrations (dropping both tables). If PayPal can't delete a token, the uninstall stops with an error saying how many tokens PayPal couldn't delete, and nothing is dropped; run the uninstall again. Tokens of the other mode can't be deleted with the current credentials; they are logged as a warning, and the purge goes ahead, so delete them in that mode's PayPal account.

Next steps

Stay in the Loop

Monthly tips, tutorials and package updates — plus a free Quick Start cheat sheet.

Subscribe
Edit this page on GitHub