Skip to content

Commit

Permalink
Release 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-clover committed Nov 2, 2018
1 parent efd48fe commit a293fb3
Show file tree
Hide file tree
Showing 215 changed files with 1,596 additions and 23,142 deletions.
9 changes: 6 additions & 3 deletions Example/.jazzy.yaml → .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sdk: iphoneos
theme: fullwidth
podspec: ../CloverConnector.podspec
podspec: CloverConnector.podspec
module: CloverConnector
theme: apple
output: ../1.4.3/docs
output: 3.0.0/docs
clean: true
github-url: https://github.com/clover/remote-pay-ios
swift-version: 4.1
swift-version: 4.2
copyright: 'Copyright © 2018 Clover Network, Inc. All rights reserved.'
custom_categories:
- name: API
Expand Down Expand Up @@ -35,6 +35,8 @@ custom_categories:
- RefundPaymentResponse
- VoidPaymentRequest
- VoidPaymentResponse
- VoidPaymentRefund
- VoidPaymentRefundResponse
- RetreivePendingPaymentRequest
- RetrievePendingPaymentResponse
- RetrievePaymentRequest
Expand Down Expand Up @@ -65,6 +67,7 @@ custom_categories:
- ShowPaymentReceiptOptions
- RetrieveDeviceStatusRequest
- RetrieveDeviceStatusResponse
- SendDebugLog
- name: Custom Activities
children:
- CustomActivityRequest
Expand Down
55 changes: 36 additions & 19 deletions CloverConnector.podspec
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@

Pod::Spec.new do |s|
s.name = 'CloverConnector'
s.version = '1.4.4'
s.version = '3.0.0'
s.summary = 'Provides an api for communicating with a Clover Mini as a customer facing payment device.'

