cashfree-pg 3.0.0 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ jobs:
17
17
  with:
18
18
  node-version: '20.*'
19
19
  registry-url: 'https://registry.npmjs.org'
20
- - run: npm install
20
+ - run: npm cache clean --force && npm install
21
21
  - run: npm publish --access public
22
22
  env:
23
23
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,26 @@
1
+ name: Trigger Tests on Pull Request.
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ build:
10
+
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Use Node.js
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: '21.x'
19
+ - name: Install dependencies
20
+ run: npm install && npm install coveralls --save-dev
21
+ - name: Run Tests
22
+ run: CLIENT_ID=$PG_CLIENT_ID SECRET_KEY=$PG_CLIENT_SECRET npm test && cd coverage && ls && cd .. && cat coverage/lcov.info | npx coveralls
23
+ env:
24
+ PG_CLIENT_ID: ${{ secrets.XCLIENTIDSANDBOX }}
25
+ PG_CLIENT_SECRET: ${{ secrets.XCLIENTSECRETSANDBOX }}
26
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
package/README.md CHANGED
@@ -1 +1,55 @@
1
- ![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)
1
+ # Cashfree PG Node SDK
2
+ ![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) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-pg-sdk-nodejs) [![Coverage Status](https://coveralls.io/repos/github/cashfree/cashfree-pg-sdk-nodejs/badge.svg?branch=main)](https://coveralls.io/github/cashfree/cashfree-pg-sdk-nodejs?branch=main) [![Build and Publish](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/publish.yml/badge.svg)](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/publish.yml)
3
+
4
+ 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.
5
+
6
+
7
+
8
+ ## Documentation
9
+
10
+ Cashfree's PG API Documentation - https://docs.cashfree.com/reference/pg-new-apis-endpoint
11
+
12
+ Learn and understand payment gateway workflows at Cashfree Payments [here](https://docs.cashfree.com/docs/payment-gateway)
13
+
14
+ Try out our interactive guides at [Cashfree Labs](https://labs.cashfree.com/) !
15
+
16
+ ## Getting Started
17
+
18
+ ### Installation
19
+ ```bash
20
+ npm i cashfree-pg
21
+ ```
22
+ ### Configuration
23
+
24
+ ```javascript
25
+ import { Cashfree } from "cashfree-pg";
26
+
27
+ Cashfree.XClientId = "<x-client-id>";
28
+ Cashfree.XClientSecret = "<x-client-secret>";
29
+ Cashfree.XEnvironment = Cashfree.Environment.SANDBOX;
30
+ ```
31
+
32
+ Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)
33
+
34
+ ### Basic Usage
35
+ Create Order
36
+ ```javascript
37
+ Cashfree.PGCreateOrder("2022-09-01", request).then((response) => {
38
+ console.log('Order fetched successfully:',response.data)
39
+ }).catch((error) => {
40
+ console.error('Error:', error.response.data.message);
41
+ });
42
+ ```
43
+
44
+ Get Order
45
+ ```javascript
46
+ Cashfree.PGFetchOrder("2022-09-01", "<order_id>").then((response) => {
47
+ console.log('Order fetched successfully:', response.data);
48
+ }).catch((error) => {
49
+ console.error('Error:', error.response.data.message);
50
+ });
51
+ ```
52
+
53
+ ## Licence
54
+
55
+ Apache Licensed. See [LICENSE.md](LICENSE.md) for more details