PayPal Commerce Platform (PPCP)

Website Setup

PayPal Commerce Platform (PPCP) integration consists of two main steps

  1. Onboarding: Connect the PayPal seller account to the CORESense app to enable transactions on behalf of sellers.
  2. Website Configuration: Set up the rendering of PayPal buttons on the checkout screen.

Onboarding

To begin the onboarding process, follow these steps:

Note: Ensure that another PayPal payment type named "PayPal" is disabled before activating this integration.

Website Configuration

The next step is to make template changes for the configuration in a new website project:

{literal}
<script type="text/javascript">
	var loadPPCPPlugin = function() {
		PayPalPaymentProcessorPlugin.initialize({
			clientId: '{/literal}{$ppcp_client_id}{literal}',
			paypalEnvironment: '{/literal}{$ppcp_environment}{literal}',
			enableVenmoButton: {/literal}{$ppcp_venmo}{literal},
			enablePayLaterButton: {/literal}{$ppcp_paylater}{literal},
			enableCardButton: {/literal}{$ppcp_card}{literal},
			paypalFragmentId: 'paypalCheckoutContainer',
		})
	}

	if (typeof PayPalPaymentProcessorPlugin === 'undefined') {
		var e = document.createElement('script')
		e.src = '{/literal}{$secure_base_href}javascript/ppcp.js{literal}'
		e.type = 'text/javascript'
		e.addEventListener('load', loadPPCPPlugin)
		document.getElementsByTagName('head')[0].appendChild(e)
	} else {
		loadPPCPPlugin()
	}
</script>
{/literal}
<div id="payment-message"></div>
<div id="paypalCheckoutContainer" style="max-width: 100px;margin-top: 10px;"></div>

Note: Preview website project to test your new integration.

For Developers

Developers can initialize the PPCP payment plugin with various options that can be overridden by passing key-value parameters. Here is the list of available options in JSON format:

{
  "paypalEnvironment": "production",
  "paypalFragmentId": "paypalCheckoutContainer",

  // Buttons
  "enableVenmoButton": false,
  "enablePayLaterButton": false,
  "enableCardButton": false,

  // Button style
  "buttonStyle": {
    "layout": "vertical",   // horizontal | vertical
    "size": "responsive",   // medium | large | responsive
    "shape": "pill",        // pill | rect
    "color": "gold",        // gold | blue | silver | black
    "fundingicons": true,   // true | false
    "tagline": false        // true | false
  },

  // Fragments
  "checkoutFormId": "form#checkout_form",
  "messageBoxId": "payment-message"
}

© 2023 CORESense ·  info@coresense.com · 125 High Rock Avenue, Saratoga Springs, NY 12866