@aptos-scp/scp-component-rn-device-services 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/Info.plist +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/VersionInfo.plist +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.10.2.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.10.3.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.10.4.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.10.4.omo +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.10.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.8.6.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit v1.9.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/AdyenToolkit.bundle/adyentoolkit.momd/adyentoolkit.mom +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYAccountData.h +26 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYAdditionalDataRequest.h +38 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYAmount.h +16 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYAppData.h +26 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYBalance.h +13 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYCashTransactionRequest.h +35 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYConstants.h +688 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYCurrency.h +33 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYDevice.h +308 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYDeviceData.h +52 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYDeviceManagerDelegate.h +66 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYDeviceRegistry.h +125 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYDynamicCurrencyConversionData.h +22 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYErrors.h +153 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCard.h +41 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardBalanceRequest.h +50 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardBalanceResponse.h +38 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardLoadRequest.h +78 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardLoadRequestDelegate.h +25 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardLoadResponse.h +31 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardMask.h +31 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYGiftCardRequest.h +13 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYLocationManager.h +14 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYLoginDelegate.h +80 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYPrintReceiptRequest.h +57 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYReceipt.h +33 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYReceiptLine.h +92 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYReferralRequest.h +16 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYRefundData.h +54 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYServerSynchronization.h +18 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYSignatureRequest.h +117 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYSpecialTransactionRequest.h +63 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYToneGenerator.h +45 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYTransactionData.h +416 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYTransactionDetails.h +45 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYTransactionProcessorDelegate.h +279 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYTransactionRequest.h +108 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/ADYUIKit.h +30 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/Adyen.h +591 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/AdyenToolkit-umbrella.h +59 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/AdyenToolkit.h +79 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/NSData+ADY.h +31 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/NSString+ADY.h +19 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Headers/adylog.h +176 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Info.plist +0 -0
- package/ios/Frameworks/Adyen/AdyenToolkit.framework/Modules/module.modulemap +6 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenConstants.h +40 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenConstants.m +28 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenDelegate.h +23 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenDelegate.m +15 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenDeviceManagerDelegate.h +19 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenDeviceManagerDelegate.m +31 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenLoginDelegate.h +19 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenLoginDelegate.m +26 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenTransactionProcessorDelegate.h +26 -0
- package/ios/SCPRNDeviceServices/Adyen/AdyenTransactionProcessorDelegate.m +148 -0
- package/ios/SCPRNDeviceServices/AdyenPaymentTerminal.h +19 -0
- package/ios/SCPRNDeviceServices/AdyenPaymentTerminal.m +457 -22
- package/ios/SCPRNDeviceServices.xcodeproj/project.pbxproj +56 -0
- package/lib/AdyenDevice/AdyenDevice.d.ts +56 -0
- package/lib/AdyenDevice/AdyenDevice.js +350 -0
- package/lib/AdyenDevice/AdyenDevice.js.map +1 -0
- package/lib/AdyenDevice/constants.d.ts +13 -0
- package/lib/AdyenDevice/constants.js +228 -0
- package/lib/AdyenDevice/constants.js.map +1 -0
- package/lib/AdyenDevice/index.d.ts +1 -0
- package/lib/AdyenDevice/index.js +7 -0
- package/lib/AdyenDevice/index.js.map +1 -0
- package/lib/AdyenDevice/interfaces.d.ts +175 -0
- package/lib/AdyenDevice/interfaces.js +3 -0
- package/lib/AdyenDevice/interfaces.js.map +1 -0
- package/lib/AurusDevice/AurusDevice.js +1 -1
- package/lib/AurusDevice/AurusDevice.js.map +1 -1
- package/lib/PaymentDeviceFactory.d.ts +1 -1
- package/lib/PaymentDeviceFactory.js +1 -1
- package/lib/ScannerDeviceFactory.d.ts +1 -1
- package/lib/ScannerDeviceFactory.js +2 -2
- package/lib/ScannerDeviceFactory.js.map +1 -1
- package/lib/configs/inversify/inversify.config.js +4 -2
- package/lib/configs/inversify/inversify.config.js.map +1 -1
- package/lib/interfaces/payment/messages/responses.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ADYTransactionProcessorDelegate.h
|
|
3
|
+
// AdyenPOSLib
|
|
4
|
+
//
|
|
5
|
+
// Created by Jeroen Koops on 4/11/13.
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "ADYConstants.h"
|
|
10
|
+
|
|
11
|
+
@class ADYSignatureRequest;
|
|
12
|
+
@class ADYAdditionalDataRequest;
|
|
13
|
+
@class ADYPrintReceiptRequest;
|
|
14
|
+
@class ADYReferralRequest;
|
|
15
|
+
@class ADYTransactionData;
|
|
16
|
+
@class ADYDynamicCurrencyConversionData;
|
|
17
|
+
|
|
18
|
+
typedef NS_ENUM(NSUInteger, ADYCardStatus) {
|
|
19
|
+
|
|
20
|
+
ADYCardStatusCardRemoved,
|
|
21
|
+
ADYCardStatusNextTransaction,
|
|
22
|
+
ADYCardStatusError,
|
|
23
|
+
ADYCardStatusNotSupported
|
|
24
|
+
} ;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Delegate used to receive updates about a transaction's progress and completion.
|
|
28
|
+
*/
|
|
29
|
+
@protocol ADYTransactionProcessorDelegate <NSObject>
|
|
30
|
+
|
|
31
|
+
/** @name Transaction completion */
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This method is called when the transaction completes successfully.
|
|
35
|
+
*
|
|
36
|
+
* Successful completion does *not* necessarily mean that a payment has been made -
|
|
37
|
+
* the transaction may also have been declined or cancelled. This can be determined
|
|
38
|
+
* by examining the given `transaction`'s `status`.
|
|
39
|
+
*
|
|
40
|
+
* After this method has been called, no other methods on the delegate will be called.
|
|
41
|
+
* @param transaction a data-object containing transaction-details.
|
|
42
|
+
*/
|
|
43
|
+
-(void)transactionComplete:(ADYTransactionData*)transaction;
|
|
44
|
+
|
|
45
|
+
/** @name Transaction-processing callbacks */
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Called when a signature must be confirmed as part of processing a transaction.
|
|
49
|
+
*
|
|
50
|
+
* After this method has been called, transaction-processing will be paused until
|
|
51
|
+
* either `submitConfirmedSignature:` or `submitUnconfirmedSignature:` has been called
|
|
52
|
+
* on the given `signatureRequest`.
|
|
53
|
+
*
|
|
54
|
+
* This method must be implemented in two different ways, depending on the presence
|
|
55
|
+
* of a printer on the payment-device (as determined by the `paymentDeviceHasPrinter`
|
|
56
|
+
* method on the Adyen class).
|
|
57
|
+
*
|
|
58
|
+
* If the device has a printer, it will first print a receipt, which must be signed
|
|
59
|
+
* by the customer. The attendant will then compare this signature to the signature on
|
|
60
|
+
* the card, and either confirm that they are identical, or not. This method must be
|
|
61
|
+
* implemented to show a user-interface where the attendant can choose between
|
|
62
|
+
* "Confirmed" or "Not confirmed", for example by pressing a button. Subsequently,
|
|
63
|
+
* the method must call either `submitConfirmedSignature:` or `submitUnconfirmedSignature:`
|
|
64
|
+
* on the `signatureRequest`, both with `nil` as the `signatureImage` parameter, to
|
|
65
|
+
* continue transaction processing.
|
|
66
|
+
*
|
|
67
|
+
* If the device does not have a printer, this method must be implemented to display
|
|
68
|
+
* a user-interface on which the customer can draw a signature. The attendant must
|
|
69
|
+
* then have the choice to either confirm, or not, the drawn signature after comparing
|
|
70
|
+
* it to the signature on the card - for example,
|
|
71
|
+
* by pressing a button. Subsequently, the method must call either `submitConfirmedSignature:`
|
|
72
|
+
* or `submitUnconfirmedSignature:` on the given `signatureRequest`, both with the drawn
|
|
73
|
+
* image as `signatureImage` parameter.
|
|
74
|
+
*
|
|
75
|
+
* Note that, instead of calling `submitConfirmedSignature:` or `submitUnconfirmedSignature:`,
|
|
76
|
+
* it is also possible to cancel the transaction at this point as usual, by
|
|
77
|
+
* calling `[ADYTransactionRequest requestCancel]`.
|
|
78
|
+
* After a transaction has been cancelled, subsequent calls to `submitConfirmedSignature:`
|
|
79
|
+
* or `submitUnconfirmedSignature:` will have no effect.
|
|
80
|
+
*
|
|
81
|
+
* @param signatureRequest Request-object used to continue transaction processing.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
-(void)transactionRequiresSignature:(ADYSignatureRequest*)signatureRequest;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Called when a transaction provides additional data, for example loyalty-related data,
|
|
88
|
+
* providing the app with an opportunity to modify the amount charged based on that data.
|
|
89
|
+
*
|
|
90
|
+
* After this method has been called, transaction-processing will be paused until
|
|
91
|
+
* `continueWithUpdatedAmount:` is called on the given `additionalDataRequest`, either
|
|
92
|
+
* with an `NSNumber` to update the amount, or with `nil` to continue with the original
|
|
93
|
+
* amount.
|
|
94
|
+
*
|
|
95
|
+
* Note that, instead of calling `continueWithUpdatedAmount`, it it also possible
|
|
96
|
+
* to cancel the transaction at this point as usual, by calling `[ADYTransactionRequest requestCancel]`.
|
|
97
|
+
* After the transaction has been cancelled, subsequent calls to `continueWithUpdatedAmount:`
|
|
98
|
+
* will have no effect.
|
|
99
|
+
*
|
|
100
|
+
* @param additionalDataRequest object containing the additional data, and methods to
|
|
101
|
+
* continue transaction-processing.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
-(void)transactionProvidesAdditionalData:(ADYAdditionalDataRequest*)additionalDataRequest;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Called when a receipt must be printed out by the app.
|
|
108
|
+
*
|
|
109
|
+
* After this method has been called, transaction-processing will be paused until
|
|
110
|
+
* `confirmReceiptPrinted:` is called on the given `printReceiptRequest`.
|
|
111
|
+
*
|
|
112
|
+
* This method must be implemented to print a receipt on paper, based on the data
|
|
113
|
+
* provided in the `printReceiptRequest`.
|
|
114
|
+
*
|
|
115
|
+
* Note that, instead of calling `[ADYPrintReceiptRequest confirmReceiptPrinted:]`, it
|
|
116
|
+
* is also possible to cancel the transaction at this point by calling
|
|
117
|
+
* `[ADYTransactionRequest requestCancel]`. If this is done, do not call `confirmReceiptPrinted:`
|
|
118
|
+
* anymore. However, it is possible that `transactionRequiresPrintedReceipt:` will be called
|
|
119
|
+
* a second time as part of the transaction-flow. If that happens, and it is not desirable to
|
|
120
|
+
* print out a receipt at that time, cancel the transaction again.
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* @param printReceiptRequest object containing receipt-data, and methods to continue
|
|
124
|
+
* transaction-processing.
|
|
125
|
+
*/
|
|
126
|
+
-(void)transactionRequiresPrintedReceipt:(ADYPrintReceiptRequest*)printReceiptRequest;
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Called when a transaction requires referral.
|
|
131
|
+
*
|
|
132
|
+
* After this method has been called, transaction-processing will be paused until
|
|
133
|
+
* `confirmReferralWithCode:` is called on the given `referralRequest`.
|
|
134
|
+
*
|
|
135
|
+
* This method must be implemented to ask for referral authorisation code.
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
* @param referralRequest object containing referral data, and method to continue
|
|
139
|
+
* transaction processing with auth code.
|
|
140
|
+
*/
|
|
141
|
+
-(void)transactionRequiresReferral:(ADYReferralRequest*)referralRequest;
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@optional
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The payment device found it possible to allow the shopper to pay in their own currency
|
|
148
|
+
* using Direct Currency Conversion. The payment device is currently displaying this
|
|
149
|
+
* option to the shopper. This call is only informative, the shopper has to decide.
|
|
150
|
+
*
|
|
151
|
+
* @param data The details of the DCC option.
|
|
152
|
+
*/
|
|
153
|
+
- (void)transactionSuggestsDcc:(ADYDynamicCurrencyConversionData *)data;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The shopper has entered a gratuity on the payment device. This can only occur if the
|
|
157
|
+
* `ADYTransactionOptionAskGratuity' option was passed to the ADYTransactionRequest.
|
|
158
|
+
* Setting this option triggers the payment device to ask the shopper if they would like
|
|
159
|
+
* to give a gratuity (tip) to the merchant.
|
|
160
|
+
*
|
|
161
|
+
* @param gratuityAmountMinorUnits The amount of gratuity given in minor units. The currency
|
|
162
|
+
* is the same as the transaction.
|
|
163
|
+
*/
|
|
164
|
+
- (void)transactionGratuityEntered:(int)gratuityAmountMinorUnits;
|
|
165
|
+
|
|
166
|
+
/** @name Transaction progress */
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Indicates that an application has been selected by the user.
|
|
170
|
+
* In payment terms, an application is a manner to make a payment -
|
|
171
|
+
* for example, one single card can allow for both Maestro and Mastercard
|
|
172
|
+
* payments. After the card has been inserted, the cardholder will be prompted
|
|
173
|
+
* by the terminal to select one of the supported applications. After
|
|
174
|
+
* he's made his choice, the `transactionApplicationSelected:` callback will
|
|
175
|
+
* be called, with the name of the selected application as argument.
|
|
176
|
+
*
|
|
177
|
+
* @note Application selection events are only supported on terminals with firmware
|
|
178
|
+
* version p30 or greater.
|
|
179
|
+
*/
|
|
180
|
+
-(void)transactionApplicationSelected:(NSString*)application;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Indicates that one digit of a pincode has been entered. The total number
|
|
184
|
+
* of digits entered so far is passed as an argument.
|
|
185
|
+
*
|
|
186
|
+
* Note that there's no way to know in advance of how many digits the pincode
|
|
187
|
+
* exists - it may be 4, 5, or 6 digits, or even more. However, before the
|
|
188
|
+
* the pincode is entered, `transactionStatChanged:` will be called with
|
|
189
|
+
* a `state` of `ADYTenderStateWaitingForPin`, and after the pincode has been
|
|
190
|
+
* completed, it will be called again with a state of `ADYTenderStatePinEntered`.
|
|
191
|
+
*
|
|
192
|
+
* Note also backspaces entered by the user while entering the pincode are not
|
|
193
|
+
* transmitted. This means that if the user enters two digits, then presses
|
|
194
|
+
* backspace, then enters another digits, `transactionPinDigitEntered:` will
|
|
195
|
+
* be called three times: the first time with an argument of `1`, then with
|
|
196
|
+
* an argument of `2`, and finally again with an argument of `2`.
|
|
197
|
+
*
|
|
198
|
+
* @note PIN entry events are only supported on terminals with firmware
|
|
199
|
+
* version p30 or greater.
|
|
200
|
+
*/
|
|
201
|
+
-(void)transactionPinDigitEntered:(NSUInteger)numberOfDigitsEntered;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* After the transaction has finished, indicates whether the card
|
|
205
|
+
* was removed.
|
|
206
|
+
* This option is only supported by certain terminal firmware versions.
|
|
207
|
+
* Possible values of the `status` are:
|
|
208
|
+
*
|
|
209
|
+
* - `ADYCardStatusRemoved`: the card has been removed from the terminal.
|
|
210
|
+
* - `ADYCardStatusNextTransaction`: a subsequent transaction was started
|
|
211
|
+
* on the terminal before the card was removed.
|
|
212
|
+
* - `ADYCardStatusError`: an error occurred communicating with the terminal
|
|
213
|
+
* before the card was removed.
|
|
214
|
+
* - `ADYCardStatusNotSupported`: card removal notification is not supported
|
|
215
|
+
* by this version of the terminal firmware.
|
|
216
|
+
*/
|
|
217
|
+
-(void)transactionCardRemoved:(ADYCardStatus)status;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* If the connection with the payment device is lost during a transaction,
|
|
221
|
+
* it is no longer possible for us to get the status or send commands. The
|
|
222
|
+
* delegate will be notified of this situation through the
|
|
223
|
+
* `transactionConnectionLost` and `transactionConnectionRestored` methods.
|
|
224
|
+
* The `TransactionProcessor` will wait for the device to reconnect and try
|
|
225
|
+
* to resume the transaction until a timeout occurs.
|
|
226
|
+
*
|
|
227
|
+
* While the connection is lost, no commands will be delivered to the device
|
|
228
|
+
* and no state changes can take place. The delegate is therefor expected to
|
|
229
|
+
* respect this state and block user interaction that would trigger status
|
|
230
|
+
* changes for the transaction; example: submitting a signature.
|
|
231
|
+
*
|
|
232
|
+
* Cancelling the transaction will be instant while the connection is lost;
|
|
233
|
+
* the device won't be updated and the transaction will simply be discarded.
|
|
234
|
+
* Although the lib/iOS application can continue at this point, the device
|
|
235
|
+
* may wait for a timeout on their side. Until that point, a new transaction
|
|
236
|
+
* can not be started.
|
|
237
|
+
*/
|
|
238
|
+
-(void)transactionConnectionLost;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* If the connection with the payment device is lost during a transaction,
|
|
242
|
+
* it is no longer possible for us to get the status or send commands. The
|
|
243
|
+
* delegate will be notified of this situation through the
|
|
244
|
+
* `transactionConnectionLost` and `transactionConnectionRestored` methods.
|
|
245
|
+
* The `TransactionProcessor` will wait for the device to reconnect and try
|
|
246
|
+
* to resume the transaction until a timeout occurs.
|
|
247
|
+
*
|
|
248
|
+
* While the connection is lost, no commands will be delivered to the device
|
|
249
|
+
* and no state changes can take place. The delegate is therefor expected to
|
|
250
|
+
* respect this state and block user interaction that would trigger status
|
|
251
|
+
* changes for the transaction; example: submitting a signature.
|
|
252
|
+
*
|
|
253
|
+
* Cancelling the transaction will be instant while the connection is lost;
|
|
254
|
+
* the device won't be updated and the transaction will simply be discarded.
|
|
255
|
+
* Although the lib/iOS application can continue at this point, the device
|
|
256
|
+
* may wait for a timeout on their side. Until that point, a new transaction
|
|
257
|
+
* can not be started.
|
|
258
|
+
*/
|
|
259
|
+
-(void)transactionConnectionRestored;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Called when the state of the transaction changes.
|
|
263
|
+
*
|
|
264
|
+
* This method can be used to reflect the progress in the user-interface.
|
|
265
|
+
*
|
|
266
|
+
* @param state the new transaction-processing state.
|
|
267
|
+
*/
|
|
268
|
+
-(void)transactionStateChanged:(ADYTenderState)state;
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* This method is called when the transaction starts
|
|
273
|
+
*
|
|
274
|
+
* @param transaction a data-object containing transaction-details.
|
|
275
|
+
*/
|
|
276
|
+
-(void)transactionStarted:(ADYTransactionData *)transaction;
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
@end
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ADYTransactionRequest.h
|
|
3
|
+
// AdyenPOSLib
|
|
4
|
+
//
|
|
5
|
+
// Created by Jeroen Koops on 4/12/13.
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "ADYTransactionProcessorDelegate.h"
|
|
11
|
+
|
|
12
|
+
@class ADYTransactionProcessor;
|
|
13
|
+
@class CLLocation;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Request for a payment transaction.
|
|
17
|
+
|
|
18
|
+
Obtain a request by calling `createTransactionRequestWithReference:` on the `ADYDevice` instance of choice. Then,
|
|
19
|
+
fill in all required properties. Finally, start the transaction by calling startWithDelegate:. The
|
|
20
|
+
delegate will be informed of the transaction's progress, and when the transaction is complete.
|
|
21
|
+
Finally, you can call `requestCancel` to request cancellation of the running transaction.
|
|
22
|
+
|
|
23
|
+
As of version 1.9, no location needs to be set on the transaction using `ADYTransactionOptionLocationKey`;
|
|
24
|
+
it is fetched by the Adyen Framework itself. It is however required for the user to have Location
|
|
25
|
+
Services enabled. If this isn't the case, the transaction will not start.
|
|
26
|
+
Adyen is legally obliged to register the location, in order to be able to prove that transactions
|
|
27
|
+
are only performed in the certified area.
|
|
28
|
+
|
|
29
|
+
It is possible to pass optional parameters to the transaction via the *options* dictionary.
|
|
30
|
+
Use the following pre-defined constants as keys on your dictionary:
|
|
31
|
+
|
|
32
|
+
- `ADYTransactionOptionReferenceKey` : the transaction reference as a NSString instance.
|
|
33
|
+
- `ADYTransactionOptionLogoKey` : the merchant logo for the transaction as a UIImage instance.
|
|
34
|
+
- `ADYTransactionOptionCustomReceiptLinesKey` : the additional receipt lines to be added to the receipt.
|
|
35
|
+
- `ADYTransactionOptionCustomReceiptHandler` : force the receipt printing will be handled by app.
|
|
36
|
+
- `ADYTransactionOptionShopperReferenceKey` : the shopper reference for the transaction as a NSString instance.
|
|
37
|
+
- `ADYTransactionOptionShopperEmailKey` : the shopper email for the transaction as a NSString instance.
|
|
38
|
+
- `ADYTransactionOptionShopperRecurringContractKey` : the recurring contract for the transaction. Provide none or one of the following: ADYTransactionOptionShopperRecurringContractOneClick, ADYTransactionOptionShopperRecurringContractRecurring, ADYTransactionOptionShopperRecurringContractBoth
|
|
39
|
+
- `ADYTransactionOptionAdditionalDataKey` : presence of this key in transaction options will trigger an additional interaction step between POS and PED. In this step several data elements, based on the card, will be offered to the POS. This allows for amount adjustments (discounts), shopper recognition (within your Company). This option is also a required 'configuration' for Dynamic Currency Conversion (DCC).
|
|
40
|
+
- `ADYTransactionOptionAskGratuity`: presence of this key in transaction options (value is irrelevant) will cause the payment device to ask for a gratuity.
|
|
41
|
+
- `ADYTransactionOptionManualKeyedEntry`: presence of this key in transaction options (value is irrelevant) will cause the payment device to use manual keyed entry mode, if supported.
|
|
42
|
+
- `ADYTransactionOptionAllowShopperAIDSelection`: presence of this key in transaction options (value is irrelevant) will allow shopper to select AID on terminal, if supported.
|
|
43
|
+
- `ADYTransactionOptionMOTO`: presence of this key in transaction options (value is irrelevant) will trigger MOTO transaction on the terminal.
|
|
44
|
+
|
|
45
|
+
If one wants to use the transaction details to be able to perform at a later stage a recurring
|
|
46
|
+
transaction, using the transaction details of the current POS transaction, one needs to populate
|
|
47
|
+
the following fields:
|
|
48
|
+
- ADYTransactionOptionShopperReferenceKey
|
|
49
|
+
- ADYTransactionOptionShopperEmailKey
|
|
50
|
+
- ADYTransactionOptionShopperRecurringContractKey
|
|
51
|
+
(see the Adyen Recurring Manual for details)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
*/
|
|
55
|
+
@interface ADYTransactionRequest : NSObject
|
|
56
|
+
|
|
57
|
+
/** A merchant-supplied reference for the transaction */
|
|
58
|
+
@property (nonatomic, strong) NSString *reference;
|
|
59
|
+
|
|
60
|
+
/** The type of the transaction, see `ADYTransactionType` for details. Defaults to ADYTransactionTypeGoodsServices. */
|
|
61
|
+
@property (nonatomic, assign) ADYTransactionType transactionType;
|
|
62
|
+
|
|
63
|
+
/** The currency to use on the transaction. */
|
|
64
|
+
@property (nonatomic, strong) NSString *currency;
|
|
65
|
+
|
|
66
|
+
/** The amount to process on the transaction in minor units (cents). */
|
|
67
|
+
@property (nonatomic, strong) NSNumber *amount;
|
|
68
|
+
|
|
69
|
+
/** Gratuity amount in cents, or `nil` if no gratuity desired. */
|
|
70
|
+
@property (nonatomic, strong) NSNumber *gratuity;
|
|
71
|
+
|
|
72
|
+
/** Locale of the transaction, or `nil` to use default locale. */
|
|
73
|
+
@property (nonatomic, strong) NSLocale *locale;
|
|
74
|
+
|
|
75
|
+
/** Store identifier. */
|
|
76
|
+
@property (nonatomic, strong) NSString *store;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
Optional property to set staff name who starts a transaction. If you support staff management within your app,
|
|
80
|
+
use this property to differentiate transactions started by different staff members.
|
|
81
|
+
*/
|
|
82
|
+
@property (nonatomic, strong) NSString *cashregisterAgent;
|
|
83
|
+
|
|
84
|
+
/** Optional dictionary with transaction options. Only NSString typed values are allowed */
|
|
85
|
+
@property (nonatomic, strong) NSDictionary *options;
|
|
86
|
+
|
|
87
|
+
/** Optional dictionary to specify RAW additionalData keys and values to be passed to tender */
|
|
88
|
+
@property (nonatomic, strong) NSMutableDictionary *additionalData;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Starts the transaction.
|
|
92
|
+
*
|
|
93
|
+
* @param delegate this delegate will be informed of the transaction's progress and completion.
|
|
94
|
+
* @param error if the transaction cant be started, the error will be set.
|
|
95
|
+
*/
|
|
96
|
+
- (BOOL)startWithDelegate:(id<ADYTransactionProcessorDelegate>)delegate error:(NSError **)error;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Requests for the transaction to be cancelled.
|
|
100
|
+
* This is only a _request_ for cancellation. It is up to the payment device to honour this request
|
|
101
|
+
* or not. This method returns immediately, the delegate given in the call to
|
|
102
|
+
* startWithDelegate: will continue to receive updates on the transaction's status, and completion. If
|
|
103
|
+
* cancellation is successful, the status of the completed transaction will be `FinalStateCANCELLED`,
|
|
104
|
+
* but if the transaction could not be cancelled, it will be one of the other final states.
|
|
105
|
+
*/
|
|
106
|
+
- (void)requestCancel;
|
|
107
|
+
|
|
108
|
+
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ADYUIKit.h
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Taras Kalapun on 1/7/16.
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "ADYConstants.h"
|
|
11
|
+
|
|
12
|
+
#if PLATFORM_IOS
|
|
13
|
+
#import <UIKit/UIKit.h>
|
|
14
|
+
#define ADYImageClassName UIImage
|
|
15
|
+
#define ADYColorClassName UIColor
|
|
16
|
+
#elif PLATFORM_OSX
|
|
17
|
+
#define ADYImageClassName NSImage
|
|
18
|
+
#define ADYColorClassName NSColor
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
@interface ADYUIKit : NSObject
|
|
22
|
+
|
|
23
|
+
+ (NSData *)pngRepresentationFromImage:(ADYImageClassName *)image;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param maxSize maximum resulting data-size, in kilobytes.
|
|
27
|
+
*/
|
|
28
|
+
+ (NSData *)signatureDataFromImage:(ADYImageClassName *)image withMaxSize:(NSUInteger)maxSize;
|
|
29
|
+
|
|
30
|
+
@end
|