Download the PHP package cullylarson/paypal-experience-cli without Composer
On this page you can find all versions of the php package cullylarson/paypal-experience-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cullylarson/paypal-experience-cli
More information about cullylarson/paypal-experience-cli
Files in cullylarson/paypal-experience-cli
Package paypal-experience-cli
Short Description A set of command-line tools for managing 'web experience profiles' in Paypal.
License MIT
Homepage https://github.com/cullylarson/paypal-experience-cli
Informations about the package 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: https://developer.paypal.com/docs/api/
- PayPal PHP SDK: https://github.com/paypal/PayPal-PHP-SDK
Install
Configuration
Configuration is done using environment variables. You can set these yourself, or set them in a .env
file (https://github.com/vlucas/phpdotenv) 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
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
create-experience-profile
Create a web experience profile in PayPal.
USAGE
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 all of the web experience profiles you have in PayPal.
USAGE
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
ARGUMENTS
- 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 a web experience profile from PayPal.
USAGE
ARGUMENTS
- 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
1. Create a directory for your profiles.
2. Set the directory in your .env
file.
3. Create a MyFirstProfile.php
file in your profiles directory.
4. Edit your MyFirstProfile.php
file.
5. Create this experience profile in Paypal.
6. List the experience profiles you have in Paypal, to see your new profile.
7. Update your profile, by first editing your profiles/MyFirstProfile.php
file and making some changes.
8. Now run the update command. It will pull the changes from your MyFirstProfile
class and send them to Paypal.
9. Remove the profile from Paypal.
All versions of paypal-experience-cli with dependencies
ext-curl Version *
ext-json Version *
paypal/rest-api-sdk-php Version 1.1.*
vlucas/phpdotenv Version ~1.1