Skip to content

Commit

Permalink
Merge pull request #242 from omise/develop
Browse files Browse the repository at this point in the history
[Dev -> Master] 4.25.1
  • Loading branch information
Andrei Solovev authored Nov 21, 2023
2 parents c85ea53 + cf05c84 commit 8983418
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 91 deletions.
8 changes: 4 additions & 4 deletions OmiseSDK/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ extension Client {
// swiftlint:disable:next function_body_length
private static func completeRequest<T: Object>(_ request: Request<T>, callback: Request<T>.Callback?) -> ((Data?, URLResponse?, Error?) -> Void) {
// swiftlint:disable:next closure_body_length
return { (data: Data?, response: URLResponse?, error: Error?) -> Void in
return { (data: Data?, response: URLResponse?, error: Error?) in
guard let callback = callback else { return } // nobody around to hear the leaf falls

var result: RequestResult<T>
Expand Down Expand Up @@ -398,8 +398,8 @@ extension Client {

// MARK: - Constants
extension Client {
static let sdkVersion: String = "4.25.0"
static let sdkVersion: String = "4.25.1"

static let currentPlatform: String = ProcessInfo.processInfo.operatingSystemVersionString
static let currentDevice: String = UIDevice.current.model

Expand All @@ -413,7 +413,7 @@ extension Client {

static var defaultUserAgent: String {
return """
OmiseIOSSDK/\(sdkVersion) \
OmiseIOS/\(sdkVersion) \
iOS/\(currentPlatform) \
Apple/\(currentDevice)
""" // OmiseIOSSDK/3.0.0 iOS/12.0.0 Apple/iPhone
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "ocbc_digital.png",
"filename" : "ocbc-digital.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ocbc_digital@2x.png",
"filename" : "ocbc-digital@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ocbc_digital@3x.png",
"filename" : "ocbc-digital@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
46 changes: 23 additions & 23 deletions OmiseSDK/Resources/Base.lproj/OmiseSDK.storyboard

Large diffs are not rendered by default.

48 changes: 13 additions & 35 deletions OmiseSDKTests/CapabilityOperationFixtureTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import XCTest

class CapabilityOperationFixtureTests: XCTestCase {

// swiftlint:disable:next function_body_length
func testCapabilityRetrieve() {
let decoder = Client.makeJSONDecoder(for: Request<Source>?.none)

Expand All @@ -30,30 +29,6 @@ class CapabilityOperationFixtureTests: XCTestCase {
XCTFail("Capability doesn't have the BAY Installment backend")
}

if let trueMoneyBackend = capability[OMSSourceTypeValue.trueMoney] {
XCTAssertEqual(trueMoneyBackend.supportedCurrencies, [.thb])
} else {
XCTFail("Capability doesn't have the TrueMoney backend")
}

if let citiPointsBackend = capability[OMSSourceTypeValue.pointsCiti] {
XCTAssertEqual(citiPointsBackend.supportedCurrencies, [.thb])
} else {
XCTFail("Capability doesn't have the Citi Points backend")
}

if let rabbitLinePayBackend = capability[OMSSourceTypeValue.rabbitLinepay] {
XCTAssertEqual(rabbitLinePayBackend.supportedCurrencies, [.thb])
} else {
XCTFail("Capability doesn't have the Rabbit LINE Pay backend")
}

if let ocbcPaoBackend = capability[OMSSourceTypeValue.mobileBankingOCBCPAO] {
XCTAssertEqual(ocbcPaoBackend.supportedCurrencies, [.sgd])
} else {
XCTFail("Capability doesn't have the OCBC Pay Anyone backend")
}

if let fpxBackend = capability[OMSSourceTypeValue.fpx] {
XCTAssertEqual(fpxBackend.banks, [
Capability.Backend.Bank(name: "UOB", code: "uob", isActive: true)
Expand All @@ -70,17 +45,20 @@ class CapabilityOperationFixtureTests: XCTestCase {
XCTFail("Capability doesn't have the Mobile Banking KBank backend")
}

if let grabPayBackend = capability[OMSSourceTypeValue.grabPay] {
XCTAssertEqual(grabPayBackend.supportedCurrencies, [.sgd, .myr])
} else {
XCTFail("Capability doesn't have the GrabPay backend")
}

if let payPayBackend = capability[OMSSourceTypeValue.payPay] {
XCTAssertEqual(payPayBackend.supportedCurrencies, [.jpy])
} else {
XCTFail("Capability doesn't have the PayPay backend")
func testCapabilitySupportsCurrency(_ capability: Capability, sourceType: OMSSourceTypeValue, currencies: Set<Currency>) {
if let backend = capability[sourceType] {
XCTAssertEqual(backend.supportedCurrencies, currencies)
} else {
XCTFail("Capability doesn't have the \(sourceType) backend")
}
}

testCapabilitySupportsCurrency(capability, sourceType: .trueMoney, currencies: [.thb])
testCapabilitySupportsCurrency(capability, sourceType: .pointsCiti, currencies: [.thb])
testCapabilitySupportsCurrency(capability, sourceType: .rabbitLinepay, currencies: [.thb])
testCapabilitySupportsCurrency(capability, sourceType: .mobileBankingOCBCPAO, currencies: [.sgd])
testCapabilitySupportsCurrency(capability, sourceType: .grabPay, currencies: [.sgd, .myr])
testCapabilitySupportsCurrency(capability, sourceType: .payPay, currencies: [.jpy])
} catch {
XCTFail("Cannot decode the source \(error)")
}
Expand Down
26 changes: 0 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# Opn Payments iOS SDK

[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Packager%20Manager-compatible-brightgreen?style=flat-square)](https://swift.org/package-manager)
[![](https://img.shields.io/badge/email-support-yellow.svg?style=flat-square)](mailto:[email protected])
![CI](https://github.com/omise/omise-ios/workflows/CI/badge.svg?branch=master)
Expand Down Expand Up @@ -43,31 +42,6 @@ through your server.

## Installation

### Carthage

To integrate the Opn Payments SDK into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), proceed with the following steps:

1. Add the following line to your `Cartfile`:
```
github "omise/omise-ios"
```

2. Run `carthage update --use-xcframeworks`:

``` bash
$ carthage update --use-xcframeworks
*** Fetching omise-ios
*** Checking out omise-ios at "..."
*** xcodebuild output can be found in /var/folders/sd/ccsbmstn2vbbqd7nk4fgkd040000gn/T/carthage-xcodebuild.X7ZfYB.log
*** Building scheme "OmiseSDK" in OmiseSDK.xcodeproj
```

3. Drag the built XCFramework from `/Carthage/Build` into your project.

For more detailed instructions, please read the [official documentation for Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).

### Swift Package Manager (Xcode 12+)

To integrate the Opn Payments SDK into your Xcode project using the [Swift Package Manager](https://swift.org/package-manager/), proceed with the following steps:

1. In Xcode, select `File` > `Swift Packages` > `Add Package Dependency...`
Expand Down

0 comments on commit 8983418

Please sign in to comment.