1.8.7 • Published 5 months ago

@photos3016/paymenttest v1.8.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

PayAiro-Payment Gateway SDK

Introduction

This SDK allows merchants to integrate a seamless payment gateway into their React, Angular, or Vue applications.

Installation

Install the SDK using npm:

npm install @photos3016/paymenttest

Usage

React

import { createAPI } from "@photos3016/paymenttest";
import React, { useState } from "react";

const PaymentPage = () => {
  const [data, setData] = useState(null);
  const apikey = "YOUR_SECRET_KEY";
  const merchantId = "YOUR_MERCHANT_ID";
  const api = createAPI(apikey, merchantId);

  const handlePayment = async (item) => {
    try {
      const res = await api.paymentTest({
        amount: item.amount,
        json: [
          {
            name: item.name,
            quantity: 1,
            amount: item.amount,
            tax: item.tax,
            price: item.price,
          },
        ],
      });
      setData(res);
    } catch (error) {
      console.error("Transaction failed:", error.message);
    }
  };

  return (
    <div>
      <h1>Payment Gateway</h1>
      <button
        onClick={() => handlePayment({ name: "Test Product", amount: 100 })}
      >
        Pay $100
      </button>
    </div>
  );
};

export default PaymentPage;

Angular

import { Component } from "@angular/core";
import { createAPI } from "@photos3016/paymenttest";

@Component({
  selector: "app-payment",
  template: `<button (click)="handlePayment()">Pay $100</button>`,
})
export class PaymentComponent {
  api = createAPI("YOUR_SECRET_KEY", "YOUR_MERCHANT_ID");

  handlePayment() {
    this.api
      .paymentTest({
        amount: 100,
        json: [
          {
            name: "Test Product",
            quantity: 1,
            amount: 100,
            tax: 0,
            price: 100,
          },
        ],
      })
      .then((res) => console.log(res))
      .catch((error) => console.error("Transaction failed:", error.message));
  }
}

Vue

<template>
  <button @click="handlePayment">Pay $100</button>
</template>

<script>
import { createAPI } from "@photos3016/paymenttest";

export default {
  data() {
    return {
      api: createAPI("YOUR_SECRET_KEY", "YOUR_MERCHANT_ID"),
    };
  },
  methods: {
    async handlePayment() {
      try {
        const res = await this.api.paymentTest({
          amount: 100,
          json: [
            {
              name: "Test Product",
              quantity: 1,
              amount: 100,
              tax: 0,
              price: 100,
            },
          ],
        });
        console.log(res);
      } catch (error) {
        console.error("Transaction failed:", error.message);
      }
    },
  },
};
</script>

Customizing the SDK

You can customize the payment UI with primary/secondary colors, button styles, and logos.

Customize SDK

Adding Project URLs

Merchants can add a callback URL and success URL while creating a project.

Adding URLs

Getting Your Secret Key

After creating a project, you'll receive a secret key. This key is shown only once.

Secret Key

Merchant Panel

Manage all projects, update callback and success URLs, and view received transactions from users in the Merchant Panel.

šŸ”— Access the Merchant Panel

Support

For any issues, contact our support team at support@payairo.com.


Note: Replace YOUR_SECRET_KEY and YOUR_MERCHANT_ID with actual values from the Merchant Panel.

1.8.2

7 months ago

1.6.4

10 months ago

1.4.6

11 months ago

1.2.8

12 months ago

1.8.1

7 months ago

1.6.3

10 months ago

1.4.5

11 months ago

1.2.7

12 months ago

1.8.0

7 months ago

1.6.2

10 months ago

1.4.4

11 months ago

1.2.6

12 months ago

1.6.1

10 months ago

1.4.3

11 months ago

1.2.5

12 months ago

1.6.0

10 months ago

1.4.2

11 months ago

1.2.4

12 months ago

1.4.1

11 months ago

1.2.3

12 months ago

1.4.0

11 months ago

1.2.2

12 months ago

1.7.8

7 months ago

1.7.7

8 months ago

1.5.9

10 months ago

1.7.6

8 months ago

1.7.5

8 months ago

1.5.7

10 months ago

1.3.9

11 months ago

1.7.4

8 months ago

1.5.6

10 months ago

1.3.8

11 months ago

1.7.3

8 months ago

1.5.5

11 months ago

1.3.7

11 months ago

1.7.2

8 months ago

1.5.4

11 months ago

1.3.6

11 months ago

1.7.1

8 months ago

1.5.3

11 months ago

1.3.5

11 months ago

1.7.0

8 months ago

1.5.2

11 months ago

1.3.4

11 months ago

1.5.1

11 months ago

1.3.3

11 months ago

1.5.0

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.8.7

5 months ago

1.6.9

8 months ago

1.8.6

6 months ago

1.6.8

8 months ago

1.8.5

6 months ago

1.6.7

8 months ago

1.4.9

11 months ago

1.8.4

6 months ago

1.6.6

8 months ago

1.4.8

11 months ago

1.8.3

7 months ago

1.6.5

8 months ago

1.4.7

11 months ago

1.2.9

12 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago