Automation Button on default "Account Details" Screen

Hi All - in line of finding an easy method to receive Account Top Ups can we place an Automation Button on the Details Screen for an Account?

I can place a button on the Entity Account Screen for Wallets but not Details (screen below).

I don’t think so; not at this time.

I have completely abandoned use of the Account Details Screen altogether in favor of the “Account Statement” custom Entity Screen. Now I can do “top-ups” via Actions linked to buttons, through a series of Ask Question actions and [?prompt] syntax. I find this much more flexible, though it is more work to set up. The Transaction Documents still need to exist, but if you leave the Header blank, the buttons disappear, and you manage transactions via Automation.

I have not tried to devise a method for multiple linked Entities/Accounts however. But I would think it is possible. Using Automation and custom screens allows for much more complex flows.

Yes I spent a few hours just studying that Masterpiece again tonight. Can I ask the “Account Product” dummy you create is simply so you can get to the Payment Screen right?

Also you are using the Payment Screen from Ticket since the Dummy Product is $“0” it creates a Credit on Account or Top Up? Or maybe I am confused as I did not see how actually you enter a Top Up…

That is correct. Making account payments via Payment screen must go through a Ticket, so a “dummy product” is required. That said…

The Payment Screen does not currently allow adding Credit to an account for a balance that is zero or negative (already in a “Credit” state). It also means that you cannot “overpay” an Account using the Payment Screen to put it into a “Credit” state. For this reason, I have also abandonded the use of the Payment Screen for Account Payments.

Instead, I use a single document to add as much funds as I choose…

The “Add Credit” button brings up 2 prompts, which replace the Payment Screen method entirely with Automation, and it works really well…

Yes! That last screen (directly above) is the one I want (want, want, want…). So is this screen documented in your Tutorial “Account Statement”? I know the “Add Credit” button is there…

[EDIT] Ok see it there now :tired_face: “AS Credit Account…”, wow not sure if I can just pull that stuff out as quite a few settings and a {CALL} function.

I will see what Emre comes back about the CLOSE button taking me back to the Main Menu. It must have something to do with the fact the Navigate goes into a Different Entity Type

It should be in the Tutorial. That last screen is generated via Ask Question Action, in this Rule…

##AS Credit Account - Ask Values and Payment Type [Automation Command Executed] (Rule)##

Rule Name: AS Credit Account - Ask Values and Payment Type
Event Name: Automation Command Executed
Rule Tags: CustomerAccountPayment
Custom Constraint List (4):
Execute Rule if: Matches All
Automation Command Name Equals AS Credit Account
Command Value Is Not Null
Command Value Not Equals Cancel
{SETTING:AS Entity Balance} Less 0.01

##Actions (3):##

AS Store Value

Constraint: (none)

settingName: AS Credit Amount
settingValue: [?Amount of Credit;;;ONC]
AS Store Value

Constraint: (none)

settingName: AS Tip Amount
settingValue: [?Tip Amount;;0;ONC]
AS Ask Question

Constraint: (none)

question: Customer Account Credit\rCustomer : {SETTING:AS Entity Name}\rAccount : {SETTING:AS Account Name}\rCredit Amount : [=F('{SETTING:AS Credit Amount}')]\rTip Amount : [=F('{SETTING:AS Tip Amount}')]\r\rSelect Method of Payment
buttons: Cash=Customer Cash:Orange;Gray,Cash USD=Customer Cash USD:Green;Gray,Credit Card=Customer Credit Card:Black;Gray,Credit Card USD=Customer Credit Card USD:Blue;Gray,Cancel=Cancel:Red;Gray
AMCname: AS Credit Account - Apply
BGcolor: Purple
TPcolor:

##Mappings##

Mappings
Terminal User Role Department Ticket Type
* * * *

The Ask Question Action invokes the following Command, which actually applies the Transaction:

The {CALL:X} function executes a script that gathers more information, most importantly, the Credit Card details …

##PaymentFunctions [pay] (Script)##

Script Name: PaymentFunctions
Script Handler: pay

Script:

function UpdateDescription(creditPayment) {
  
  creditPayment = typeof creditPayment !== 'undefined' ? creditPayment : '';
  creditPayment = creditPayment.replace('Customer ','');
  creditPayment = creditPayment.replace(' Payment','');
  
  var dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
  var paymenttype = Data.Get("paymentTypeName");
  var paymentinfo = dt + " [" + paymenttype + "]";

  var cctype='';
  var ccdigits='';
  
  if (paymenttype=='Credit Card' || paymenttype=='Credit Card USD' || creditPayment=='Credit Card' || creditPayment=='Credit Card USD') {
     
    cctype = dlg.AskQuestion("Choose Credit Card type","Amex=AMEX,Master Card=MAST,Visa=VISA,Discover=DISC,Other=OTHR,CANCEL=CANCEL");
    if (cctype=="CANCEL") {
      Data.Set("canContinue",false);
      dlg.ShowMessage("Payment Cancelled");
      return 1;
    }

    ccdigits = dlg.EditValue("Last 4 CC Digits;.{4};;ON","");

    paymentinfo += " (" + cctype + " " + ccdigits + ")";

  }

  creditPayment = (creditPayment != '' ? dt + ' [' + creditPayment + ']' : '');
  if (cctype!='') {
    creditPayment = (creditPayment!='' ? creditPayment + ' (' + cctype + ' ' + ccdigits + ')' : '');
  }
  
  if (paymenttype=='Customer Account' || paymenttype=='Gift Certificate') {
    var accountname = Data.Get("accountName");
    paymentinfo += " (" + accountname + ")";
  }
  
  Data.Set("description", paymentinfo);
  
  dlg.ShowMessage("Payment Processed via Script\r"+paymentinfo);
  
  if (creditPayment != '') {
    return creditPayment;
  } else {
    return paymentinfo;
  }
}


1 Like

Very Nice, thanks Q - I will have a crack tomorrow, gotta get some shut eye as … :sleeping: