diff --git a/README.md b/README.md index c5f0c6c..e71706c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ gr4vy-ios doesn't contain any external dependencies. use_frameworks! target 'YOUR_TARGET_NAME' do - pod 'gr4vy-ios', '2.2.0' + pod 'gr4vy-ios', '2.2.1' end ``` @@ -131,7 +131,7 @@ These are the parameteres available on the `launch` method: | `intent` | `Optional` | `authorize`, `capture` - Defines the intent of this API call. This determines the desired initial state of the transaction.| | `metadata` | `Optional` | An optional dictionary of key/values for transaction metadata. All values should be a string.| | `paymentSource` | `Optional` | `installment`, `recurring` - Can be used to signal that Embed is used to capture the first transaction for a subscription or an installment. When used, `store` is implied to be `true` and `display` is implied to be `supportsTokenization`. This means that payment options that do not support tokenization are automatically hidden. | -| `cartItems` | `Optional` | An optional array of cart item objects, each object must define a `name`, `quantity`, and `unitAmount`.| +| `cartItems` | `Optional` | An optional array of cart item objects, each object must define a `name`, `quantity`, and `unitAmount`. Other optional properties are `discountAmount`, `taxAmount`, `externalIdentifier`, `sku`, `productUrl`, `imageUrl`, `categories` and `productType`.| | `environment`| `Optional` | `.sandbox`, `.production`. Defaults to `.production`. When `.sandbox` is provided the URL will contain `sandbox.GR4VY_ID`. | | `applePayMerchantId`| `Optional` | The Apple merchant ID to be used during Apple Pay transcations | | `applePayMerchantName`| `Optional` | The name which appears in the Apple Pay dialog next to "Pay" | diff --git a/gr4vy-iOS/Models/Gr4vyCartItem.swift b/gr4vy-iOS/Models/Gr4vyCartItem.swift index 314a6af..b603559 100644 --- a/gr4vy-iOS/Models/Gr4vyCartItem.swift +++ b/gr4vy-iOS/Models/Gr4vyCartItem.swift @@ -9,8 +9,8 @@ public struct Gr4vyCartItem: Codable { let name: String let quantity: Int let unitAmount: Int - let discountAmount: Int - let taxAmount: Int + let discountAmount: Int? + let taxAmount: Int? var externalIdentifier:String? = nil var sku: String? = nil var productUrl: String? = nil @@ -18,7 +18,7 @@ public struct Gr4vyCartItem: Codable { var categories: [String]? = nil var productType: String? = nil - public init(name: String, quantity: Int, unitAmount: Int, discountAmount: Int = 0, taxAmount: Int = 0, + public init(name: String, quantity: Int, unitAmount: Int, discountAmount: Int? = 0, taxAmount: Int? = 0, externalIdentifier: String? = nil, sku: String? = nil, productUrl: String? = nil, imageUrl: String? = nil, categories: [String]? = nil, productType: String? = nil) { self.name = name self.quantity = quantity diff --git a/gr4vy-ios.podspec b/gr4vy-ios.podspec index c4e458c..303e219 100644 --- a/gr4vy-ios.podspec +++ b/gr4vy-ios.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'gr4vy-ios' - s.version = '2.2.0' + s.version = '2.2.1' s.license = 'MIT' s.summary = 'Quickly embed Gr4vy in your iOS app to store card details, authorize payments, and capture a transaction.' s.homepage = 'https://github.com/gr4vy/gr4vy-ios'