Skip to content

Commit bf6eba6

Browse files
authored
Merge pull request #37 from cashapp/release-1.0.0
Release 1.0.0
2 parents c96d4d1 + b2fcbc6 commit bf6eba6

14 files changed

Lines changed: 68 additions & 21 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
pod-lint:
1111
name: Pod Lint
12-
runs-on: macos-13
12+
runs-on: macos-latest
1313
steps:
1414
- name: Checkout Repo
1515
uses: actions/checkout@v4
@@ -30,7 +30,5 @@ jobs:
3030
steps:
3131
- name: Checkout Repo
3232
uses: actions/checkout@v4
33-
- name: Select Xcode Version (15.1.0)
34-
run: sudo xcode-select --switch /Applications/Xcode_15.1.0.app/Contents/Developer
3533
- name: Build
3634
run: xcodebuild build -scheme PayKit -sdk "`xcrun --sdk iphonesimulator --show-sdk-path`"

CashAppPayKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CashAppPayKit'
3-
s.version = '0.6.3'
3+
s.version = '1.0.0'
44
s.summary = 'PayKit iOS SDK'
55
s.homepage = 'https://github.com/cashapp/cash-app-pay-ios-sdk'
66
s.license = 'Apache License, Version 2.0'

CashAppPayKitUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CashAppPayKitUI'
3-
s.version = "0.6.3"
3+
s.version = "1.0.0"
44
s.summary = 'UI components for the PayKit iOS SDK'
55
s.homepage = 'https://github.com/cashapp/cash-app-pay-ios-sdk'
66
s.license = 'Apache License, Version 2.0'

Demo/PayKitDemo/PayKitViewController.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class PayKitViewController: UIViewController {
121121
updateRequestButton.isEnabled = (pendingRequest != nil)
122122
authorizeRequestButton.isEnabled = (pendingRequest != nil)
123123
amountTextField.isEnabled = (paymentType == .ONE_TIME_PAYMENT)
124-
accountReferenceIDTextField.isEnabled = (paymentType == .ON_FILE_PAYMENT)
124+
accountReferenceIDTextField.isEnabled = (paymentType != .ONE_TIME_PAYMENT)
125125
endpointLabel.text = environment.title
126126
}
127127

@@ -176,6 +176,8 @@ extension PayKitViewController {
176176
action = .oneTimePayment(scopeID: brandID, money: amount)
177177
case .ON_FILE_PAYMENT:
178178
action = .onFilePayment(scopeID: brandID, accountReferenceID: accountReferenceIDTextField.text)
179+
case .ON_FILE_PAYOUT:
180+
action = .onFilePayout(scopeID: brandID, accountReferenceID: accountReferenceIDTextField.text)
179181
}
180182

181183
return CreateCustomerRequestParams(
@@ -193,6 +195,8 @@ extension PayKitViewController {
193195
action = .oneTimePayment(scopeID: brandID, money: amount)
194196
case .ON_FILE_PAYMENT:
195197
action = .onFilePayment(scopeID: brandID, accountReferenceID: accountReferenceIDTextField.text)
198+
case .ON_FILE_PAYOUT:
199+
action = .onFilePayout(scopeID: brandID, accountReferenceID: accountReferenceIDTextField.text)
196200
}
197201

198202
return UpdateCustomerRequestParams(
@@ -299,7 +303,11 @@ extension PayKitViewController {
299303
handler: handlePaymentTypeControlChanged
300304
),
301305
UIAction(
302-
title: "On File",
306+
title: "On File Payment",
307+
handler: handlePaymentTypeControlChanged
308+
),
309+
UIAction(
310+
title: "On File Payout",
303311
handler: handlePaymentTypeControlChanged
304312
),
305313
])

RELEASE-NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## Paykit 1.0.0 Release Notes
2+
3+
Pay Kit 1.0.0 supports iOS and requires Xcode 11 or later. The minimum supported Base SDK is 12.0.
4+
5+
Pay Kit 1.0.0 includes the following new features and enhancements.
6+
7+
- **PayKit Update**
8+
9+
Addition of a new CustomerRequest payment action, payment type of `ON_FILE_PAYOUT`. This payment type enables merchants to payout customers.
10+
111
## Paykit 0.6.3 Release Notes
212

313
Pay Kit 0.6.3 supports iOS and requires Xcode 11 or later. The minimum supported Base SDK is 12.0.

Sources/PayKit/CashAppPay.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import UIKit
1919

2020
public class CashAppPay {
2121

22-
public static let version = "0.6.3"
22+
public static let version = "1.0.0"
2323

2424
public static let RedirectNotification: Notification.Name = Notification.Name("CashAppPayRedirect")
2525

Sources/PayKit/CustomerRequest.swift

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ public struct PaymentAction: Equatable {
208208
accountReferenceID: accountReferenceID
209209
)
210210
}
211+
212+
public static func onFilePayout(scopeID: String, accountReferenceID: String?) -> PaymentAction {
213+
return PaymentAction(
214+
type: .ON_FILE_PAYOUT,
215+
scopeID: scopeID,
216+
money: nil,
217+
accountReferenceID: accountReferenceID
218+
)
219+
}
220+
211221
enum CodingKeys: String, CodingKey {
212222
case type, scopeID = "scopeId", amount, currency, accountReferenceID = "accountReferenceId"
213223
}
@@ -246,7 +256,7 @@ extension PaymentAction: Encodable {
246256
try container.encodeIfPresent(money?.currency, forKey: .currency)
247257
}
248258

