-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenPaymentZoozCommand.cls
38 lines (32 loc) · 1.11 KB
/
OpenPaymentZoozCommand.cls
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
public class OpenPaymentZoozCommand implements IZoozCommand{
public OpenPaymentCommandWrapper PaymentInfo{get;set;}
public OpenPaymentZoozCommand() {
PaymentInfo = new OpenPaymentCommandWrapper();
}
public String buildCommandBody(){
return JSON.serializePretty(PaymentInfo);
}
public OpenPaymentZoozCommand setAmount(Decimal amount){
this.PaymentInfo.paymentDetails.amount = amount;
return this;
}
public OpenPaymentZoozCommand setCustomerLoginID(String customerLoginID){
this.PaymentInfo.customerDetails.customerLoginID = customerLoginID;
return this;
}
public OpenPaymentZoozCommand setPaymentInfoConfig(OpenPaymentCommandWrapper config){
if(config != null)
this.PaymentInfo = config;
return this;
}
public class OpenPaymentCommandWrapper{
public String command {get; private set;}
public ZoozCustomerDetailsWrapper customerDetails{get;set;}
public ZoozPaymentDetailsWrapper paymentDetails{get;set;}
public OpenPaymentCommandWrapper(){
command = 'openPayment';
customerDetails = new ZoozCustomerDetailsWrapper();
paymentDetails = new ZoozPaymentDetailsWrapper();
}
}
}