Skip to content

Commit cf2b3b6

Browse files
chore(country-items): Update cart item model to include seller country [TA-10214] (#72)
* chore(country-items): Added sellerCountry to README.md * chore(country-items): Added sellerCountry to android app * chore(country-items): Added sellerCountry to ios app * chore(country-items): Added sellerCountry to react-native app * chore(country-items): Updated Podfile.lock with Cocoapod 1.16.2 and the latest version of gr4vy-ios * chore(country-items): Added trivy find to ignore for now since it makes the app crash
1 parent b8c6722 commit cf2b3b6

File tree

9 files changed

+74
-64
lines changed

9 files changed

+74
-64
lines changed

.trivyignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
# tough-cookie (nodejs-mobile-react-native app)
66

77
CVE-2023-26136
8+
9+
10+
# App is crashing on upgrade of @babel\helpers to 7.26.10 version
11+
CVE-2025-27789

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ The options passed to `showPaymentSheet` via the configuration object are as fol
7373
| `buyerId` | `null` | An optional ID for a Gr4vy buyer. The transaction will automatically be associated to a buyer with that ID. If no buyer with this ID exists then it will be ignored. |
7474
| `buyerExternalIdentifier` | `null` | An optional external ID for a Gr4vy buyer. The transaction will automatically be associated to a buyer with that external ID. If no buyer with this external ID exists then it will be ignored. This option is ignored if the `buyerId` is provided. |
7575
| `externalIdentifier` | `null` | An optional external identifier that can be supplied. This will automatically be associated to any resource created by Gr4vy and can subsequently be used to find a resource by that ID. |
76-
| `store` | `ask` | `'ask'`, `'preselect'`, `true`, `false` - Explicitly store the payment method, ask the buyer or preselect it by default. Requires `buyerId` or `buyerExternalIdentifier`. |
76+
| `store` | `ask` | `'ask'`, `'preselect'`, `true`, `false` - Explicitly store the payment method, ask the buyer or preselect it by default. Requires `buyerId` or `buyerExternalIdentifier`. |
7777
| `display` | `all` | `all`, `addOnly`, `storedOnly`, `supportsTokenization` - Filters the payment methods to show stored methods only, new payment methods only or methods that support tokenization. |
78-
| `intent` | `authorize` | `authorize`, `preferAuthorize`, `capture` - Defines the intent of this API call. This determines the desired initial state of the transaction. When used, `preferAuthorize` automatically switches to `capture` if the selected payment method doesn't support delayed capture. |
78+
| `intent` | `authorize` | `authorize`, `preferAuthorize`, `capture` - Defines the intent of this API call. This determines the desired initial state of the transaction. When used, `preferAuthorize` automatically switches to `capture` if the selected payment method doesn't support delayed capture. |
7979
| `metadata` | `null` | An optional object of key/values for transaction metadata. All values should be a string. |
8080
| `paymentSource` | `null` | `installment`, `moto`, `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. |
8181
| `applePayMerchantId` | `null` | The Apple merchant ID to be used for Apple Pay transactions. |
82-
| `cartItems` | `null` | 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`. |
82+
| `cartItems` | `null` | 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`, `productType` and `sellerCountry`. |
8383
| `theme` | `null` | Theme customisation options [See Theming Options](https://docs.gr4vy.com/guides/payments/embed/theming#theme-options). The SDK also contains an additional two properties within the `colors` object: `headerBackground` and `headerText`. These are used for the navigation background and foreground colors. |
8484
| `locale` | `null` | An optional locale, this consists of a `ISO 639 Language Code` followed by an optional `ISO 3166 Country Code`, e.g. `en`, `en-gb` or `pt-br`. |
8585
| `statementDescriptor` | `null` | An optional object with information about the purchase to construct the statement information the buyer will see in their bank statement. Please note support for these fields varies across payment service providers and underlying banks, so Gr4vy can only ensure a best effort approach for each supported platform. <br />As an example, most platforms will only support a concatenation of `name` and `description` fields, truncated to a length of 22 characters. <br />The object can contain `name`, `description`, `phoneNumber`, `city` and `url` keys, with string values. `phoneNumber` should be in E164 format. Gr4vy recommends avoiding characters outside the alphanumeric range and the dot (`.`) to ensure wide compatibility. |

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dependencies {
6868
//noinspection GradleDynamicVersion
6969
implementation "com.facebook.react:react-native:+"
7070

71-
implementation "com.github.gr4vy:gr4vy-android:v1.11.2"
71+
implementation "com.github.gr4vy:gr4vy-android:v1.11.3"
7272
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.3'
7373
}
7474

android/src/main/java/com/gr4vy/embedreactnative/EmbedReactNativeModule.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ private static WritableArray convertCartItemsToJson(ReadableArray cartItemsArray
154154
"productUrl",
155155
"imageUrl",
156156
"categories",
157-
"productType"
157+
"productType",
158+
"sellerCountry"
158159
};
159160
for (String prop : optionalProps) {
160161
setOptionalValue(cartItemMap, cartItemWritableMap, prop);

android/src/main/java/com/gr4vy/embedreactnative/Gr4vyActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ protected static List<CartItem> convertCartItems(String cartItemsJson) {
218218
String productUrl = (String) cartItemJsonObject.opt("productUrl");
219219
String imageUrl = (String) cartItemJsonObject.opt("imageUrl");
220220
String productType = (String) cartItemJsonObject.opt("productType");
221+
String sellerCountry = (String) cartItemJsonObject.opt("sellerCountry");
221222

222223
JSONArray categoriesArray = (JSONArray) cartItemJsonObject.opt("categories");
223224
List<String> categories = null;
@@ -239,7 +240,8 @@ protected static List<CartItem> convertCartItems(String cartItemsJson) {
239240
productUrl,
240241
imageUrl,
241242
categories,
242-
productType
243+
productType,
244+
sellerCountry
243245
);
244246
cartItemList.add(cartItem);
245247
}

0 commit comments

Comments
 (0)