PHPackages                             cullylarson/paypal-experience-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. cullylarson/paypal-experience-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

cullylarson/paypal-experience-cli
=================================

A set of command-line tools for managing 'web experience profiles' in Paypal.

v1.0.3(11y ago)012MITPHPPHP &gt;=5.3.0

Since Feb 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cullylarson/paypal-experience-cli)[ Packagist](https://packagist.org/packages/cullylarson/paypal-experience-cli)[ Docs](https://github.com/cullylarson/paypal-experience-cli)[ RSS](/packages/cullylarson-paypal-experience-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Paypal Experience CLI
=====================

[](#paypal-experience-cli)

A set of command-line tools for managing "web experience profiles" in Paypal.

PayPal now allows you to customize the payment experience your customers have, when they go to PayPal to make a payment (what used to be called Express Checkout). To do this, you need to create web experience profiles in PayPal, using their new REST API. It's stupid. I don't know why they don't just let you do that in your Developer Dashboard, but it's the way it is. This is a simple command line tool that allows you to Create, List, Update, and Remove experience profiles. I hope it saves some of you the headache of having to implement something yourself.

- PayPal REST API:
- PayPal PHP SDK:

Install
-------

[](#install)

```
curl -s http://getcomposer.org/installer | php
php composer.phar require cullylarson/paypal-experience-cli

```

Configuration
-------------

[](#configuration)

Configuration is done using environment variables. You can set these yourself, or set them in a `.env` file () which the experience commands will load automatically. An example file is provided, named `.env.dist`. You can just copy it and set appropriately. If you want to use the `.env` file, it needs to be in the directory from which you are going to run commands. If you want to set the environment variables yourself, just look at the `.env.dist` file to see which ones you need to set.

Profiles
--------

[](#profiles)

You'll need to create some `Profile` classes. These define the experience profile you'd like to create in Paypal. They must extend `\PayPal\ExperienceCli\Profile`, and must at least implement the `GetProfileName` function. There are a couple examples in the `sample-profiles` directory.

Create a directory for your profiles, and put them in there. Then set `PAYPAL_EXPERIENCE_CLI_PROFILES_DIR` in your `.env` file to this directory.

A few of the commands ask for a profile name. This is the class name of your profile, without the namespace (though, a namespace can be provided as another argument). It also needs to be the name of the PHP file that contains the class (without the `.php` extension). For example, if you put your profiles in a directory named `profiles`, and you created a profile class named `MyFirstProfile`, then that class needs to be defined in the `profiles/MyFirstProfile.php` file.

Commands
--------

[](#commands)

### create-experience-profile

[](#create-experience-profile)

Create a web experience profile in PayPal.

#### USAGE

[](#usage)

```
> php ./vendor/bin/create-experience-profile PROFILE_CLASS_NAME [PROFILE_NAMESPACE]

```

#### ARGUMENTS

[](#arguments)

- **PROFILE\_CLASS\_NAME** *(required)* -- The name of your class (e.g. `MyFirstProfile`). Don't include the .php extension.
- **PROFILE\_NAMESPACE** *(optional)* -- If your profile class has a namespace, provide it here (e.g. `"\\My\\Favorite\\Namespace"`). Don't include a final `\` (it won't work).

### list-experience-profiles

[](#list-experience-profiles)

List all of the web experience profiles you have in PayPal.

#### USAGE

[](#usage-1)

```
> php ./vendor/bin/list-experience-profiles

```

### update-experience-profile

[](#update-experience-profile)

Update a web experience profile in PayPal. You can do this by first editing the `Profile` class you originally used to create this experience profile, or you can create a new class and just pass it as an argument. Basically any changes to the class will be sent to PayPal.

#### USAGE

[](#usage-2)

```
> php ./vendor/bin/update-experience-profile EXPERIENCE_PROFILE_ID PROFILE_CLASS_NAME [PROFILE_NAMESPACE]

```

#### ARGUMENTS

[](#arguments-1)

- **EXPERIENCE\_PROFILE\_ID** *(required)* -- The web experience profile ID of the profile you'd like to modify. You can get this by listing your profiles.
- **PROFILE\_CLASS\_NAME** *(required)* -- The name of your class (e.g. `MyFirstProfile`). Don't include the .php extension. Info from this class will be used to update your experience profile in PayPal.
- **PROFILE\_NAMESPACE** *(optional)* -- If your profile class has a namespace, provide it here (e.g. `"\\My\\Favorite\\Namespace"`). Don't include a final `\` (it won't work).

### remove-experience-profile

[](#remove-experience-profile)

Remove a web experience profile from PayPal.

#### USAGE

[](#usage-3)

```
> php ./vendor/bin/remove-experience-profile EXPERIENCE_PROFILE_ID

```

#### ARGUMENTS

[](#arguments-2)

- **EXPERIENCE\_PROFILE\_ID** *(required)* -- The web experience profile ID of the profile you'd like to remove. You can get this by listing your profiles.

Example of Everything
---------------------

[](#example-of-everything)

#### 1. Create a directory for your profiles.

[](#1-create-a-directory-for-your-profiles)

```
> mkdir profiles

```

#### 2. Set the directory in your `.env` file.

[](#2-set-the-directory-in-your-env-file)

```
PAYPAL_EXPERIENCE_CLI_PROFILES_DIR="profiles"

```

#### 3. Create a `MyFirstProfile.php` file in your profiles directory.

[](#3-create-a-myfirstprofilephp-file-in-your-profiles-directory)

```
> touch profiles/MyFirstProfile.php

```

#### 4. Edit your `MyFirstProfile.php` file.

[](#4-edit-your-myfirstprofilephp-file)

```
