1

I want to make a taxi reservation app using Google Assistant with no payment.
I used Transaction API with no payment intent but always my project is not approved.

app.intent("Default Welcome Intent", (conv) => {
    conv.ask(new TransactionRequirements());
    const arg = conv.arguments.get('TRANSACTION_REQUIREMENTS_CHECK_RESULT');
    console.log("status "+conv.user.email);

    //# Check if the user can make transaction 
    if (arg && arg.resultType === 'CAN_TRANSACT') 
    {
        if (conv.user.email === undefined) 
        { conv.ask(new SignIn('To get your account details')) }
        
        else 
        {
            //get permission for user name and location
            const permissions = ['NAME'];
            permissions.push('DEVICE_PRECISE_LOCATION');
            conv.ask("Looks like you're good to go!");
            
            if (conv.body.queryResult.languageCode == 'en') { var text = "To address you by name and to know your location"; }
            if (conv.body.queryResult.languageCode == 'es') { var text = "Para dirigirme a usted por su nombre y conocer su ubicación"; }
            conv.data.requestedPermission = "DEVICE_PRECISE_LOCATION";
            conv.ask(new SimpleResponse('Welcome to iron wheels'));
            
            return conv.ask( new Permission({ context: text, permissions }) );
        }
    } 

    //# if the use can't make transaction we will close the conversation
    else 
    {
        if (conv.body.queryResult.languageCode == 'en')
        { conv.close('Transaction failed.'); }  
        else { conv.close('Transacción fallida. '); }
    }

});
VC.One
  • 14,790
  • 4
  • 25
  • 57
aaaaaa
  • 9
  • 2

0 Answers0