Skip to content

Commit ad608ab

Browse files
MOB-934 Update Read Me and CodeOwners
- Updated Readme with sample of Result Transaction - Adding Code Owner file - Updated the Example application for Result Tranaction
1 parent a00d463 commit ad608ab

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

.github/CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These owners will be the default owners for everything in the repo.
2+
# For more info, see: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
* @Peter-John-paystack @michael-paystack @PaystackHQ/mobile @dami-paystack

Example/paystack-sdk-ios/ContentView.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ struct ContentView: View {
2121
.padding()
2222
}
2323

24-
func paymentDone(_ result: TransactionResult) {}
24+
func paymentDone(_ result: TransactionResult) {
25+
switch result {
26+
case .completed(let details):
27+
print("Transaction completed with reference: \(details.reference)")
28+
case .cancelled:
29+
print("Transaction was cancelled")
30+
case .error(error: let error, reference: let reference):
31+
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
32+
}
33+
}
2534
}
2635

2736
struct ContentView_Previews: PreviewProvider {

README.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ We currently have two variations of Example apps.
88

99
To get started with either of these:
1010
- Open the associated project file.
11-
- Add the Pusher public key to the `secrets.plist` file located in `/Sources/PaystackSDK/Core/Service/Subscription`
1211
- Inside `ContentView.swift` (SwiftUI Example App) or `ViewController.swift` (UIKit Example app), modify the Paystack object that is being built to include the public key of the integration being used.
1312

1413
```swift
@@ -32,18 +31,7 @@ To install the SDK using [Swift Package Manager](https://github.com/apple/swift-
3231
1. In Xcode, select “File” → “Add Packages...”
3332
2. Enter https://github.com/PaystackHQ/paystack-sdk-ios.git
3433

35-
### CocoaPods
36-
Add the pods to your Podfile as required:
37-
```ruby
38-
pod 'PaystackCore'
39-
pod `PaystackUI`
40-
```
41-
42-
And then run:
43-
```ruby
44-
pod install
45-
```
46-
After installing the Cocoapod into your project import it using
34+
After installing with Swift package Manager into your project import it using
4735
```swift
4836
import PaystackCore
4937
import PaystackUI
@@ -63,7 +51,14 @@ paystackObject?.chargeUIButton(accessCode: "transaction access code",
6351
}
6452

6553
func paymentDone(_ result: TransactionResult) {
66-
// Handle transaction result
54+
switch (result){
55+
case .completed(let details):
56+
print("Transaction completed with reference: \(details.reference)")
57+
case .cancelled:
58+
print("Transaction was cancelled")
59+
case .error(error: let error, reference: let reference):
60+
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
61+
}
6762
}
6863
```
6964

@@ -78,7 +73,14 @@ For UIKit, you would create your own button to trigger the flow and provide a re
7873
}
7974

8075
func paymentDone(_ result: TransactionResult) {
81-
// Handle transaction result
76+
switch (result){
77+
case .completed(let details):
78+
print("Transaction completed with reference: \(details.reference)")
79+
case .cancelled:
80+
print("Transaction was cancelled")
81+
case .error(error: let error, reference: let reference):
82+
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
83+
}
8284
}
8385
```
8486

0 commit comments

Comments
 (0)