Closed vikramaggarwal13 closed 5 years ago
Thank you for using the plug-in.
I was awaiting for a .invokeMethod which is why the second 'print' wasn't executing.
I have fixed the code. Will publish an update of the plug-in just now.
Thank you for identifying the issue.
On Sat, May 4, 2019, 18:47 vikramaggarwal13 notifications@github.com wrote:
Please look at the below code
print("in try"); // its printed /* Successfully called below function / / Received toast with success response **/ await PaytmPayments.makePaytmPayment( prefs.getString('mid'), // [YOUR_MERCHANT_ID] (required field) _valuesURL.toString(), // [YOUR_CHECKSUM_URL] (required field) customerId: prefs.getString('cid'), // [UNIQUE_ID_FOR_YOUR_CUSTOMER] (auto generated if not specified) orderId: prefs.getString('orderid'), // [UNIQUE_ID_FOR_YOUR_ORDER] (auto generated if not specified) txnAmount: prefs.getString('amount'), // default: 10.0 channelId: prefs.getString('channelid'), // default: WAP (STAGING value) industryTypeId: prefs.getString('industry_type_id'), // default: Retail (STAGING value) website:prefs.getString('website'), // default: APPSTAGING (STAGING value) staging: true, // default: true (by default paytm staging environment is used) ); /*****below line is not printed *****/ print("after try"); Can you suggest on this one
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM5HLPVJ4JPONMOY3KDPTWEGJANCNFSM4HKY35HQ .
New version (0.2.1) has been published. Please pull the updated package and try again.
Hi,
As per the above issue i have given that next print statement is not working. Its working now.
But it should run after only getting some transaction response i.e. after .invokeMethod.
According to me , steps should be , Please confirm at your end too
As per the paytm payment process
Step 1 : create transaction parameter ( perfect in our plugin ) which is
print("in try"); await PaytmPayments.makePaytmPayment( prefs.getString('mid'), // [YOUR_MERCHANT_ID] (required field) _valuesURL.toString(), // [YOUR_CHECKSUM_URL] (required field) customerId: prefs.getString('cid'), // [UNIQUE_ID_FOR_YOUR_CUSTOMER] (auto generated if not specified) orderId: prefs.getString('orderid'), // [UNIQUE_ID_FOR_YOUR_ORDER] (auto generated if not specified) txnAmount: prefs.getString('amount'), // default: 10.0 channelId: prefs.getString('channelid'), // default: WAP (STAGING value) industryTypeId: prefs.getString('industry_type_id'), // default: Retail (STAGING value) website:prefs.getString('website'), // default: APPSTAGING (STAGING value) staging: true, // default: true (by default paytm staging environment is used) showToast: true, // default: true (by default shows callback messages from paytm in Android Toasts) // default: true (by default paytm staging environment is used) ); print("after try"); Step 2 : is to generate checksum generation (Perfect in our case ) String checksumHash = await generateChecksum(checksumUrl, paymentObject); in paytm_payments.dart
Step 3 : payment initiation (Perfect in our case ) _channel.invokeMethod('paytmPayment', {"order_data" : paymentObject, "staging" : staging, "show_toast" : showToast},);
Point 1 : Now we should wait for step 3 response only then next print should run.
Step 4 : Now we will get one parameter in step 3 response" Status = TXN_SUCCESS " . THere should be one object which will store step 3 response.
Step 5 : based on step 3 response object , we will take our next action of verification of checksumhash again with paytm
In my case code is
insertorderfirst(rechargeamount) // function used to create order .then((zValue) => makepayment()) // function used for payment .then((zValue) => verifypayment()); // function used for checksumverification
Now function verifypayment is running while we have not received make payment response .
I am available today. Lets discuss and implement this in plugin
Its perfect plugin for paytm gateway implementation
Thanks
Hi Apoorv,
Are we going to work on it today ? I need to configure it successfully in our app .
Hope for quick response
Thanks & Regards
Hey, I'm available right now. Was busy whole day long. Will look into your query now. Let me check it out, please wait.
Hey thanks for your response and a verbose step by step dictation of the required process.
I have understood your problem and how you want it to be implemented.
I have some solutions to it on my mind. Let me fix the issue and get back to you.
Thank you for your patience.
On Sun, May 5, 2019, 05:34 vikramaggarwal13 notifications@github.com wrote:
Hi,
As per the above issue i have given that next print statement is not working. Its working now.
But it should run after only getting some transaction response i.e. after .invokeMethod.
According to me , steps should be , Please confirm at your end too
As per the paytm payment process
Step 1 : create transaction parameter ( perfect in our plugin ) which is
print("in try"); await PaytmPayments.makePaytmPayment( prefs.getString('mid'), // [YOUR_MERCHANT_ID] (required field) _valuesURL.toString(), // [YOUR_CHECKSUM_URL] (required field) customerId: prefs.getString('cid'), // [UNIQUE_ID_FOR_YOUR_CUSTOMER] (auto generated if not specified) orderId: prefs.getString('orderid'), // [UNIQUE_ID_FOR_YOUR_ORDER] (auto generated if not specified) txnAmount: prefs.getString('amount'), // default: 10.0 channelId: prefs.getString('channelid'), // default: WAP (STAGING value) industryTypeId: prefs.getString('industry_type_id'), // default: Retail (STAGING value) website:prefs.getString('website'), // default: APPSTAGING (STAGING value) staging: true, // default: true (by default paytm staging environment is used) showToast: true, // default: true (by default shows callback messages from paytm in Android Toasts) // default: true (by default paytm staging environment is used) ); print("after try"); Step 2 : is to generate checksum generation (Perfect in our case ) String checksumHash = await generateChecksum(checksumUrl, paymentObject); in paytm_payments.dart
Step 3 : payment initiation (Perfect in our case ) _channel.invokeMethod('paytmPayment', {"order_data" : paymentObject, "staging" : staging, "show_toast" : showToast},);
Point 1 : Now we should wait for step 3 response only then next print should run.
Step 4 : Now we will get one parameter in step 3 response" Status = TXN_SUCCESS " . THere should be one object which will store step 3 response.
Step 5 : based on step 3 response object , we will take our next action of verification of checksumhash again with paytm
In my case code is
insertorderfirst(rechargeamount) // function used to create order .then((zValue) => makepayment()) // function used for payment .then((zValue) => verifypayment()); // function used for checksumverification
Now function verifypayment is running while we have not received make payment response .
I am available today. Lets discuss and implement this in plugin
Its perfect plugin for paytm gateway implementation
Thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489374877, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DMZU7G26BB2XOK4LR6TPTYQB3ANCNFSM4HKY35HQ .
Hi ,
I am online Please discuss with me if something required. This plugin is going to be very smooth plugin for all flutter developer who need integration of paytm gateway
Please revert for any confusion in my points
Thanks
I have figured it out. I'm updating the code, please wait while I do that.
I'm going to provide a listener. So that you can listen for the response from paytm.
This will allow you to get the response object and handle payment flow on receiving response on Flutter side.
I'll add the example of how to use the listener too. This update will cover all of your issues.
Thank you.
On Mon, May 6, 2019, 00:36 vikramaggarwal13 notifications@github.com wrote:
Hi ,
I am online Please discuss with me if something required. This plugin is going to be very smooth plugin for all flutter developer who need integration of paytm gateway
Please revert for any confusion in my points
Thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489454225, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM2UGMVOZQRWHQGTAETPT4V2JANCNFSM4HKY35HQ .
Ok Thanks for the update
Waiting for new version :) with full excitement
Thanks & Regards
Hi Apoorv , I am available today. If you need any type of testing from my side then i can do that.
Thanks Vikram Aggarwal
Hey sorry couldn't do it yesterday. Got caught up in something else.
I'm doing it right now. So test it as soon as you can after I push the update.
On Tue, May 7, 2019, 00:18 vikramaggarwal13 notifications@github.com wrote:
Hi Apoorv , I am available today. If you need any type of testing from my side then i can do that.
Thanks Vikram Aggarwal
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489731797, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM5LVXRSEN24E5N6YC3PUB4PXANCNFSM4HKY35HQ .
Ok .. I am ready .
Fixed the issue. Pushing an update in 15 mins. Please check.
On Tue, May 7, 2019, 01:19 vikramaggarwal13 notifications@github.com wrote:
Ok .. I am ready .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489751410, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DMZ63BDIWQA7J4L5ZNLPUCDTNANCNFSM4HKY35HQ .
Ok Please update after new version launch
I have pushed the update and published the latest version.
Please check and let me know.
On Tue, May 7, 2019, 02:30 vikramaggarwal13 notifications@github.com wrote:
Ok Please update after new version launch
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489774898, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM5JTFQZTVRBP7GXH2DPUCL67ANCNFSM4HKY35HQ .
Ok Testing started
Hi,
You have introduced this part
PaytmPayments.responseStream.listen((String responseData){
print(responseData);
/*
* Call any method here to handle payment process on receiving response. According to the response received.
*
* handleResponse();
*
* */
});
Please send complete response which you pass to toast instead of only TXN_Success String value As we need to use other parameters too
This part runs every time when we call initpayment while this should run only in one case if we got the response from startpayment method. Thanks
I am still continued with testing
I have also received this error when hit second time pay now button
Exception has occurred. StateError (Bad state: Stream has already been listened to.)
Hi,
You have introduced this part
PaytmPayments.responseStream.listen((String responseData){
print(responseData); /* * Call any method here to handle payment process on receiving response. According to the response received. * * handleResponse(); * * */ });
1. Please send complete response which you pass to toast instead of only TXN_Success String value As we need to use other parameters too 2. This part runs every time when we call initpayment while this should run only in one case if we got the response from startpayment method. Thanks
I am still continued with testing
Reason for sending just the response message instead of complete response object:
I have also received this error when hit second time pay now button
Exception has occurred. StateError (Bad state: Stream has already been listened to.)
I have used the 'listener' inside the initPayment method, but you are supposed to use it outside this method. Listener has to be set only once, and not every time when the payment is initiated.
Just use this listener before calling the 'initPayment' method. This should resolve your issue.
I'll push a better version of the example code in the update. Thanks for the review.
Ok, I just followed example code
Let me recheck
Please send complete response in json format as There are some other parameter also coming like STATUS=TXN_SUCCESS, BANKNAME=ANDB, TXNDATE=2019-05-07 03:09:20.0,TXNID=201912210121507111212800110168058600472373, RESPCODE=01, PAYMENTMODE=NB, BANKTXNID=78048, CURRENCY=INR, GATEWAYNAME=ANDB, RESPMSG=Txn Success}] we need to log all this to our database for future reference.
Hi, You have introduced this part PaytmPayments.responseStream.listen((String responseData){
print(responseData); /* * Call any method here to handle payment process on receiving response. According to the response received. * * handleResponse(); * * */ });
1. Please send complete response which you pass to toast instead of only TXN_Success String value As we need to use other parameters too 2. This part runs every time when we call initpayment while this should run only in one case if we got the response from startpayment method. Thanks
I am still continued with testing
Reason for sending just the response message instead of complete response object:
- Response object contains the same data as sent by you during 'initpayment' only the response message is an extra field, hence the only required field to be sent to a listener.
Please send complete response in json format as There are some other parameter also coming like STATUS=TXN_SUCCESS, BANKNAME=ANDB, TXNDATE=2019-05-07 03:09:20.0,TXNID=201912210121507111212800110168058600472373, RESPCODE=01, PAYMENTMODE=NB, BANKTXNID=78048, CURRENCY=INR, GATEWAYNAME=ANDB, RESPMSG=Txn Success}] we need to log all this to our database for future reference.
I have also received this error when hit second time pay now button Exception has occurred. StateError (Bad state: Stream has already been listened to.)
I have used the 'listener' inside the initPayment method, but you are supposed to use it outside this method. Listener has to be set only once, and not every time when the payment is initiated.
Just use this listener before calling the 'initPayment' method. This should resolve your issue.
I'll push a better version of the example code in the update. Thanks for the review.
I have implemented given solution but there also its giving same error "Bad State"
Okay I'll do that. I'll push an update in a few hours.
Thank you for your patience.
On Tue, May 7, 2019, 03:13 vikramaggarwal13 notifications@github.com wrote:
Please send complete response in json format as There are some other parameter also coming like STATUS=TXN_SUCCESS, BANKNAME=ANDB, TXNDATE=2019-05-07 03:09:20.0,TXNID=201912210121507111212800110168058600472373, RESPCODE=01, PAYMENTMODE=NB, BANKTXNID=78048, CURRENCY=INR, GATEWAYNAME=ANDB, RESPMSG=Txn Success}] we need to log all this to our database for future reference.
Hi, You have introduced this part PaytmPayments.responseStream.listen((String responseData){
print(responseData);
/*
- Call any method here to handle payment process on receiving response. According to the response received.
- handleResponse();
- */ });
Please send complete response which you pass to toast instead of only TXN_Success String value As we need to use other parameters too
This part runs every time when we call initpayment while this should run only in one case if we got the response from startpayment method. Thanks
I am still continued with testing
Reason for sending just the response message instead of complete response object:
- Response object contains the same data as sent by you during 'initpayment' only the response message is an extra field, hence the only required field to be sent to a listener.
Please send complete response in json format as There are some other parameter also coming like STATUS=TXN_SUCCESS, BANKNAME=ANDB, TXNDATE=2019-05-07 03:09:20.0,TXNID=201912210121507111212800110168058600472373, RESPCODE=01, PAYMENTMODE=NB, BANKTXNID=78048, CURRENCY=INR, GATEWAYNAME=ANDB, RESPMSG=Txn Success}] we need to log all this to our database for future reference.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489794510, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM4HLGBFO7JF7PTEVXDPUCRA5ANCNFSM4HKY35HQ .
Okay I'll fix this too in the update.
Expect the update within 12 hours.
On Tue, May 7, 2019, 03:14 vikramaggarwal13 notifications@github.com wrote:
I have also received this error when hit second time pay now button Exception has occurred. StateError (Bad state: Stream has already been listened to.)
I have used the 'listener' inside the initPayment method, but you are supposed to use it outside this method. Listener has to be set only once, and not every time when the payment is initiated.
Just use this listener before calling the 'initPayment' method. This should resolve your issue.
I'll push a better version of the example code in the update. Thanks for the review.
I have implemented given solution but there also its giving same error "Bad State"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489794787, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM73U4PW6ZCZIJCZDBTPUCRERANCNFSM4HKY35HQ .
Ok Thanks one more thing ,
if i press make payment button then paytm gateway screen opens , i dont want to to transaction , so i just press back button of phone. It giving prompt to cancel transaction . I opted yes then toast received " Transaction cancelled " please send the same response in json format so that we can take an action based on this too .
In this case listener is not working
Toast parameter = true/false is not impacting also
Okay. Just wanted to test the listener for the transaction response first. Haven't added it up on all of the call backs yet.
Will do this in this update too.
Thanks.
On Tue, May 7, 2019, 03:18 vikramaggarwal13 notifications@github.com wrote:
Ok Thanks one more thing ,
if i press make payment button then paytm gateway screen opens , i dont want to to transaction , so i just press back button of phone. It giving prompt to cancel transaction . I opted yes then toast received " Transaction cancelled " please send the same response in json format so that we can take an action based on this too .
In this case listener is not working
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489795965, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM6DBDVRUGTHLY6HE2LPUCRT7ANCNFSM4HKY35HQ .
Ok Thanks, you did a wonderful job by creating this plugin. I am implementing this plugin in my live app now as its taking successful order now. I have a lot of work to do :)
Thanks again and waiting for an update again with full excitement.
Update is now live. You may start using it as expected.
On Tue, May 7, 2019, 03:23 vikramaggarwal13 notifications@github.com wrote:
Ok Thanks, you did a wonderful job by creating this plugin. I am implementing this plugin in my live app now as its taking successful order now. I have a lot of work to do :)
Thanks again and waiting for an update again with full excitement.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-489797316, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM4YE27XFUYO663EAVTPUCSHFANCNFSM4HKY35HQ .
ok let me test Thanks
Its working fine as per expectation for now .. I am in test with paytm team on my app. If its got successfully tested then i will update here also .
one point is in my mind that if we got success response from paytm then paytm asks us to seprately verify check sum hash value this part we should add in our example code. This will help user how to handle and verify the response
Yes. I have plans to do that soon.
Paytm asks to re-verify the transactions. But they suggest you to do that on your server rather than in app.
It's basically a post request to their API for re-verification of the transaction. In response they send you the json data required to move into production mode as it has to be sent to paytm for verification.
On Wed, May 8, 2019, 08:17 vikramaggarwal13 notifications@github.com wrote:
Its working fine as per expectation for now .. I am in test with paytm team on my app. If its got successfully tested then i will update here also .
one point is in my mind that if we got success response from paytm then paytm asks us to seprately verify check sum hash value this part we should add in our example code. This will help user how to handle and verify the response
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apoorv9496/paytm_payments/issues/2#issuecomment-490326181, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX6DM57MZQWR3TDB3NINU3PUI5MRANCNFSM4HKY35HQ .
Hi Apoorv ,
Its working fine
Thanks
Please look at the below code
print("in try"); // its printed /* Successfully called below function ****/ /** Received toast with success response ****/ await PaytmPayments.makePaytmPayment( prefs.getString('mid'), // [YOUR_MERCHANT_ID] (required field) _valuesURL.toString(), // [YOUR_CHECKSUM_URL] (required field) customerId: prefs.getString('cid'), // [UNIQUE_ID_FOR_YOUR_CUSTOMER] (auto generated if not specified) orderId: prefs.getString('orderid'), // [UNIQUE_ID_FOR_YOUR_ORDER] (auto generated if not specified) txnAmount: prefs.getString('amount'), // default: 10.0 channelId: prefs.getString('channelid'), // default: WAP (STAGING value) industryTypeId: prefs.getString('industry_type_id'), // default: Retail (STAGING value) website:prefs.getString('website'), // default: APPSTAGING (STAGING value) staging: true, // default: true (by default paytm staging environment is used) ); /*****below line is not printed *****/ print("after try"); Can you suggest on this one