0.1.31 • Published 10 months ago

swypt-checkout v0.1.31

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

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 swypt.io@gmail.com or open an issue in our GitHub repository.

0.1.31

10 months ago

0.1.30

11 months ago

0.1.29

11 months ago

0.1.28

11 months ago

0.1.27

11 months ago

0.1.26

11 months ago

0.1.25

11 months ago

0.1.24

11 months ago

0.1.23

11 months ago

0.1.22

11 months ago

0.1.21

11 months ago

0.1.20

11 months ago

0.1.19

11 months ago

0.1.18

11 months ago

0.1.17

11 months ago

0.1.16

11 months ago

0.1.15

11 months ago

0.1.14

11 months ago

0.1.13

11 months ago

0.1.12

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago