cashfree / cashfree-pg-sdk-nodejs Goto Github PK
View Code? Open in Web Editor NEWCashfree Nodejs Plugin
Home Page: https://www.cashfree.com/
License: Apache License 2.0
Cashfree Nodejs Plugin
Home Page: https://www.cashfree.com/
License: Apache License 2.0
Just need to have some features in my application for auto pay and it seems to be valid with subscription APIs.
Error after installing the package and building the application:
Request Package has been deprecated.
I Installed the Request Package. It lead to another error related to crypto.
Crypto package is also deprecated.
Any solution for this? Can we do without using the request package?
I am trying to implement the payment for individual methods using this package. Could you please provide a way to solve this issue?
customerName
attribute.it is given in cashfree documentation but not included in this sdk.
body: {
message: 'upi_id for sandbox should be testsuccess@gocash or testfailure@gocash or testtpvsuccess@gocash or testtpvfail@gocash or success@upi',
code: 'upi_id_invalid',
type: 'invalid_request_error'
},
and i use
var cfUpi = new CFUPI();
cfUpi.channel = CFUPI.ChannelEnum.Collect;
cfUpi.upiId = "success@upi";
var cFUPIPayment = new CFUPIPayment();
cFUPIPayment.upi = cfUpi;
var cFOrderPayRequest = new CFOrderPayRequest();
cFOrderPayRequest.paymentSessionId = payment_session_id;
cFOrderPayRequest.paymentMethod = cFUPIPayment;
var apiInstance = new CFPaymentGateway();
var cfPayResponse = await apiInstance.orderSessionsPay(
cfConfig,
cFOrderPayRequest
);
if (cfPayResponse != null) {
console.log(
"Order ID:",
cfPayResponse?.cfOrderPayResponse?.data.orderId
);
console.log(
"Payment Response:",
cfPayResponse?.cfOrderPayResponse?.data
);
console.log("Headers:", cfPayResponse?.cfHeaders);
return reply.send({
status: "success",
data: cfPayResponse?.cfOrderPayResponse?.data,
});
} else {
throw new Error("Payment failed");
}
} catch (error) {
payment session id is undefiend
paymentSessionId: undefined,
this code : const userId = request.user?.["_id"];
const { mobile, email, amount, name } = request.body;
const customerDetails = new CFCustomerDetails();
customerDetails.customerId = userId;
customerDetails.customerPhone = mobile;
customerDetails.customerEmail = email;
customerDetails.customerName = name;
const orderTags = {};
orderTags["order_tag_01"] = "TESTING IT";
const cFOrderRequest = new CFOrderRequest();
cFOrderRequest.orderAmount = amount;
cFOrderRequest.orderCurrency = "INR";
cFOrderRequest.customerDetails = customerDetails;
cFOrderRequest.orderTags = orderTags;
const apiInstance = new CFPaymentGateway();
const result = await apiInstance.orderCreate(cfConfig, cFOrderRequest);
if (result != null) {
console.log(result?.cfOrder?.paymentSessionId);
console.log(result?.cfOrder?.orderId);
console.log(result?.cfHeaders);
console.log(result);
reply.send(result);
}
body: {
message: 'invalid value for parameter: card_cvv',
code: 'card_cvv_invalid',
type: 'invalid_request_error'
},
wrong details and i submit
{
"cardNumber": 4706131211212123,
"cardCvv": 123,
"cardExpiryMm": "03",
"cardExpiryYy": "2028"
}
body: {
message: 'invalid value for parameter: upi_id',
code: 'upi_id_invalid',
type: 'invalid_request_error'
},
statusCode: 400
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.