-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4673fcd
commit 34d43bf
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
# Cashfree PG Node SDK | ||
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-pg-sdk-nodejs) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-pg-sdk-nodejs/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-pg-sdk-nodejs?label=latest) ![npm](https://img.shields.io/npm/v/cashfree-pg-sdk-nodejs) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-pg-sdk-nodejs) | ||
|
||
The Cashfree PG Node SDK offers a convenient solution to access [Cashfree PG APIs](https://docs.cashfree.com/reference/pg-new-apis-endpoint) from a server-side JavaScript applications. | ||
|
||
|
||
|
||
## Documentation | ||
|
||
Cashfree's PG API Documentation - https://docs.cashfree.com/reference/pg-new-apis-endpoint | ||
|
||
Learn and understand payment gateway workflows at Cashfree Payments [here](https://docs.cashfree.com/docs/payment-gateway) | ||
|
||
Try out our interactive guides at [Cashfree Labs](https://labs.cashfree.com/) ! | ||
|
||
## Getting Started | ||
|
||
### Installation | ||
```bash | ||
npm i cashfree-pg | ||
``` | ||
### Configuration | ||
|
||
```javascript | ||
import { Cashfree } from "cashfree-pg"; | ||
|
||
Cashfree.XClientId = "<x-client-id>"; | ||
Cashfree.XClientSecret = "<x-client-secret>"; | ||
Cashfree.XEnvironment = Cashfree.Environment.SANDBOX; | ||
``` | ||
|
||
Generate your API keys (x-client-id , x-secret-key) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login) | ||
|
||
### Basic Usage | ||
Create Order | ||
```javascript | ||
Cashfree.PGCreateOrder("2022-09-01", request).then((response) => { | ||
console.log('Order fetched successfully:',response.data) | ||
}).catch((error) => { | ||
console.error('Error:', error.response.data.message); | ||
}); | ||
``` | ||
|
||
Get Order | ||
```javascript | ||
Cashfree.PGFetchOrder("2022-09-01", "<order_id>").then((response) => { | ||
console.log('Order fetched successfully:', response.data); | ||
}).catch((error) => { | ||
console.error('Error:', error.response.data.message); | ||
}); | ||
``` | ||
|
||
## Licence | ||
|
||
Apache Licensed. See [LICENSE.md](LICENSE.md) for more details |