-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task: add support for cart items #32
task: add support for cart items #32
Conversation
android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java
Outdated
Show resolved
Hide resolved
ios/EmbedReactNative.swift
Outdated
let discountAmount = dict["discountAmount"] as? Int ?? 0 | ||
let taxAmount = dict["taxAmount"] as? Int ?? 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is waiting for the type update in the iOS SDK https://github.com/gr4vy/gr4vy-ios/blob/main/gr4vy-iOS/Models/Gr4vyCartItem.swift. We don't want to pass a default of 0
as this would cause a mismatch between the passed prop and the value in the JWT if people don't pass anything
@@ -29,6 +29,8 @@ | |||
}, | |||
"resolutions": { | |||
"braces": "^3.0.3", | |||
"tar": "^6.2.1" | |||
"tar": "^6.2.1", | |||
"ws": "^7.5.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix ws
vulnerability
@@ -61,6 +66,25 @@ public static <T> T coalesce(T... items) { | |||
return null; | |||
} | |||
|
|||
public static Object getMapOptionalValue(ReadableMap map, String key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReadableMap
doesn't seem to have a method to get options values and fallback to null
, so adding one here
android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java
Show resolved
Hide resolved
android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java
Outdated
Show resolved
Hide resolved
@@ -311,7 +333,7 @@ class EmbedReactNative: NSObject { | |||
] | |||
) | |||
return | |||
case .transactionCreated(let transactionID, let status, let paymentMethodID): | |||
case .transactionCreated(let transactionID, let status, let paymentMethodID, let approvalUrl): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed by the latest update otherwise the build fails gr4vy/gr4vy-ios#10
🚀 PR was released in |
Description: Adds support for the missing
cartItems
properties:discountAmount
,taxAmount
,externalIdentifier
,sku
,productUrl
,imageUrl
,categories
andproductType
.Tested locally with simulators, the values appear in the transaction response and on dashboard.
Note: the iOS part requires this
gr4vy-ios
update to be available (will need to upgrade to2.2.1
) gr4vy/gr4vy-ios#12Ticket: https://gr4vy.atlassian.net/browse/TA-7501