LSLoyalty.getReceipt Angular application
Im trying to follow the instructions here to get the receipt details with the js function, but Im not getting anything.
Im doing this in angular/typescript so I may be mixing up something.
I declare the library at the start: declare let LSLoyalty: any;
on init i call: LSLoyalty.getReceipt(s => this.receiptLoaded(), this.receiptError())
then I have my separate functions below:
receiptLoaded() {
this.log += '\nr loaded';
this.log += '\n' + JSON.stringify(arguments);
}
receiptError() {
this.log += '\nr error'
}
Post edited by Katherine_Welford on
Tags:
Answers
if anyone is looking for an answer, you need to call it like so
LSLoyalty.getReceipt(res => {
this.receipt = res;
}, err => {
this.errors = err;
})
res would contain the Receipt json object