Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MOB-934 Update Read Me and CodeOwners #113

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These owners will be the default owners for everything in the repo.
# For more info, see: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
* @Peter-John-paystack @michael-paystack @PaystackHQ/mobile @dami-paystack
11 changes: 10 additions & 1 deletion Example/paystack-sdk-ios/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ struct ContentView: View {
.padding()
}

func paymentDone(_ result: TransactionResult) {}
func paymentDone(_ result: TransactionResult) {
switch result {
case .completed(let details):
print("Transaction completed with reference: \(details.reference)")
case .cancelled:
print("Transaction was cancelled")
case .error(error: let error, reference: let reference):
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
}
}
}

struct ContentView_Previews: PreviewProvider {
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ We currently have two variations of Example apps.

To get started with either of these:
- Open the associated project file.
- Add the Pusher public key to the `secrets.plist` file located in `/Sources/PaystackSDK/Core/Service/Subscription`
- 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.

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

### CocoaPods
Add the pods to your Podfile as required:
```ruby
pod 'PaystackCore'
pod `PaystackUI`
```

And then run:
```ruby
pod install
```
After installing the Cocoapod into your project import it using
After installing with Swift package Manager into your project import it using
```swift
import PaystackCore
import PaystackUI
Expand All @@ -63,7 +51,14 @@ paystackObject?.chargeUIButton(accessCode: "transaction access code",
}

func paymentDone(_ result: TransactionResult) {
// Handle transaction result
switch (result){
case .completed(let details):
print("Transaction completed with reference: \(details.reference)")
case .cancelled:
print("Transaction was cancelled")
case .error(error: let error, reference: let reference):
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
}
}
```

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

func paymentDone(_ result: TransactionResult) {
// Handle transaction result
switch (result){
case .completed(let details):
print("Transaction completed with reference: \(details.reference)")
case .cancelled:
print("Transaction was cancelled")
case .error(error: let error, reference: let reference):
print("An error occured: \(error.message) with reference: \(String(describing: reference))")
}
}
```

Expand Down
Loading