Skip to content

Commit

Permalink
task: make discount and tax amount optional int (#12)
Browse files Browse the repository at this point in the history
* Make discountAmount and taxAmount optional integers

* Bump version

* Make init arguments optional and update README
  • Loading branch information
luca-gr4vy authored Jul 1, 2024
1 parent c0a23e7 commit 35a4b8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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" |
Expand Down
6 changes: 3 additions & 3 deletions gr4vy-iOS/Models/Gr4vyCartItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ 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
var imageUrl: String? = nil
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
Expand Down
2 changes: 1 addition & 1 deletion gr4vy-ios.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 35a4b8e

Please sign in to comment.