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

swypt-checkout

v0.1.31

Published

A customizable checkout SDK for Swypt payments

Downloads

38

Readme

Swypt Checkout SDK

Overview

Swypt Checkout SDK is a customizable, easy-to-integrate payment solution for e-commerce and point-of-sale applications. It provides a seamless checkout experience for customers using cryptocurrencies and traditional payment methods.

Features

  • Multi-step checkout process
  • Support for both crypto and cash payments
  • Customizable header with gradient support
  • Responsive design (mobile and desktop compatible)
  • Wallet integration for crypto payments
  • Transaction confirmation and receipt generation
  • Downloadable and shareable transaction receipts

Installation

yarn add swypt-checkout 

Getting Started

To start using the Swypt Checkout SDK in your project, follow these steps:

  1. Install the SDK: Use npm or yarn to install the package as shown above.
  2. Import the SDK: In your React component file, import the CheckoutModal component in the location you wish to use it:
import { CheckoutModal } from "swypt-checkout";
  1. Import the CSS in the location or component use are going to use the checkout Modal:
import "swypt-checkout/dist/styles.css";
  1. Import the context in your project's entry file (e.g., _app.js or layout.js for Next.js):

"use client"

import { CryptoProvider } from "swypt-checkout";
return (
  <CryptoProvider>
    <html>
      <body>{children}</body>
    </html>
  </CryptoProvider>
);
  1. Set up state: Create a state variable to control the visibility of the modal:
import { useState } from "react";

function YourComponent() {
  const [isModalOpen, setIsModalOpen] = useState(false);

  // ... rest of your component
}
  1. Add the CheckoutModal: Include the CheckoutModal in your component's render method:
return (
  <div>
    {/* Your existing component content */}
    <button onClick={() => setIsModalOpen(true)}>Open Checkout</button>

    <CheckoutModal
      isOpen={isModalOpen}
      onClose={() => setIsModalOpen(false)}
      headerBackgroundColor="#3E4347" // Put your header background color code
      businessName="Your Business Name"
      merchantName="Your Merchant Name"
      merchantAddress="0x6d19a24D93379D1bA58d28884fFBBEf1bc145387" // Put your address
      amount={200} // Specify the payment amount
    />
  </div>
);
  1. Customize the appearance: Adjust the headerBackground and businessName props to match your branding.
  2. Handle payments: Implement the necessary backend logic to process payments when the checkout process is completed. The SDK will call the appropriate callbacks which you can integrate with your payment processing system.

Checkout Process

  1. Choose Payment Method: Select between crypto or cash payment.
  2. Connect Wallet: For crypto payments, connect your digital wallet.
  3. Select Asset: Choose the cryptocurrency for payment.
  4. Confirm Transaction: Review and confirm the transaction details.
  5. Processing: Approve and process the payment.
  6. Success: View and download the transaction receipt.

Requirements

  • React 16.8+
  • Next.js 10+ (for optimal performance)

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Best Practices

  • Ensure proper error handling in your implementation.
  • Test thoroughly with different payment scenarios.
  • Keep the SDK updated to the latest version for security and feature improvements.

Security

Swypt Checkout SDK prioritizes security in financial transactions. However, always ensure you're using the latest version and follow best practices for handling sensitive financial data.

Troubleshooting

If you encounter issues:

  • Check that all dependencies are correctly installed.
  • Ensure you're using a compatible version of React and Next.js.
  • Verify that the isOpen and onClose props are correctly implemented.
  • Check the console for any error messages or warnings.
  • Ensure that your backend API endpoints are correctly set up and accessible.

Contributing

We welcome contributions! Please see our contributing guidelines for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please email [email protected] or open an issue in our GitHub repository.