249-
case .ON_FILE_PAYMENT:
259+
case .ON_FILE_PAYMENT, .ON_FILE_PAYOUT:
250260
if clearing {
251261
try container.encode(accountReferenceID, forKey: .accountReferenceID)
252262
} else {
@@ -259,6 +269,7 @@ extension PaymentAction: Encodable {
259269
public enum PaymentType: String, Codable, CaseIterable, Equatable {
260270
case ONE_TIME_PAYMENT
261271
case ON_FILE_PAYMENT
272+
case ON_FILE_PAYOUT
262273
}
263274

264275
// MARK: - Primitives
@@ -345,7 +356,13 @@ extension PaymentAction: CustomDebugStringConvertible {
345356
return """
346357
\n ONE_TIME_PAYMENT:
347358
Scope ID: \(scopeID)
348-
Account Reference ID: \(String(describing: money))
359+
Account Reference ID: \(String(describing: accountReferenceID))
360+
"""
361+
case .ON_FILE_PAYOUT:
362+
return """
363+
\n ONE_FILE_PAYOUT:
364+
Scope ID: \(scopeID)
365+
Account Reference ID: \(String(describing: accountReferenceID))
349366
"""
350367
}
351368
}

Sources/PayKit/ObjcWrapper/CustomerRequest+ObjC.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ import Foundation
522522
return CAPPaymentAction(paymentAction: paymentAction)
523523
}
524524

525+
public static func onFilePayout(scopeID: String, accountReferenceID: String?) -> CAPPaymentAction {
526+
let paymentAction = PaymentAction.onFilePayout(scopeID: scopeID, accountReferenceID: accountReferenceID)
527+
return CAPPaymentAction(paymentAction: paymentAction)
528+
}
529+
525530
// MARK: - Equatable
526531

527532
public override func isEqual(_ object: Any?) -> Bool {

Sources/PayKit/ObjcWrapper/Errors+ObjC.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Foundation
2020

2121
public let CAPErrorDomain = "com.squareup.cashapppay.error"
2222

23-
@objcMembers public final class CAPApiError: NSError {
23+
@objcMembers public final class CAPApiError: NSError, @unchecked Sendable {
2424

2525
// MARK: - Properties
2626

@@ -90,7 +90,7 @@ extension APIError.ErrorCode {
9090

9191
// MARK: - IntegrationError
9292

93-
@objcMembers public final class CAPIntegrationError: NSError {
93+
@objcMembers public final class CAPIntegrationError: NSError, @unchecked Sendable {
9494

9595
// MARK: - Properties
9696

@@ -232,7 +232,7 @@ extension IntegrationError.ErrorCode {
232232

233233
// MARK: - UnexpectedError
234234

235-
@objcMembers public final class CAPUnexpectedError: NSError {
235+
@objcMembers public final class CAPUnexpectedError: NSError, @unchecked Sendable {
236236

237237
// MARK: - Properties
238238

@@ -271,9 +271,9 @@ extension IntegrationError.ErrorCode {
271271

272272
// MARK: - Network Error
273273

274-
@objc public final class CAPNetworkErrorNoResponse: NSError {}
274+
@objc public final class CAPNetworkErrorNoResponse: NSError, @unchecked Sendable {}
275275

276-
@objc public final class CAPNetworkErrorNilData: NSError {
276+
@objc public final class CAPNetworkErrorNilData: NSError, @unchecked Sendable {
277277
@objc public var response: HTTPURLResponse
278278

279279
init(response: HTTPURLResponse) {
@@ -287,7 +287,7 @@ extension IntegrationError.ErrorCode {
287287
}
288288
}
289289

290-
@objc public final class CAPNetworkErrorInvalidJSON: NSError {
290+
@objc public final class CAPNetworkErrorInvalidJSON: NSError, @unchecked Sendable {
291291
@objc public var data: Data
292292

293293
init(data: Data) {

Sources/PayKit/Services/Analytics/Loggable.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ struct LoggablePaymentAction: Encodable, Equatable, Loggable {
123123
try container.encodeIfPresent(money?.amount, forKey: .amount)
124124
try container.encodeIfPresent(money?.currency, forKey: .currency)
125125
}
126-
127-
case .ON_FILE_PAYMENT:
126+
case .ON_FILE_PAYMENT, .ON_FILE_PAYOUT:
128127
if clearing {
129128
try container.encode(accountReferenceID, forKey: .accountReferenceID)
130129
} else {

0 commit comments

Comments
 (0)