-
Notifications
You must be signed in to change notification settings - Fork 2
Setup
In order to make use of the Jekyll-EWP plugin, you need:
- A PayPal business account
- A private key, public certificate, and a copy of paypal's public certificate
- Download or clone the repository and copy the
jekyllEWP.rbfile into the_pluginsfolder on your jekyll site -
Add your public certificate to your paypal business account. Be sure to download Paypal's Certificate if you havent already and save a copy of your Certificate ID.
- You will need to pass the contents from all three of these files into the correct environment variables (listed below). This is a security measure to prevent your cryptographic keys.
-
EWP_PRIVKEY - your private key
-
EWP_PUBCERT - your public certificate that you uploaded to paypal
-
EWP_PAYPAL_PUBCERT - paypal's public certificate that you downloaded
-
EWP_PRIVKEY_PASS - your private key's password
If you are just testing your site locally, you may find it useful to create a script like this with the values filled in:
#!/bin/bash
export EWP_PRIVKEY_PASS="PASSWORD HERE"
export EWP_PAYPAL_PUBCERT="-----BEGIN CERTIFICATE-----
MIIDoTCCAw...GiP0PpK48cdF
-----END CERTIFICATE-----
"
export EWP_PUBCERT="-----BEGIN CERTIFICATE-----
MIICrjCCAhegAw...NdQDV1qRk0MSRkR
-----END CERTIFICATE-----
"
export EWP_PRIVKEY="-----BEGIN RSA PRIVATE KEY-----
MIICXgIBA...TsIpfTMw==
-----END RSA PRIVATE KEY-----
"
# whatever command you need to run your jekyll site
bundle exec jekyll serve
Pay attention to the newlines. Every private key and certificate needs three newlines in it, one after -----BEGIN -----, one after the key contents itself, and one after -----END -----. If not done correctly, this step can cause the plugin to prevent your site from building and throw a nested asn1 error. See here for more information
also, DO NOT EVER commit this script to your repository or upload it to your site in any way that would allow it to be downloaded or seen by anyone but you. ANYONE WITH ACCESS TO THIS SCRIPT WILL BE ABLE TO MODIFY YOUR BUTTON CODE
- Add the following options to your
_config.yml:
paypal_cert_id: [the certificate ID you saved earlier]
paypal_email_address: [your paypal business email]
paypal_sandbox_mode: [true if you want to test using a [sandbox account](https://developer.paypal.com/docs/classic/lifecycle/ug_sandbox/#the-testing-process), false otherwise]
- Make sure you have
nameandpricevalues set in the front matter of the page where these buttons will appear. This is where the tag gets the name and price of your item/donation. - Add the tag to your page
- Block unencrypted payments on your paypal account