Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paypal/accelerated-checkout-loader

Package Overview
Dependencies
Maintainers
21
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paypal/accelerated-checkout-loader

Loads accelerated checkout script

  • 2.0.0-beta.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
56K
increased by3.26%
Maintainers
21
Weekly downloads
 
Created
Source

accelerated-checkout-loader

Provides a static asset loader to fetch the latest PayPal Accelerated-Checkout components.

This version (1.x.x) loads AXO SDK v0.6 (boba).

Installation

npm install -S @paypal/accelerated-checkout-loader

Minified

Serves the minified version of the AXO script.

import { loadAxo } from "@paypal/accelerated-checkout-loader/dist/loader.esm";

loadAxo({ minified: true })
  .then(() => {
    console.log("minified script loaded");
    return;
  })
  .catch((err) => {
    console.log("There was an error: ", err);
  });

If no options are passed, the minified script is served by default

import { loadAxo } from "@paypal/accelerated-checkout-loader/dist/loader.esm";

loadAxo()
  .then(() => {
    console.log("minified script loaded");
    return;
  })
  .catch((err) => {
    console.log("There was an error: ", err);
  });

Unminified

Serves the unminified version of the AXO script.

import { loadAxo } from "@paypal/accelerated-checkout-loader/dist/loader.esm";

loadAxo({ minified: false })
  .then(() => {
    console.log("script loaded");
    return;
  })
  .catch((err) => {
    console.log("There was an error: ", err);
  });

Testing

In order to test our accelerated checkout loader, we'll need to install braintree.js repo locally, which creates the final connect.js build for us to be consumed by accelerated checkout.

Run npm link in the accelerated-checkout-loader folder, then in the braintree repo, install node_modules and then npm run build. This should create a connect.js file under dist/hosted/web/{VERSION}, which should include your loader changes.

Now you can either stage it using web stage or just store it locally to be replaced whereever you were originally calling the connect file.

Keywords

FAQs

Package last updated on 15 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc