cashfree / cashfree-pg-sdk-nodejs

Cashfree Nodejs Plugin
https://www.cashfree.com/
Apache License 2.0
6 stars 3 forks source link

paymentSessionId is undefiend #8

Closed rahulsingh81 closed 1 year ago

rahulsingh81 commented 1 year ago

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);
    }
suhas-cashfree commented 1 year ago

What is the sdk version you are using and what is the x-api-version ?

rahulsingh81 commented 1 year ago

sdk version is "cashfree-pg-sdk-nodejs": "^2.0.2", and

x-api-version 22-09-01

rahulsingh81 commented 1 year ago

Thanks @suhas-cashfree as a change the api version perfect work