JSPM

digitalriverjs-react

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q9353F
  • License Apache-2.0

Package Exports

  • digitalriverjs-react
  • digitalriverjs-react/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (digitalriverjs-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Digital River React component

This is a React library for integrating Digital River's APIs, including Digital River API, Digital River Checkout, and Dynamic Pricing.

Prerequisites

This library requires React version 17 or 18. Make sure to have one of these versions installed in your project:

Installing

npm install digitalriverjs-react

How to use

Import the necessary components from the library:

import { DigitalRiverContainer, PaymentContext } from 'digitalriverjs-react';

Use the components in your application:

<DigitalRiverContainer publicApiKey="your-public-api-key" locale="en-US">
  <PaymentContext billingAddress={billingAddress} amount={amount} currency={currency}>
    {/* Your components here */}
  </PaymentContext>
</DigitalRiverContainer>

In this example, replace "your-public-api-key" with your actual public API key from Digital River. The billingAddress object should contain the billing address details, and the amount and currency props should reflect the total amount and currency of the transaction. Remember to wrap your components with the PaymentContext and DigitalRiverContainer components to ensure they have access to the necessary context and functionality provided by the Digital River API.

Running the tests

To run the automated tests for this system, use the command npm run test. To run the demo, use the command npm run start.