@paypal/messaging-components
v1.64.12
Published
PayPal messaging library for integrating PayPal Credit messaging on merchant websites
Downloads
482
Maintainers
Keywords
Readme
PayPal Credit Messaging
A messaging component allowing easy integration of PayPal Credit Messages onto your site.
Dev Docs
See developer.paypal.com/docs/business/pay-later/integrate/
Development
Please feel free to follow the Contribution Guidelines to contribute to this repository. PRs are welcome, but for major changes please raise an issue first.
Quick Setup
Set up your env:
npm install
Run tests:
npm test
Run in dev mode:
npm start
Creating a Bundle
npm run build
Options
-v
- version, optional-e
- environment, one ofproduction
,sandbox
orstage
-m
- module, optional, one oflibrary
,components
, orrender
-t
- tag, optional, name of the stage tag-s
- testEnv, optional, link to a test environment
The command you'll most likely need to use is
npm run build -- -t stage-tag-name -s test-environment-link
Scripts
build
- runs semantic-release/assets.sh to build assets for all environments in
dist/
- runs semantic-release/assets.sh to build assets for all environments in
build:<env>
where<env>
isstage
,sandbox
, orproduction
- runs webpack with
NODE_ENV=<env>
- runs webpack with
build:analyze
- runs webpack-bundle-analyzer in static gzip mode
build:demo
- runs webpack with
env.demo
set
- runs webpack with
dev
- runs webpack-dev-server with
TARGET=sdk
,NODE_ENV=local
,STAGE_TAG=local
- runs webpack-dev-server with
dev:<target>
where<target>
isstandalone
,modal
, orlander
- runs webpack-dev-server with
TARGET=<target>
,NODE_ENV=local
,STAGE_TAG=local
- note:
modal
usesTARGET=standalone-modal
- runs webpack-dev-server with
dev:<env>
where<env>
isstage
,sandbox
, orproduction
- runs webpack-dev-server with
TARGET=standalone
andNODE_ENV=<env>
- runs webpack-dev-server with
lint
- checks our codebase for style issues
preinstall
- runs automatically on
npm install
and removesnode_modules/
- runs automatically on
start
- runs
npm run dev
- runs
test
- runs all unit tests
test:<type>
where<type>
isfunc
,func:nosnaps
orfunc:ciupdate
func
runs all snapshot functional testsfunc:nosnaps
runs all non-snapshot functional testsfunc:ciupdate
updates all snapshots generated by functional tests
Testing
Functional
- Run
npm run dev:ci
in one command line instance - In a second window run the below command, which runs tests for a specific
integrationType
integrationType
is one of:api
,sdk
,standalone
, orwebpage
CONFIG_PATH={locale}/{account} npm run test:func:snapshots -- --testPathPattern {integrationType}
Example
CONFIG_PATH=US/DEV_US_MULTI npm run test:func:snapshots -- --testPathPattern sdk
Alternatively, you can remove -- --testPathPattern {integrationType}
and just run the following to run tests on an account for all integration types.
CONFIG_PATH={locale}/{account} npm run test:func:snapshots
Stage
For PayPal Internal Testing Only:
To test against PayPal's standard stage url, ensure that the demo page contains the following script, then run npm run dev:stage
:
//Change the value of the url and add the script to the demo page (i.e. standalone.html)
<script>window.__TEST_ENV__ = "https://www.{PAYPAL_STAGE_URL_HERE}.com"</script>
If you are looking to run against an alternative environment, set the window.__TEST_ENV__
global to override the environment. Please note, this is only available in development environments.
//Change the value of the test environment
<script>window.__TEST_ENV__ = "https://www.te-test-env.com"</script>
Releasing
This package is published weekly, Every Wednesday. Please view our Changelog to stay updated with bug fixes and new features.