Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Public release 1.3.0
Browse files Browse the repository at this point in the history
Public release 1.3.0
  • Loading branch information
EugeneIOs committed Feb 1, 2022
2 parents fcaeddd + b36e2c7 commit cc45904
Show file tree
Hide file tree
Showing 267 changed files with 7,677 additions and 18,811 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Run Tests iOS 13-14
command: >
cd Tests/VGSCheckoutSDKTests/Resources/MockedData &&
plutil -insert vaultID -string ${COLLECT_UNIT_TESTS_VAULT_ID} VGSCheckoutTestConfig.plist && cd .. && cd .. && cd .. && cd .. && ls && xcodebuild test -project VGSCheckoutSDK.xcodeproj -scheme VGSCheckoutSDKTests -destination 'platform=iOS Simulator,name=iPhone 13,OS=15.0' -testPlan VGSCheckoutSDKTests
plutil -insert vaultID -string ${COLLECT_UNIT_TESTS_VAULT_ID} VGSCheckoutTestConfig.plist && plutil -insert dummyMockedTestJWTToken -string ${CHECKOUT_UNIT_TESTS_DUMMY_JWT} VGSCheckoutTestConfig.plist && plutil -insert dummyMockedTestInvalidJWTToken -string ${CHECKOUT_UNIT_TESTS_DUMMY_INVALID_JWT} VGSCheckoutTestConfig.plist && cd .. && cd .. && cd .. && cd .. && ls && xcodebuild test -project VGSCheckoutSDK.xcodeproj -scheme VGSCheckoutSDKTests -destination 'platform=iOS Simulator,name=iPhone 13,OS=15.0' -testPlan VGSCheckoutSDKTests
build-and-test-sdk:
macos:
xcode: "12.5.1"
Expand All @@ -23,7 +23,7 @@ jobs:
name: Run Tests iOS 13-14
command: >
cd Tests/VGSCheckoutSDKTests/Resources/MockedData &&
plutil -insert vaultID -string ${COLLECT_UNIT_TESTS_VAULT_ID} VGSCheckoutTestConfig.plist && cd .. && cd .. && cd .. && cd .. && ls && xcodebuild test -project VGSCheckoutSDK.xcodeproj -scheme VGSCheckoutSDKTests -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.5' -testPlan VGSCheckoutSDKTests
plutil -insert vaultID -string ${COLLECT_UNIT_TESTS_VAULT_ID} VGSCheckoutTestConfig.plist && plutil -insert dummyMockedTestJWTToken -string ${CHECKOUT_UNIT_TESTS_DUMMY_JWT} VGSCheckoutTestConfig.plist && plutil -insert dummyMockedTestInvalidJWTToken -string ${CHECKOUT_UNIT_TESTS_DUMMY_INVALID_JWT} VGSCheckoutTestConfig.plist && cd .. && cd .. && cd .. && cd .. && ls && xcodebuild test -project VGSCheckoutSDK.xcodeproj -scheme VGSCheckoutSDKTests -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.5' -testPlan VGSCheckoutSDKTests
build-and-ui-test-demo-app-ios-15:
macos:
xcode: "13.0.0"
Expand Down
26 changes: 9 additions & 17 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ custom_categories:
children:
- VGSCheckoutConfigurationProtocol
- VGSCheckoutCustomConfiguration
- VGSCheckoutMultiplexingConfiguration
- VGSCheckoutFieldVisibility
- VGSCheckoutBillingAddressVisibility
- name: Card Details Configuration
Expand All @@ -45,14 +44,14 @@ custom_categories:
- VGSCheckoutCardExpDateFormat
- VGSCheckoutExpDateSeparateSerializer
- VGSCheckoutCVCOptions
- name: Billing Address Details Configuration
- name: Custom Billing Address Details Configuration
children:
- VGSCheckoutBillingAddressOptions
- VGSCheckoutBillingAddressCountryOptions
- VGSCheckoutBillingAddressLine1Options
- VGSCheckoutBillingAddressLine2Options
- VGSCheckoutBillingAddressCityOptions
- VGSCheckoutBillingAddressPostalCodeOptions
- VGSCheckoutCustomBillingAddressOptions
- VGSCheckoutCustomBillingAddressCountryOptions
- VGSCheckoutCustomBillingAddressLine1Options
- VGSCheckoutCustomBillingAddressLine2Options
- VGSCheckoutCustomBillingAddressCityOptions
- VGSCheckoutCustomBillingAddressPostalCodeOptions
- name: UITheme
children:
- VGSCheckoutDefaultTheme
Expand All @@ -65,19 +64,12 @@ custom_categories:
- VGSCheckoutFormValidationBehaviour
- name: APIConfiguration
children:
- VGSCheckoutRequestOptions
- VGSCheckoutRouteConfiguration
- VGSCheckoutCustomConfigurationRequestOptions
- VGSCheckoutCustomRouteConfiguration
- VGSCheckoutHTTPMethod
- VGSCheckoutHostnamePolicy
- VGSCheckoutDataMergePolicy
- VGSCheckoutRequestResult
- name: PaymentCards
children:
- VGSCheckoutPaymentCards
- VGSCheckoutPaymentCardModel
- VGSCheckoutUnknownPaymentCardModel
- VGSCheckoutCustomPaymentCardModel
- VGSCheckoutCheckSumAlgorithmType
- name: Debugging
children:
- VGSCheckoutLogger
Expand Down
32 changes: 3 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ VGS provides you with a Universal Checkout and User Experience which is fully in
<img src="vgs-checkout-ios-add-card-2.png" width="200" alt="VGS Checkout iOS SDK Edit State" hspace="20">
</p>

