actions-on-google / dialogflow-transactions-nodejs

Physical transactions sample (using Dialogflow) in Node.js
Apache License 2.0
66 stars 43 forks source link

Sample code gives 'Sorry, something went wrong' after Confirm Transaction #22

Closed dzolnai closed 4 years ago

dzolnai commented 4 years ago

Hello,

I've deployed this sample to a new DialogFlow + Actions On Google project, following the steps in the guideline. When I select any payment type, select my delivery address, and in the end confirm the transaction, I get a 'Sorry, something went wrong. Please try again later' error message. I have tried on device and also in the emulator. I can't find any error in the StackDriver logs, nor in the emulator logs. The last event I see is a 200 OK response with the transaction decision intent containing the order details.

I have:

pragnakalpdev commented 4 years ago

We are also facing the same issue. Did you find any solution?

dzolnai commented 4 years ago

No. The problem is, this happens with our own production app too, not only with the sample project.

pragnakalpdev commented 4 years ago

Yes, same here. We tried in the production too and not working there as well.

As per https://github.com/actions-on-google/dialogflow-transactions-nodejs/issues/15 we have already filled up all the required information under Directory Information.

In the tokenizationParameters, instead of:

tokenizationParameters: {
// Tokenization parameter data will be provided by a
// payment processor, i.e. Stripe, Braintree, Vantiv, etc.
parameters: {
'gateway': 'braintree',
'braintree:sdkVersion': '1.4.0',
'braintree:apiVersion': 'v1',
'braintree:merchantId': 'xxxxxxxxxxx',
'braintree:clientKey': 'sandbox_xxxxxxxxxxxxxxx',
'braintree:authorizationFingerprint': 'sandbox_xxxxxxxxxxxxxxx',
},

we have tried our own payment gateway and also example:

tokenizationParameters: {
// Tokenization parameter data will be provided by a
// payment processor, i.e. Stripe, Braintree, Vantiv, etc.
parameters: {
'gateway': 'example',
'gatewayMerchantId': 'examplegatewayMerchantId'
},

but that doesn't work either.

taycaldwell commented 4 years ago

Hello @dzolnai and @pragnakalpdev,

This sample has been updated with the new recommended Transactions API flow. Please update your code to use this new flow.

With that said, in order to complete the transactions flow please make sure:

dzolnai commented 4 years ago

Hello @taycaldwell ,

I can confirm that it is working now as expected. It took me some time to get my own app working with transactions again, if the order JSON has one mistake, the app will just crash without any pointers to the cause. It would be great for the future if you could add better logging, like switching the assistant on an Android device in debug mode, and it would print a stack trace or something like that on a crash, or even if the simulator would give actual errors on such crashes.