Implement enhancements for #9

This commit is contained in:
Rene Vergara 2023-02-28 12:59:40 -06:00
parent 1dddcb74ff
commit 5823da0d5b
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
2 changed files with 179 additions and 176 deletions

View file

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed ### Changed
- Parametrization of text elements - Parametrization of text elements
- Expanded Xero reference message to include ZEC amount
## [1.4.1] - 2023-01-09 ## [1.4.1] - 2023-01-09
@ -76,15 +77,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Convenience buttons on checkout for wallets that are not ZIP-321-compliant - Convenience buttons on checkout for wallets that are not ZIP-321-compliant
- PmtService Component first alpha version ready for testing - PmtService Component first alpha version ready for testing
- Add `crmToken` field to `owner.model.ts`
- Add `externalInvoice` field and `shortCode` field to `order.model.ts`
### Fixed ### Fixed
- Memo for checkout orders - Memo for checkout orders
## Added
- Add `crmToken` field to `owner.model.ts`
- Add `externalInvoice` field and `shortCode` field to `order.model.ts`
## [1.2.1] - 2022-08-01 ## [1.2.1] - 2022-08-01

View file

@ -31,6 +31,7 @@ export class InvoiceComponent implements OnInit {
name: string = ''; name: string = '';
error: boolean = false; error: boolean = false;
codeString: string = 'Test'; codeString: string = 'Test';
invString: string = '';
public isWCOrder : boolean = false; public isWCOrder : boolean = false;
zcashUrl: SafeUrl = ''; zcashUrl: SafeUrl = '';
externalURL: string = ''; externalURL: string = '';
@ -124,7 +125,10 @@ 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;
} }
this.codeString = `zcash:${this.order.address}?amount=${this.order.totalZec.toFixed(8)}&memo=${URLSafeBase64.encode(Buffer.from('ZGo Order::'.concat(this.orderId!)))}`; 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 => {