-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPayment.h
164 lines (162 loc) · 4.56 KB
/
Payment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#pragma once
#include <iomanip>
#include "Appointment.h"
#include <iostream>
using namespace std;
class Charges{
protected:
float Hourly_Charge_InPerson;
float Hourly_Charge_Online;
public:
int view_charges() const;
float get_person() const {
return Hourly_Charge_InPerson;
}
float get_Online() const {
return Hourly_Charge_Online;
}
void edit_charges();
void operator = (const float);
};
class Payment_Gateway{
public:
virtual int Charge(){
cout<<"Payment Gateway";
}
};
class Bank_Transfer:public Payment_Gateway{
protected:
string Account_Number;
string User_Expiry;
string User_CCV;
public:
virtual int Charge(){
cout<<"Welcome to Bank Transfer Gateway";
start:
cout<<"Please Enter valid Account Number : ";
cin>>Account_Number;
if (Account_Number.length()!=17){
cout<<"Account Number should have 17 Digits\n";
goto start;
}
string temp;
expMon:
cout<<"Please Enter Expiry Month : ";
cin>>temp;
if (temp.length()!=2) { goto expMon; }
User_Expiry=temp;
expYear:
cout<<"Please Enter Expiry Year : ";
cin>>temp;
if (temp.length()!=4) { goto expYear; };
User_Expiry+=temp;
CCV:
cout<<"Please Enter CCV : ";
cin>>User_CCV;
if (User_CCV.length()!=3) {cout<<"Must be 3 Digits\n"; goto CCV; };
cout<<"Connection Successful!\n";
cout<<"Please Enter amount to deposit as Balance : ";
int dep;
cin>>dep;
return dep;
}
};
class EasyPaisa:public Payment_Gateway{
protected:
string User_Number;
public:
virtual int Charge(){
cout<<"Welcome to EasyPaisa Gateway\n";
start:
cout<<"Please Enter valid Phone number : ";
cin>>User_Number;
if (User_Number.length()!=11){
cout<<"Phone No should have 11 Digits\n";
goto start;
}
cout<<"Connection Successful!\n";
cout<<"Please Enter amount to deposit as Balance : ";
int dep;
cin>>dep;
return dep;
}
};
class Union_Pay:public Bank_Transfer{
public:
virtual int Charge(){
cout<<"Welcome to Union Pay Gateway";
start:
cout<<"Please Enter valid Account Number : ";
cin>>Account_Number;
if (Account_Number.length()!=17){
cout<<"Account Number should have 17 Digits\n";
goto start;
}
string temp;
expMon:
cout<<"Please Enter Expiry Month : ";
cin>>temp;
if (temp.length()!=2) { goto expMon; }
User_Expiry=temp;
expYear:
cout<<"Please Enter Expiry Year : ";
cin>>temp;
if (temp.length()!=4) { goto expYear ;};
User_Expiry+=temp;
CCV:
cout<<"Please Enter CCV : ";
cin>>User_CCV;
if (User_CCV.length()!=3) {cout<<"Must be 3 Digits\n"; goto CCV; };
cout<<"Connection Successful!\n";
cout<<"Please Enter amount to deposit as Balance : ";
int dep;
cin>>dep;
return dep;
}
};
class Paypak:public Bank_Transfer{
public:
virtual int Charge(){
cout<<"Welcome to Paypak Gateway";
start:
cout<<"Please Enter valid Account Number : ";
cin>>Account_Number;
if (Account_Number.length()!=17){
cout<<"Account Number should have 17 Digits\n";
goto start;
}
string temp;
expMon:
cout<<"Please Enter Expiry Month : ";
cin>>temp;
if (temp.length()!=2) { goto expMon; }
User_Expiry=temp;
expYear:
cout<<"Please Enter Expiry Year : ";
cin>>temp;
if (temp.length()!=4) { goto expYear; };
User_Expiry+=temp;
CCV:
cout<<"Please Enter CCV : ";
cin>>User_CCV;
if (User_CCV.length()!=3) {cout<<"Must be 3 Digits\n"; goto CCV; };
cout<<"Connection Successful!\n";
cout<<"Please Enter amount to deposit as Balance : ";
int dep;
cin>>dep;
return dep;
}
};
int Charges::view_charges() const {
cout<<"In Person Appointment : "<<Hourly_Charge_InPerson<<" per hour.\n";
cout<<"Online Appointment : "<<Hourly_Charge_Online<<" per hour.\n";
}
void Charges::edit_charges() {
cout<<"Please Enter Charges/Hour in PKR :";
cin>>Hourly_Charge_InPerson;
Hourly_Charge_Online=((Hourly_Charge_InPerson/100)*70);
}
void Charges::operator = (const float charge){
this->Hourly_Charge_InPerson=charge;
Hourly_Charge_Online=(charge/100)*70;
};