**Depending on the needs we provide you with two solutions:**

- **Customized Universal Checkout** - shape the solution you need with our universal checkout solution. It’s easy to customize your integration with no heavy lifting to have a uniform experience across platforms and devices.<br/>
- **Checkout for Payment Orchestration** - save time and payment costs on by integration with [Payment Optimization App](https://www.verygoodsecurity.com/docs/payment-optimization/orchestration).

Table of contents
=================

Expand All @@ -26,7 +21,7 @@ Table of contents
* [CocoaPods](#cocoapods)
* [Swift Package Manager](#swift-package-manager)
* [Usage](#usage)
* [Checkout SDK Configuration](#choose-checkout-sdk-configuration)
* [Checkout SDK Configuration](#setup-checkout-configuration)
* [Present Checkout](#present-vgscheckout-form-with-configuration-object)
* [Demo Application](#demo-application)
* [Documentation](#documentation)
Expand Down Expand Up @@ -81,30 +76,9 @@ class ViewController: UIViewController {
}
```

### Choose Checkout SDK Configuration
VGS Checkout SDK works with different configuration types. You can get more info about available configrurations in VGS Checkout SDK [docs](https://www.verygoodsecurity.com/docs/payment-optimization/checkout/ios-sdk/configuration).

***VGSCheckoutAddCardConfiguration setup***<br/>

`VGSCheckoutAddCardConfiguration` requires valid access token for [Payment Orchestration App](https://www.verygoodsecurity.com/docs/payment-optimization/orchestration).
Use your `tenantId` for payment orchestration. You can get it in your [organisation dashboard].
### Setup Checkout Configuration
Depends on your needs, you can setup Checkout Configuration that will work with [Payment Orchestration App](https://www.verygoodsecurity.com/docs/payment-optimization/orchestration) or your custom API. You can get more info about Configruration in VGS Checkout SDK [docs](https://www.verygoodsecurity.com/docs/payment-optimization/checkout/ios-sdk/configuration).

```swift
// Create payment orchestration add card configuration with access token.
VGSCheckoutAddCardConfiguration.createConfiguration(accessToken: "<ACCESS_TOKEN>", tenantId: "<TENANT_ID>", environment: "<ENVIRONMENT>") {[weak self] configuration in
guard let strongSelf = self else {return}
configuration.billingAddressVisibility = .visible

strongSelf.vgsCheckout = VGSCheckout(configuration: configuration)
strongSelf.vgsCheckout?.delegate = strongSelf
// Present checkout configuration.
strongSelf.vgsCheckout?.present(from: strongSelf)
} failure: {[weak self] error in
print(error.localizedDescription)
print("ERROR! Cannot create configuration!")
}

```

***VGSCheckoutCustomConfiguration setup***<br/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ public protocol VGSCheckoutDelegate: AnyObject {
/// - Parameter requestResult: `VGSCheckoutRequestResult` object, holds result of checkout flow.
func checkoutDidFinish(with requestResult: VGSCheckoutRequestResult)

/// Tells the delegate that user cancelled checkout flow (closed checkout screen.)
/// Tells the delegate that user cancelled checkout flow (closed checkout screen).
func checkoutDidCancel()

/// Tells the delegate that save card succeeded and fin instrument created.
/// - Parameter data: `Data?` object, holds response data with created financial instrument for saved card.
/// - Parameter response: `URLResponse?` object, holds URL response object with created financial instrument for saved card.
// func saveCardDidSuccess(with data: Data?, response: URLResponse?)
//
// /// Tells the delegate that user removed saved card from payment options methods.
// /// - Parameter id: `String` object, removed saved card financial instrument id.
// func savedCardDidRemove(_ id: String)
}

/// Defeault protocol implementation.
//public extension VGSCheckoutDelegate {
//
// /// no:doc
// func saveCardDidSuccess(with data: Data?, response: URLResponse?) {}
//
// /// no:doc
// func savedCardDidRemove(_ id: String) {}
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// VGSCheckoutPaymentMethod.swift
// VGSCheckoutSDK
//

import Foundation

/// Describes selected payment method.
internal enum VGSCheckoutPaymentMethod {

/**
User paid with saved card option provided in saved payment methods.
- Parameters:
- cardInfo: `VGSCheckoutPaymentCardInfo` object, contains information about selected card used for payment.
*/
//case savedCard(_ cardInfo: VGSCheckoutPaymentCardInfo)

/**
User paid with new card.
- Parameters:
- cardInfo: `VGSCheckoutNewPaymentCardInfo` object, contains information about new saved card payment.
*/
case newCard(_ cardInfo: VGSCheckoutNewPaymentCardInfo)

/// Initializer.
/// - Parameter paymentOption: `VGSPaymentOption` object, payment option.
internal init(paymentOption: VGSPaymentOption) {
switch paymentOption {
case .savedCard(let card):
fatalError("not implemented!")
// self = .savedCard(VGSCheckoutPaymentCardInfo(id: card.id))
// return
case .newCard:
self = .newCard(VGSCheckoutNewPaymentCardInfo(shouldSave: false))
return
}
}
}

/// Holds additional information for payment method when user paid with selected card from provided saved cards.
internal struct VGSCheckoutPaymentCardInfo {
public let id: String
}

/// Holds additional information for payment method when user paid with new card.
internal struct VGSCheckoutNewPaymentCardInfo {

/// `true` if user selected `Save card for future payments options`, will be`nil` when `isSaveCardOptionEnabled` is set to `false`.
internal let shouldSave: Bool?

/// no:doc
internal init(shouldSave: Bool?) {
self.shouldSave = shouldSave
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit cc45904

Please sign in to comment.