npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vendure-scalapay

v3.0.0

Published

## Overview

Downloads

84

Readme

Scalapay Payment Plugin for Vendure

Overview

This plugin integrates Scalapay, a flexible and user-friendly payment solution, with your Vendure e-commerce platform. It enables seamless transactions and enhances the checkout experience for your customers.

Installation

Install the Scalapay plugin via npm, pnpm, or yarn:

npm install vendure-scalapay
# OR
pnpm install vendure-scalapay
# OR
yarn add vendure-scalapay

Configuration

In your vendure-config.ts file, initialize the ScalapayPlugin with the following options:

import { ScalapayPlugin } from "vendure-scalapay";

export const config = {
  plugins: [
    ScalapayPlugin.init({
      apiKey: "<scalapay-api-key>",
      baseUrl: "<vendure-app-base-url>",
      successUrl: "<front-end-success-url>",
      failureUrl: "<front-end-failure-url>",
      environment: "<sandbox|production>",
    }),
  ],
};

Plugin Options

  • apiKey: Your Scalapay API key (can be accessed via process.env.SCALAPAY_API_KEY).
  • baseUrl: The public base URL of your Vendure application (can be accessed via process.env.SCALAPAY_BASE_URL).
  • successUrl: The URL to redirect to upon successful Scalapay payment settlement (can be accessed via process.env.SCALAPAY_SUCCESS_URL).
  • failureUrl: The URL to redirect to in case of failed Scalapay payment settlement (can be accessed via process.env.SCALAPAY_FAILURE_URL).
  • environment: Scalapay runtime environment <sandbox/production> (can be accessed via process.env.SCALAPAY_ENVIRONMENT).

Functionality

The Scalapay Plugin extends Vendure by adding two Order Custom Fields:

  • order.customFields.scalapayCheckoutUrl: This field stores the Scalapay generated checkout URL, where customers submit their payment.
  • order.customFields.scalapayToken: This field holds the Scalapay generated token at the time of payment settlement.

Additionally, the plugin exposes a REST endpoint (GET /payments/scalapay) to handle the Scalapay checkoutUrl redirect, settle the payment, and then redirect the client (302) to the designated success/failure URL.

Please ensure you have the necessary environment variables set to securely access Scalapay credentials.

For more detailed information, refer to the Scalapay documentation.

Note: It is recommended to follow best practices for securely managing environment variables.

export SCALAPAY_API_KEY='<your-api-key>'
export SCALAPAY_BASE_URL='<your-app-base-url>'
export SCALAPAY_SUCCESS_URL='<front-end-success-url>'
export SCALAPAY_FAILURE_URL='<front-end-failure-url>'
export SCALAPAY_ENVIRONMENT='<sandbox|production>'

Support and Reporting Issues

If you encounter any issues, discover a bug, or have suggestions for improvements, please feel free to contact me or open an issue on GitHub repository.

For urgent matters or specific inquiries, you can reach me out at Email: [email protected]

I appreciate your feedback and I will do my best to address any concerns in a timely manner. Thank you for using Scalapay Payment Plugin!