mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
Vue.component("AOPP", {
|
|
props: ["srvModel"],
|
|
methods: {
|
|
onaoppChange: function(){
|
|
this.aoppAddressInputDirty = true;
|
|
this.aoppAddressInputInvalid = false;
|
|
},
|
|
onSubmit : function(){
|
|
var self = this;
|
|
if (this.aoppAddressInput && this.aoppAddressInput.startsWith("aopp:?")) {
|
|
this.aoppAddressFormSubmitting = true;
|
|
// Push the email to a server, once the reception is confirmed move on
|
|
$.ajax({
|
|
url: "/plugins/"+this.srvModel.storeId+"/AOPP/" +this.srvModel.invoiceId,
|
|
type: "POST",
|
|
data: JSON.stringify({ aopp: this.aoppAddressInput }),
|
|
contentType: "application/json; charset=utf-8"
|
|
})
|
|
.done(function () {
|
|
}).always(function () {
|
|
self.aoppAddressFormSubmitting = false;
|
|
});
|
|
} else {
|
|
this.aoppAddressInputInvalid = true;
|
|
}
|
|
}
|
|
},
|
|
data: function () {
|
|
return {
|
|
aoppAddressInput: "",
|
|
aoppAddressInputDirty: false,
|
|
aoppAddressInputInvalid: false,
|
|
aoppAddressFormSubmitting: false
|
|
}
|
|
}
|
|
});
|