1.1.5 • Published 7 months ago

etegram-pay v1.1.5

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

Pay with Etegram

This is a library for implementing Etegram payment gateway

Installation

This library provides a wrapper to add Etegram Payments to your web application

npm install etegram-pay

or

yarn add etegram-pay

Usage

import { payWithEtegram } from 'etegram-pay';
import { useForm } from 'react-hook-form';

export default function CheckoutFormSample(

	const {register, handleSubmit} = useForm();

	const onSubmit = async (data) => {
		/* Here you would send the data from your form to the payWithEtegram.*/

         	//You can pass your reference to the function otherwise one will be generated for you

            const dataToSubmit = {
			  projectID: data.projectID,
			  publicKey: data.publicKey,
			  amount: data.productPrice,
			  email: data.email,
			  phone: data.phone,
			  firstname: data.firstName,
			  lastname: data.lastName,
		}
      		await payWithEtegram(dataToSubmit);
	};
	return (
	     <form onSubmit={handleSubmit(onSubmit)}>
	        <div>
	            <label htmlFor="firstName">FirstName</label>
	            <input {...register("firstName")} />
	        </div>
	        //Rest of your form
	        ...

	        <button>Submit</button>
	    </form>
  	)
)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Some commit message'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

License

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago

1.0.1

8 months ago