I do, I was just trying to understand the full scope of the issue, and why we have to go through all of this, once again, after we had already last year.
I still greatly appreciate your support, and the fact I am able to speak directly with you here has been a help.
Ultimately we have been able to resolve our issues, I will describe the steps taken below:
- We followed your advice and we added the hook - I updated it to invoke “before.response”:
app.hook(‘before.response’, (
error, handleRequest, jovo
) => {
if (jovo.$request.getAccessToken()) {
if (jovo.$originalResponse.systemIntent && (jovo.$originalResponse.systemIntent.data[’@type’] === ‘type.googleapis.com/google.actions.v2.TransactionDecisionValueSpec’)) {
jovo.$originalResponse.systemIntent.data[’@type’] = ‘type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValueSpec’;
const newData = {
“@type”: ‘type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValueSpec’,
orderOptions: jovo.$originalResponse.systemIntent.data.orderOptions,
paymentParameters: jovo.$originalResponse.systemIntent.data.paymentOptions,
order: jovo.$originalResponse.systemIntent.data.proposedOrder
};
jovo.$originalResponse.systemIntent.data = newData;
}
}
});
- We then updated the JSON we are sending to transactionDecision():
const fullOrder = {
orderOptions: {
requestDeliveryAddress: “false”
},
paymentParameters: {
merchantPaymentOption: {
merchantPaymentMethod: [
{
paymentMethodId: ${userName}${Math.floor(new Date() / 1000)}
,
paymentMethodDisplayInfo: {
paymentType: “BANK”,
paymentMethodDisplayName: displayName
}
}
]
},
},
presentationOptions: {
actionDisplayName: “PLACE_ORDER”
},
order: {
createTime: new Date().toISOString(),
merchantOrderId: ${userName}${Math.floor(new Date() / 1000)}
,
transactionMerchant: {
id: “…”,
name: “PSE&G”
},
contents: {
lineItems: [
{
id: ‘…’,
name: ${item}
,
description: “PSE&G Payment”,
priceAttributes: [
{
type: “TOTAL”,
name: “PSEG Payment”,
state: “ACTUAL”,
amount: {
currencyCode: “USD”,
amountInMicros: ((parseInt(cents) / 100 + parseInt(dollars)) * Math.pow(10, 6))
},
taxIncluded: false
}
],
notes: [
notes
],
purchase: {
quantity: 1,
unitMeasure: {
measure: 1,
unit: “UNIT_UNSPECIFIED”
},
}
}
]
},
buyerInfo: {
email: customerEmail,
firstName,
lastName,
displayName: ${firstName} ${lastName}
},
priceAttributes: [
{
type: “TOTAL”,
name: “Total Price”,
state: “ACTUAL”,
amount: {
currencyCode: “USD”,
amountInMicros: ((parseInt(cents) / 100 + parseInt(dollars)) * Math.pow(10, 6))
},
},
],
purchase: {
status: “CREATED”,
userVisibleStatusLabel: “CREATED”,
type: “PURCHASE_TYPE_UNSPECIFIED”,
purchaseLocationType: “ONLINE_PURCHASE”
}
}
};
With all of this, we were able to successfully implement transactions again