Payment service component added - initial testing version
This commit is contained in:
parent
75cc66dfef
commit
ee09c1f710
8 changed files with 73 additions and 1 deletions
|
@ -8,6 +8,7 @@ import { InvoiceComponent } from './invoice/invoice.component';
|
|||
import { ListOrdersComponent } from './listorders/listorders.component';
|
||||
import { AuthGuardService } from './auth-guard.service';
|
||||
import { NodeResolverService } from './node-resolver.service';
|
||||
import { PmtserviceComponent } from './pmtservice/pmtservice.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', component: LoginComponent, resolve: { response: NodeResolverService} },
|
||||
|
@ -17,6 +18,7 @@ const routes: Routes = [
|
|||
{ path: 'biz', component: BusinessComponent, canActivate: [AuthGuardService]},
|
||||
{ path: 'receipt/:orderId', component: ReceiptComponent},
|
||||
{ path: 'invoice/:orderId', component: InvoiceComponent},
|
||||
{ path: 'pmtservice', component: PmtserviceComponent},
|
||||
{ path: 'login', component: LoginComponent, resolve: { response: NodeResolverService}}
|
||||
];
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||
import { PromptInvoiceComponent } from './prompt-invoice/prompt-invoice.component';
|
||||
import { PromptReceiptComponent } from './prompt-receipt/prompt-receipt.component';
|
||||
import { NotifierComponent } from './notifier/notifier.component';
|
||||
import { PmtserviceComponent } from './pmtservice/pmtservice.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -71,7 +72,8 @@ import { NotifierComponent } from './notifier/notifier.component';
|
|||
InvoiceComponent,
|
||||
PromptInvoiceComponent,
|
||||
PromptReceiptComponent,
|
||||
NotifierComponent
|
||||
NotifierComponent,
|
||||
PmtserviceComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
|
0
src/app/pmtservice/pmtservice.component.css
Normal file
0
src/app/pmtservice/pmtservice.component.css
Normal file
1
src/app/pmtservice/pmtservice.component.html
Normal file
1
src/app/pmtservice/pmtservice.component.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p>{{ pmtData.ownerId }}</p>
|
23
src/app/pmtservice/pmtservice.component.spec.ts
Normal file
23
src/app/pmtservice/pmtservice.component.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PmtserviceComponent } from './pmtservice.component';
|
||||
|
||||
describe('PmtserviceComponent', () => {
|
||||
let component: PmtserviceComponent;
|
||||
let fixture: ComponentFixture<PmtserviceComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PmtserviceComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(PmtserviceComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
36
src/app/pmtservice/pmtservice.component.ts
Normal file
36
src/app/pmtservice/pmtservice.component.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, ActivatedRoute, Params } from "@angular/router";
|
||||
import { PmtData } from "./pmtservice.model"
|
||||
|
||||
@Component({
|
||||
selector: 'app-pmtservice',
|
||||
templateUrl: './pmtservice.component.html',
|
||||
styleUrls: ['./pmtservice.component.css']
|
||||
})
|
||||
|
||||
export class PmtserviceComponent implements OnInit {
|
||||
|
||||
|
||||
public pmtData : PmtData = {
|
||||
ownerId :'',
|
||||
invoice: '',
|
||||
amount: 0,
|
||||
currency: '',
|
||||
shortcode: ''
|
||||
};
|
||||
|
||||
constructor(private activatedRoute: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.queryParams.subscribe((params) => {
|
||||
this.pmtData.ownerId = params["ownerid"];
|
||||
this.pmtData.invoice = params["invoice"];
|
||||
this.pmtData.amount = params["amount"];
|
||||
this.pmtData.currency = params["currency"];
|
||||
this.pmtData.shortcode = params["shortcode"];
|
||||
|
||||
console.log(this.pmtData);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
7
src/app/pmtservice/pmtservice.model.ts
Normal file
7
src/app/pmtservice/pmtservice.model.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export interface PmtData {
|
||||
ownerId: string;
|
||||
invoice: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
shortcode: string;
|
||||
}
|
1
src/app/pmtservice/url.txt
Normal file
1
src/app/pmtservice/url.txt
Normal file
|
@ -0,0 +1 @@
|
|||
http://localhost:4200/pmtservice?ownerid=Rene&amount=30¤cy=USD&invoice=INV-003234&shortcode=abcde
|
Loading…
Reference in a new issue