/
SwiperDataType.m
executable file
·83 lines (73 loc) · 2.27 KB
/
SwiperDataType.m
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
//
// SwiperDataType.m
// ANMobilePaymentLib
//
// Created by Rajesh T on 1/29/13.
//
//
#import "SwiperDataType.h"
@implementation SwiperDataType
@synthesize deviceDescription;
@synthesize encryptedValue;
@synthesize encryptionType;
+ (SwiperDataType *) swiperDataType {
SwiperDataType *b = [[SwiperDataType alloc] init];
return b;
}
- (id) init {
self = [super init];
if (self) {
//Initialize fields here
self.deviceDescription = nil;
self.encryptedValue = nil;
self.encryptionType = nil;
}
return self;
}
- (NSString *) description {
NSString *output = [NSString stringWithFormat:@""
@"SwiperDataType.deviceDescription = %@"
@"SwiperDataType.encryptedValue = %@"
@"SwiperDataType.encryptionType= %@",
self.deviceDescription,
self.encryptedValue,
self.encryptionType];
return output;
}
- (NSString *) stringOfXMLRequest {
NSString *s = [NSString stringWithFormat:@""
@"<encryptedTrackData>"
@"<FormOfPayment>"
@"<Value>"
@"<Encoding>Hex</Encoding>"
@"<EncryptionAlgorithm>"
@"%@"
@"</EncryptionAlgorithm>"
@"<Scheme>"
@"<DUKPT>"
@"<Operation>DECRYPT</Operation>"
@"<Mode>"
// @"<PIN>text</PIN>"
@"<Data>Data</Data>"
@"</Mode>"
@"<DeviceInfo>"
@"<Description>"
@"%@" // Descrition for swiper data
@"</Description>"
@"</DeviceInfo>"
@"<EncryptedData>"
@"<Value>"
@"%@" //EncryptedValue
@"</Value>"
@"</EncryptedData>"
@"</DUKPT>"
@"</Scheme>"
@"</Value>"
@"</FormOfPayment>"
@"</encryptedTrackData>",
self.encryptionType,
self.deviceDescription,
self.encryptedValue];
return s;
}
@end