s.description = <<-DESC
CloverConnector provides an interface to communicate with a tethered Clover device to enable integration with Clover's customer facing payment device capabilities.
ICloverConnector
- *addCloverConnectorListener* - adds a Clover Connector listener
- *removeCloverConnectorListener* - removes a Clover Connector listener
- *initializeConnection* - initializes the connection and starts communication with the Clover device
- *sale* - method to collect a final sale payment
- *auth* - method to collect a payment that can be tip adjusted
- *preAuth* - method to collect a payment that will not be eligible to be final until a capturePreAuth is processed on this payment
- *tipAdjustAuth* - method to adjust the tip amount on a payment collected from an auth, or a payment that has been captured via capturePreAuth
- *capturePreAuth* - method to make a preAuth payment eligible to be tip adjusted or finalized
- *tipAdjustAuth* - method to adjust the tip amount on a payment collected from an auth, or a payment that has been captured via capturePreAuth
- *voidPayment* - queues a request to void a payment
- *refundPayment* - refund a payment or partially refund a final payment
- *voidPaymentRefund* - void a payment refund (Canada flows only)
- *manualRefund* - provide a manual refund a.k.a. naked credit
- *cancel* - sends a cancel command to exit activities that support the cancel option
- *closeout* - posts a closeout request to the server to closeout open payments
- *displayPaymentReceiptOptions* - display the receipt selection screen
- *acceptSignature* - method to accept a signature when the Clover device sends a `verifySignatureRequest`
- *rejectSignature* - method to reject a signature when the Clover device sends a `verifySignatureRequest`
- *vaultCard* - reads a card and retrieves a multi-pay token
- *print* - print the contents of the passed-in `PrintRequest` object
- *printText* - prints simple text *deprecated*
- *printImage* - prints the passed in image *deprecated*
- *printImageFromURL* - print an image references in the url *deprecated*
- *retrievePrinters* - request to retreive available printers
- *retrievePrintJobStatus* - request the status of a given print job
- *openCashDrawer* - opens a cash drawer attached to the Clover device with a passed in `OpenCashDrawerRequest` object
- *showMessage* - displays a simple message on the Clover device
- *sendDebugLog* - sends a message to the Clover device to upload its debug logs to the Clover servers
- *showWelcomeScreen* - displays the welcome screen on the Clover device
- *showThankYouScreen* - displays the thank you screen on the Clover device
- *showDisplayOrder* - displays the DisplayOrder passed in on the Clover device
Expand All @@ -40,34 +41,50 @@ ICloverConnector
- *acceptPayment* - method to accept a payment when the Clover device sends a `confirmPaymentRequest`
- *rejectPayment* - method to reject a payment when the Clover device sends a `confirmPaymentRequest`
- *retrievePendingPayments* - requests the device send any payments taken offline that haven't been processed by the server
- *dispose* - cleans up the CloverConnector and disconnects from the Clover Mini
- *retrievePayment* - query the device for the status of a payment on the device by its external id, callback on on
- *retrieveDeviceStatus* - query the status of the device, callback on onRetrieveDeviceStatus
- *dispose* - cleans up the CloverConnector and disconnects from the Clover device
- *startCustomActivity* - send a request to start a custom activity on the Clover device
- *sendMessageToActivity* - send a message to a custom activity running on the Clover device
- *retrieveDeviceStatus* - query the status of the device, callback on onRetrieveDeviceStatus
- *retrievePayment* - query the device for the status of a payment on the device by its external id, callback on on
- *registerForCustomerProvidedData* - registers for callbacks for customer provided data via the Loyalty API
- *setCustomerInfo* - provides customer data back to the Cover device. Loyalty API
ICloverConnectorListener
- *onSaleResponse* - called at the completion of a sale request with either a payment or a cancel state
- *onAuthResponse* - called at the completion of an auth request with either a payment or a cancel state
- *onPreAuthResponse* - called at the completion of a preAuth request with either a payment or a cancel state
- *onTipAdjustAuthResponse* - called at the completion ofo a tipAdjustAuth request
- *onCapturePreAuthResponse* - called at the completion of a capturePreAuth request
- *onVoidPaymentResponse* - called at the completion of a void payment request
- *onRefundPaymentResponse* - called at the completion of a refund payment request
- *onVoidPaymentRefundResponse* - called at the completion of a voidPaymentRefund request
- *onManualRefundResponse* - called at the completion of a manual refund request
- *onVoidPaymentResponse* - called at the completion of a void payment request
- *onCloseoutResponse* - called at the completion of a closeout request
- *confirmPaymentRequest* - called if the Clover device needs confirmation of a payment (duplicate verification, offline verification)
- *verifySignatureRequest* - called if the Clover device needs acceptance of a signature
- *onVerifySignatureRequest* - called if the Clover device needs acceptance of a signature
- *onVaultCardResponse* - called in response to a vaultCard request
- *onDeviceActivityStart* - called when the Clover device transitions to a new screen or activity.
- *onDeviceActivityEnd* - called when the Clover device transitions awa from a screen or activity.
- *onDeviceError* - called when an error occurs while trying to send messages to the Clover device
- *onDeviceConnected* - called when the Clover device is initially connected, but not ready to communicate
- *onDeviceReady* - called when the Clover device is ready to communicate and respond to requests
- *onDeviceDisconnected* - called when the Clover device is disconnected from the CloverConnector or not responding
- *onConfirmPaymentRequest* - called if the Clover device needs confirmation of a payment (duplicate verification, offline verification)
- *onTipAdded* - called when a customer selects a tip amount on the Clover device's screen
- *onPrintManualRefundReceipt* - called when a user requests a paper receipt for a Manual Refund
- *onPrintManualRefundDeclineReceipt* - called when a user requests a paper receipt for a declined Manual Refund
- *onPrintPaymentReceipt* - called when a user requests a paper receipt for a Payment
- *onPrintPaymentDeclineReceipt* - called when a user requests a paper receipt for a declined Payment
- *onPrintPaymentMerchantCopyReceipt* - called when a user requests a merchant copy of a Payment receipt
- *onPrintRefundPaymentReceipt* - called when a user requests a paper receipt for a Payment Refund
- *onRetrievePrintersResponse* - called at the completion of a retrievePrinters request
- *onPrintJobStatusResponse* - called at the completion of a retrievePrintJobStatus
- *onRetrievePendingPaymentsResponse* - called in response to a retrieve pending payments request. Returns a list of payments not yet submitted to the server
- *onReadCardDataResponse* - called at the completion of a read card data request. Data may come back encrypted depending on the card type and bin
- *onCustomActivityResponse* - called at the completion of a custom activity
- *onResetDeviceResponse* - called at the completion of a resetDevice request
- *onCustomerProvidedDataEvent* - called in response to customer provided data via the Loyalty API. Call registerForCustomerProvided data to request that this message be sent.
- *onMessageFromActivity* - called if the custom activity wants to send a message back to the POS, prior to finishing
- *onRetrievePaymentResponse* - called at the completion of a retrievePayment request
- *onRetrieveDeviceStatusResponse* - called at the completion of a retrieveDeviceStatus request
- *onRetrievePrintersResponse* - called at the completion of a retrievePrinters request
- *onPrintJobStatusResponse* - called at the completion of a retrievePrintJobStatus
DESC
Expand All @@ -77,7 +94,7 @@ DESC
s.author = { 'Clover' => '[email protected]' }
s.source = { :git => 'https://github.com/clover/remote-pay-ios.git', :tag => s.version.to_s }

s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.1' }
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }

