Fix QR code for Xero invoice payment
This commit is contained in:
parent
633e7c733b
commit
4b4a630304
2 changed files with 7 additions and 7 deletions
|
@ -104,7 +104,12 @@ export class InvoiceComponent implements OnInit {
|
||||||
receiptService.getOrderById(this.orderId!).subscribe(response => {
|
receiptService.getOrderById(this.orderId!).subscribe(response => {
|
||||||
if (response.status == 200){
|
if (response.status == 200){
|
||||||
this.error = false;
|
this.error = false;
|
||||||
|
if( response.body!.order.session.substring(0,1) == 'X') {
|
||||||
|
this.invString = response.body!.order.externalInvoice;
|
||||||
|
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId!).concat(" Invoice: ").concat(this.invString)))}`;
|
||||||
|
} else {
|
||||||
this.codeString = `zcash:${response.body!.order.address}?amount=${response.body!.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId!)))}`;
|
this.codeString = `zcash:${response.body!.order.address}?amount=${response.body!.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId!)))}`;
|
||||||
|
}
|
||||||
var qrcode = new QRCode(document.getElementById("payment-qr"), {
|
var qrcode = new QRCode(document.getElementById("payment-qr"), {
|
||||||
text: this.codeString,
|
text: this.codeString,
|
||||||
logo: "/assets/zcash.png",
|
logo: "/assets/zcash.png",
|
||||||
|
@ -125,10 +130,6 @@ export class InvoiceComponent implements OnInit {
|
||||||
if ( order.session.substring(0,1) == 'W') {
|
if ( order.session.substring(0,1) == 'W') {
|
||||||
this.isWCOrder = true;
|
this.isWCOrder = true;
|
||||||
}
|
}
|
||||||
if( order.session.substring(0,1) == 'X') {
|
|
||||||
this.invString = order.externalInvoice;
|
|
||||||
}
|
|
||||||
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId!).concat(" Invoice: ").concat(this.invString)))}`;
|
|
||||||
this.zcashUrl = this.sanitizer.bypassSecurityTrustUrl(this.codeString);
|
this.zcashUrl = this.sanitizer.bypassSecurityTrustUrl(this.codeString);
|
||||||
});
|
});
|
||||||
this.nameUpdate.subscribe(name => {
|
this.nameUpdate.subscribe(name => {
|
||||||
|
|
|
@ -347,7 +347,7 @@ vE = {
|
||||||
|
|
||||||
// console.log('Generating QRCode....')
|
// console.log('Generating QRCode....')
|
||||||
|
|
||||||
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId)))}`;
|
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId).concat(' Invoice: ').concat(orderData.order.externalInvoice)))}`;
|
||||||
|
|
||||||
var qrcode = new QRCode(document.getElementById("payment-qr"), {
|
var qrcode = new QRCode(document.getElementById("payment-qr"), {
|
||||||
text: this.codeString,
|
text: this.codeString,
|
||||||
|
@ -359,7 +359,6 @@ vE = {
|
||||||
correctLevel: QRCode.CorrectLevel.H
|
correctLevel: QRCode.CorrectLevel.H
|
||||||
});
|
});
|
||||||
|
|
||||||
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId)))}`;
|
|
||||||
this.zcashUrl = this.sanitizer.bypassSecurityTrustUrl(this.codeString);
|
this.zcashUrl = this.sanitizer.bypassSecurityTrustUrl(this.codeString);
|
||||||
}, error => {
|
}, error => {
|
||||||
console.log(error.message);
|
console.log(error.message);
|
||||||
|
|
Loading…
Reference in a new issue