Gathering detailed insights and metrics for cashfree-pg-capacitor
Gathering detailed insights and metrics for cashfree-pg-capacitor
Gathering detailed insights and metrics for cashfree-pg-capacitor
Gathering detailed insights and metrics for cashfree-pg-capacitor
npm install cashfree-pg-capacitor
Typescript
Module System
Node Version
NPM Version
71.2
Supply Chain
98.9
Quality
78.2
Maintenance
100
Vulnerability
99.6
License
Total Downloads
4,111
Last Day
23
Last Week
31
Last Month
33
Last Year
477
Minified
Minified + Gzipped
Latest Version
1.0.2
Package Id
cashfree-pg-capacitor@1.0.2
Unpacked Size
94.16 kB
Size
15.73 kB
File Count
28
NPM Version
7.24.0
Node Version
14.17.4
Cumulative downloads
Total Downloads
Last day
0%
23
Compared to previous day
Last week
3,000%
31
Compared to previous week
Last month
50%
33
Compared to previous month
Last year
-65.1%
477
Compared to previous year
The Cashfree Capacitor SDK allows you to integrate Cashfree Payment Gateway into your application and start collecting payments from your customers. It opens the payment page in a webview. The Capacitor SDK has been designed to minimise the complexity of handling and integrating payments in your Capacitor project.
Click here for more Documentation.
Run the following commands in your capacitor project.
1npm install cashfree-pg-capacitor 2npx cap sync
If the project's targetSdkVersion is 30 or above, add the following to your app Android Manifest file.
1<manifest ...> 2 <queries> 3 <intent> 4 <action android:name="android.intent.action.VIEW" /> 5 <data android:scheme="upi" android:host="pay"/> 6 </intent> 7 <package android:name="com.android.chrome" /> 8 </queries> 9<application ...>
also register the plugin in MainActivity.java of your app.
Example
1import com.cashfree.capacitor.CFBridge; 2... 3public class MainActivity extends BridgeActivity { 4 5 @Override 6 protected void onCreate(Bundle savedInstanceState) { 7 super.onCreate(savedInstanceState); 8 registerPlugin(CFBridge.class); // register the plugin here 9 } 10}
Add the following code to application's info.plist file.
1<key>LSApplicationCategoryType</key> 2<string></string> 3<key>LSApplicationQueriesSchemes</key> 4<array> 5<string>phonepe</string> 6<string>tez</string> 7<string>paytm</string> 8<string>bhim</string> 9</array>
1startPaymentWEB(params: Object | Map<string, string>) => Object
Parameters
Object or Map
containg Request Parameters.Returns
An Object
containing the Response Parameters.
1startPaymentUPI(params: Object | Map<string, string>) => Object
Parameters
Object or Map
containg Request Parameters.Returns
An Object
containing the Response Parameters.
1getUPIApps() => Object
Returns
An Object
containing the list of UPI apps installed in the User Phone supporting UPI intent payment mode.
Response Parameters:
Sample response parsed to JSON:
[
{
“displayName”: “Gpay”,
“id”: “com.google.android.apps.nbu.paisa.user”,
“icon”: “iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAXNSR0IArs4c6QAA... (in base64)”
},
{
“displayName”: “PHONEPE”,
“id”: “com.phonepe.app”,
“icon”: “iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAXNSR0IArs4c6QAA... (in base64)”
}
]
1getIcon(base64String: string) => string
Parameters
Returns
A string
prepended with data:image/png;base64,
to make it usable as a source for image.
This function is created as a helper function specifially for typescript.
1transFormUPIResponse(result: any) => UPIApp[]
Parameters
Returns
An array of UPIApp
.
Parameter | Required | Description |
---|---|---|
appId | Yes | Your app ID |
orderId | Yes | Order or Invoice ID |
orderCurrency | Yes | Currency code for the order. |
orderAmount | Yes | Bill amount of the order |
orderNote | No | Help text to provide customers with more information about the order. |
customerName | No | Name of the customer |
customerPhone | Yes | Phone number of the customer |
customerEmail | Yes | Email ID of the customer |
notifyUrl | No | Notification URL for server-server communication. Useful when a user's connection drops after completing the payment. |
paymentModes | No | Allowed payment modes for this order. Available values: cc, dc, nb, paypal, upi, wallet. Leave it blank if you want to display all modes. |
tokenData | Yes | Token generated for the payment. |
stage | Yes | Environment of the project setup (TEST or PROD) |
appName | No | UPI app id when invoking seamless UPI intent. |
These parameters are sent in the response Object
. They contain the details of the transaction.
Parameter | Description |
---|---|
orderId | Order id for which transaction has been processed. Example, GZ-212. |
orderAmount | Order amount. Example, 256.00 |
paymentMode | Payment mode of the transaction. |
referenceId | Cashfree generated unique transaction ID. Example, 140388038803. |
txStatus | Payment status for that order. Values can be, SUCCESS, FLAGGED, PENDING, FAILED, CANCELLED. |
paymentMode | Payment mode used by customers to make the payment. Example, DEBIT_CARD, MobiKwik. |
txMsg | Message related to the transaction. Will have the reason, if payment failed. |
txTime | Time of the transaction. |
type | Fixed value : CashFreeResponse. To identify the response is from Cashfree SDK. |
signature | Response signature, more here. |
No vulnerabilities found.
No security vulnerabilities found.