Download the PHP package craftcms/commerce-paypal-checkout without Composer

On this page you can find all versions of the php package craftcms/commerce-paypal-checkout. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package commerce-paypal-checkout

PayPal Checkout for Craft Commerce

This plugin provides a PayPal Checkout gateway integration for Craft Commerce.

Requirements

This plugin requires Craft 4.0 and Craft Commerce 4.0 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “PayPal Checkout for Craft Commerce”. Then click Install in the plugin’s modal window.

With Composer

Open your terminal and run the following commands:

Setup

Creating PayPal REST API Credentials

The following steps are from the PayPal guide on how to create REST API credentials.

REST API credentials include a client ID and secret. Here's how you generate the credentials:

  1. Log in to the PayPal Developer Portal using the same credentials you use for PayPal.
  2. On the My Apps & Credentials page, click Live or Sandbox depending on whether you need an app for testing (Sandbox) or going live (Live).
  3. Click Create App under REST API apps. Any previously created REST API apps will appear in the table above the Create App button.
  4. Enter the name of your REST API app in the App Name field, and select a Sandbox business account to associate with your app. Note: Remember that you can't use a Live credit card in Sandbox, and you can't use a test credit card in your Live account.
  5. Click Create App.
  6. Your credentials, the client ID and secret, are displayed on the app details page that displays after you click Create App.
  7. Request permissions for REST API features that apply to your integration:
    • PayPal payments

You will now be able to see the client ID and secret for your newly created app.

When you are ready to take your code live, make sure you create a Live app to get live credentials.

Use the Live and Sandbox toggle at the top of My Apps & Credentials to switch between app types and view your credentials for each.

Creating PayPal Checkout Gateway in Commerce

To add the PayPal Checkout gateway, go to CommerceSettingsGateways, create a new gateway, and set the gateway type to “PayPal Checkout”.

In the gateway settings, enter the client ID and secret for your REST app in their respective fields.

Cart Info / Cost Breakdown

Turning on the Send Cart Information setting for this gateway will send cart items and cost breakdown through to PayPal.

Note: If you’re using deprecated custom adjuster types, this setting will need be turned off.

Paying with Non-Primary Currency

When using the getPaymentFormHtml() method (e.g. cart.gateway.getPaymentFormHtml({})) and allowing payment in a currency other than the primary currency, you must pass the currency ISO in the method params.

For example, if you’ve already set the alternative payment currency on the cart you could do the following:

This is required when paying with an alternative payment currency due to the integration of the PayPal JavaScript SDK.

SDK Query String Parameters

This gateway allows passing specific query string parameters at runtime, as specified in the PayPal documentation.

The allowed parameters are currency (as detailed above), disable-card, disable-funding, enable-funding and locale.

For example, to disable PayPal credit funding you could output the payment form as follows:


All versions of commerce-paypal-checkout with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0-beta.6
craftcms/commerce Version ^5.0.0-beta.1
paypal/paypal-checkout-sdk Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package craftcms/commerce-paypal-checkout contains the following files

Loading the files please wait ....