s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
Expand All @@ -89,6 +106,6 @@ DESC
# s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'Foundation'
s.dependency 'ObjectMapper', '3.3.0'
s.dependency 'Starscream', '2.1.1'
s.dependency 'SwiftyJSON', '3.1.4'
s.dependency 'Starscream', '3.0.5'
s.dependency 'SwiftyJSON', '4.1.0'
end
4 changes: 2 additions & 2 deletions CloverConnector/Classes/ListWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ListWrapper<T:Mappable> : Mappable {
}
}
} else {
debugPrint("Expected an array, but got something else: " + String(describing: items));
CCLog.d("Expected an array, but got something else: " + String(describing: items));
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ public class StringListWrapper {
}

} else {
debugPrint("Expected an array, but got something else: " + String(describing: items));
CCLog.d("Expected an array, but got something else: " + String(describing: items));
}
}

Expand Down
53 changes: 0 additions & 53 deletions CloverConnector/Classes/Models/Extensions/Apps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ extension CLVModels {
public var metereds: [CLVModels.Apps.AppMetered]?
/// USB devices with which this app will communicate
public var usbDevices: [CLVModels.Apps.AppUsbDevice]?
/// DEPRECATED: This is now derived directly from billingStartTime (if future -> in trial; if past -> not in trial). So it is now unnecessary. Please update client code to not use it.
public var isMerchantInTrial: Bool?
/// The merchant's current subscription for this app
public var currentSubscription: CLVModels.Apps.AppSubscription?
/// The app's web hook
Expand Down Expand Up @@ -298,7 +296,6 @@ extension CLVModels {
aCoder.encode(availableMetereds, forKey: "availableMetereds")
aCoder.encode(metereds, forKey: "metereds")
aCoder.encode(usbDevices, forKey: "usbDevices")
aCoder.encode(isMerchantInTrial, forKey: "isMerchantInTrial")
aCoder.encode(currentSubscription, forKey: "currentSubscription")
aCoder.encode(webhook, forKey: "webhook")
aCoder.encode(androidVersions, forKey: "androidVersions")
Expand Down Expand Up @@ -373,7 +370,6 @@ extension CLVModels {
availableMetereds = aDecoder.decodeObject(forKey: "availableMetereds") as? [CLVModels.Apps.AppMetered]
metereds = aDecoder.decodeObject(forKey: "metereds") as? [CLVModels.Apps.AppMetered]
usbDevices = aDecoder.decodeObject(forKey: "usbDevices") as? [CLVModels.Apps.AppUsbDevice]
isMerchantInTrial = aDecoder.decodeObject(forKey: "isMerchantInTrial") as? Bool
currentSubscription = aDecoder.decodeObject(forKey: "currentSubscription") as? CLVModels.Apps.AppSubscription
webhook = aDecoder.decodeObject(forKey: "webhook") as? CLVModels.Apps.WebHook
androidVersions = aDecoder.decodeObject(forKey: "androidVersions") as? [CLVModels.Apps.AndroidVersion]
Expand Down Expand Up @@ -448,7 +444,6 @@ extension CLVModels {
availableMetereds <- map["availableMetereds.elements"]
metereds <- map["metereds.elements"]
usbDevices <- map["usbDevices.elements"]
isMerchantInTrial <- map["isMerchantInTrial"]
currentSubscription <- map["currentSubscription"]
webhook <- map["webhook"]
androidVersions <- map["androidVersions.elements"]
Expand Down Expand Up @@ -520,28 +515,20 @@ extension CLVModels {
public var id: String?
/// The name of the bundle
public var name: String?
/// DEPRECATED: Instead use per country pricing in bundleCountries
public var price: Int?
/// DEPRECATED: Instead use per country pricing in bundleCountries
public var pricePerDevice: Int?
public var includedApps: [CLVModels.Apps.App]?
/// Bundle country options for this app bundle
public var bundleCountries: [CLVModels.Apps.AppBundleCountry]?

public func encode(with aCoder: NSCoder) {
aCoder.encode(id, forKey: "id")
aCoder.encode(name, forKey: "name")
aCoder.encode(price, forKey: "price")
aCoder.encode(pricePerDevice, forKey: "pricePerDevice")
aCoder.encode(includedApps, forKey: "includedApps")
aCoder.encode(bundleCountries, forKey: "bundleCountries")
}

required public init(coder aDecoder: NSCoder) {
id = aDecoder.decodeObject(forKey: "id") as? String
name = aDecoder.decodeObject(forKey: "name") as? String
price = aDecoder.decodeObject(forKey: "price") as? Int
pricePerDevice = aDecoder.decodeObject(forKey: "pricePerDevice") as? Int
includedApps = aDecoder.decodeObject(forKey: "includedApps") as? [CLVModels.Apps.App]
bundleCountries = aDecoder.decodeObject(forKey: "bundleCountries") as? [CLVModels.Apps.AppBundleCountry]
}
Expand All @@ -555,8 +542,6 @@ extension CLVModels {
public func mapping(map:Map) {
id <- map["id"]
name <- map["name"]
price <- map["price"]
pricePerDevice <- map["pricePerDevice"]
includedApps <- map["includedApps.elements"]
bundleCountries <- map["bundleCountries.elements"]
}
Expand Down Expand Up @@ -650,12 +635,6 @@ extension CLVModels {
@objc(_TtCCC15CloverConnector9CLVModels4Apps10AppMetered)public class AppMetered: NSObject, NSCoding, Mappable {
/// Unique identifier
public var id: String?
/// DEPRECATED: App metered amount. Instead use per country pricing in meteredCountries
public var amount: Int?
/// DEPRECATED: App metered action. Instead use per country pricing in meteredCountries
public var action: String?
/// DEPRECATED: App metered active status. Instead use per country pricing in meteredCountries
public var active: Bool?
/// Metered country options for this app metered
public var meteredCountries: [CLVModels.Apps.AppMeteredCountry]?
/// Reference to the app this metered belongs to
Expand All @@ -665,19 +644,13 @@ extension CLVModels {

public func encode(with aCoder: NSCoder) {
aCoder.encode(id, forKey: "id")
aCoder.encode(amount, forKey: "amount")
aCoder.encode(action, forKey: "action")
aCoder.encode(active, forKey: "active")
aCoder.encode(meteredCountries, forKey: "meteredCountries")
aCoder.encode(app, forKey: "app")
aCoder.encode(label, forKey: "label")
}

required public init(coder aDecoder: NSCoder) {
id = aDecoder.decodeObject(forKey: "id") as? String
amount = aDecoder.decodeObject(forKey: "amount") as? Int
action = aDecoder.decodeObject(forKey: "action") as? String
active = aDecoder.decodeObject(forKey: "active") as? Bool
meteredCountries = aDecoder.decodeObject(forKey: "meteredCountries") as? [CLVModels.Apps.AppMeteredCountry]
app = aDecoder.decodeObject(forKey: "app") as? CLVModels.Apps.App
label = aDecoder.decodeObject(forKey: "label") as? String
Expand All @@ -691,9 +664,6 @@ extension CLVModels {

public func mapping(map:Map) {
id <- map["id"]
amount <- map["amount"]
action <- map["action"]
active <- map["active"]
meteredCountries <- map["meteredCountries.elements"]
app <- map["app"]
label <- map["label"]
Expand Down Expand Up @@ -795,14 +765,6 @@ extension CLVModels {
@objc(_TtCCC15CloverConnector9CLVModels4Apps15AppSubscription)public class AppSubscription: NSObject, NSCoding, Mappable {
/// Unique identifier
public var id: String?
/// DEPRECATED: App subscription name. Per country pricing in subscriptionCountries.
public var name: String?
/// DEPRECATED: The cost of the subscription. Per country pricing in subscriptionCountries.
public var amount: Int?
/// DEPRECATED: App subscription name. Per country pricing in subscriptionCountries.
public var description_: String?
/// DEPRECATED: App subscription active status. Per country pricing in subscriptionCountries.
public var active: Bool?
/// Subscription country options for this app subscription
public var subscriptionCountries: [CLVModels.Apps.AppSubscriptionCountry]?
/// Reference to app this subscription belongs to
Expand All @@ -812,22 +774,12 @@ extension CLVModels {

public func encode(with aCoder: NSCoder) {
aCoder.encode(id, forKey: "id")
aCoder.encode(name, forKey: "name")
aCoder.encode(amount, forKey: "amount")
aCoder.encode(description_, forKey: "description_")
aCoder.encode(active, forKey: "active")
aCoder.encode(subscriptionCountries, forKey: "subscriptionCountries")
aCoder.encode(app, forKey: "app")
aCoder.encode(label, forKey: "label")
}

required public init(coder aDecoder: NSCoder) {
id = aDecoder.decodeObject(forKey: "id") as? String
name = aDecoder.decodeObject(forKey: "name") as? String
amount = aDecoder.decodeObject(forKey: "amount") as? Int
description_ = aDecoder.decodeObject(forKey: "description_") as? String
active = aDecoder.decodeObject(forKey: "active") as? Bool
subscriptionCountries = aDecoder.decodeObject(forKey: "subscriptionCountries") as? [CLVModels.Apps.AppSubscriptionCountry]
app = aDecoder.decodeObject(forKey: "app") as? CLVModels.Apps.App
label = aDecoder.decodeObject(forKey: "label") as? String
}
Expand All @@ -840,11 +792,6 @@ extension CLVModels {

public func mapping(map:Map) {
id <- map["id"]
name <- map["name"]
amount <- map["amount"]
description_ <- map["description"]
active <- map["active"]
subscriptionCountries <- map["subscriptionCountries.elements"]
app <- map["app"]
label <- map["label"]
}
Expand Down
Loading

0 comments on commit a293fb3

Please sign in to comment.