this.$.buttonsPanel.createComponent({
kind: "onyx.Button",
name: "processButton",
- showing: false,
+ disabled: true,
ontap: "processCreditCard",
classes: "onyx-affirmative",
content: "_process".loc()
this.$.buttonsPanel.createComponent({
kind: "onyx.Button",
name: "authorizeButton",
- showing: false,
+ disabled: true,
ontap: "processCreditCard",
content: "_authorize".loc()
}, {owner: this});
newItem: function (options) {
options = options || {};
var that = this,
- // XXX #refactor
+ // XXX #refactor
customer = that.parent.parent.getValue().getValue("customer"),
creditCardCollection = customer.get("creditCards"),
creditCardModel = new XM.CreditCard(),
// XXX #refactor
payload.orderNumber = that.parent.parent.getValue().id;
payload.customerNumber = that.parent.parent.getValue().getValue("customer.id");
- that.$.authorizeButton.setShowing(false);
- that.$.processButton.setShowing(false);
+ that.$.authorizeButton.setDisabled(true);
+ that.$.processButton.setDisabled(true);
XT.dataSource.callRoute("credit-card", payload, {success: success, error: error});
};
var list = this.$.list,
creditCard = list.getModel(list.getFirstSelected()),
ccv = this.$.ccv.value,
- amount = this.$.creditCardAmount.value;
+ amount = this.$.creditCardAmount.value,
+ disable = !creditCard || !amount || (!ccv && !!XT.session.settings.get("CCRequireCCV"));
- this.$.processButton.setShowing(creditCard && amount && (ccv || !XT.session.settings.get("CCRequireCCV")));
- this.$.authorizeButton.setShowing(creditCard && amount && (ccv || !XT.session.settings.get("CCRequireCCV")));
+ this.$.processButton.setDisabled(disable);
+ this.$.authorizeButton.setDisabled(disable);
return true;
}
});
{kind: "XV.InputWidget", attr: "CCLogin",
label: "_login".loc()},
{kind: "XV.InputWidget", attr: "CCPassword",
- label: "_password".loc()},
+ label: "_transactionKey".loc()},
{kind: "XV.ToggleButtonWidget", attr: "CCTest",
label: "_testMode".loc()},
{kind: "XV.ToggleButtonWidget", attr: "CCRequireCCV",