Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/rn-test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Switch to Xcode 26.2
run: sudo xcode-select --switch /Applications/Xcode_26.2.app

- name: Display Xcode info
run: |
echo "Xcode Path: $(xcode-select -p)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Pod::Spec.new do |s|
s.dependency "ShopifyCheckoutKit"
s.dependency "ShopifyCheckoutKit/AcceleratedCheckouts"
else
s.dependency "ShopifyCheckoutSheetKit", "~> 3.8.0"
s.dependency "ShopifyCheckoutSheetKit/AcceleratedCheckouts", "~> 3.8.0"
s.dependency "ShopifyCheckoutKit", "~> 0.0.0"
s.dependency "ShopifyCheckoutKit/AcceleratedCheckouts", "~> 0.0.0"
end

install_modules_dependencies(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ repositories {
def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1"
def shopifySdkArtifact = useLocalSdk
? "com.shopify:checkout-kit:1.0.0"
: "com.shopify:checkout-sheet-kit:3.5.3"
: "com.shopify:checkout-kit:0.0.0"

dependencies {
// For < 0.71, this will be from the local maven repo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Keep Checkout Sheet Kit classes
-keep class com.shopify.checkoutsheetkit.** { *; }
# Keep Checkout Kit classes
-keep class com.shopify.checkoutkit.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ of this software and associated documentation files (the "Software"), to deal
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.shopify.checkoutsheetkit.*;
import com.shopify.checkoutkit.*;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.ReactApplicationContext;
import com.shopify.checkoutsheetkit.lifecycleevents.CheckoutCompletedEvent;
import com.shopify.checkoutkit.lifecycleevents.CheckoutCompletedEvent;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.HashMap;
Expand Down Expand Up @@ -93,7 +93,7 @@ public void onGeolocationPermissionsShowPrompt(@NonNull String origin,
event.put("origin", origin);
sendEventWithStringData("geolocationRequest", mapper.writeValueAsString(event));
} catch (IOException e) {
Log.e("ShopifyCheckoutSheetKit", "Error emitting \"geolocationRequest\" event", e);
Log.e("ShopifyCheckoutKit", "Error emitting \"geolocationRequest\" event", e);
}
}

Expand All @@ -112,7 +112,7 @@ public void onCheckoutFailed(CheckoutException checkoutError) {
String data = mapper.writeValueAsString(populateErrorDetails(checkoutError));
sendEventWithStringData("error", data);
} catch (IOException e) {
Log.e("ShopifyCheckoutSheetKit", "Error processing checkout failed event", e);
Log.e("ShopifyCheckoutKit", "Error processing checkout failed event", e);
}
}

Expand All @@ -127,7 +127,7 @@ public void onCheckoutCompleted(@NonNull CheckoutCompletedEvent event) {
String data = mapper.writeValueAsString(event);
sendEventWithStringData("completed", data);
} catch (IOException e) {
Log.e("ShopifyCheckoutSheetKit", "Error processing completed event", e);
Log.e("ShopifyCheckoutKit", "Error processing completed event", e);
}
}

Expand Down Expand Up @@ -156,7 +156,7 @@ private String getErrorTypeName(CheckoutException error) {
return "CheckoutHTTPError";
} else if (error instanceof ConfigurationException) {
return "ConfigurationError";
} else if (error instanceof CheckoutSheetKitException) {
} else if (error instanceof CheckoutKitException) {
return "InternalError";
} else {
return "UnknownError";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ of this software and associated documentation files (the "Software"), to deal
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.shopify.checkoutkit.NativeShopifyCheckoutKitSpec;
import com.shopify.checkoutsheetkit.*;
import com.shopify.checkoutkit.*;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -47,7 +47,7 @@ public class ShopifyCheckoutKitModule extends NativeShopifyCheckoutKitSpec {

private final ReactApplicationContext reactContext;

private CheckoutSheetKitDialog checkoutSheet;
private CheckoutKitDialog checkoutSheet;

private CustomCheckoutEventProcessor checkoutEventProcessor;

Expand All @@ -56,16 +56,16 @@ public ShopifyCheckoutKitModule(ReactApplicationContext reactContext) {

this.reactContext = reactContext;

ShopifyCheckoutSheetKit.configure(configuration -> {
configuration.setPlatform(Platform.REACT_NATIVE);
ShopifyCheckoutKit.configure(configuration -> {
configuration.setPlatform(new Platform.ReactNative());
checkoutConfig = configuration;
});
}

@Override
protected Map<String, Object> getTypedExportedConstants() {
final Map<String, Object> constants = new HashMap<>();
constants.put("version", ShopifyCheckoutSheetKit.version);
constants.put("version", ShopifyCheckoutKit.version);
return constants;
}

Expand All @@ -85,7 +85,7 @@ public void present(String checkoutURL) {
if (currentActivity instanceof ComponentActivity) {
checkoutEventProcessor = new CustomCheckoutEventProcessor(currentActivity, this.reactContext);
currentActivity.runOnUiThread(() -> {
checkoutSheet = ShopifyCheckoutSheetKit.present(checkoutURL, (ComponentActivity) currentActivity,
checkoutSheet = ShopifyCheckoutKit.present(checkoutURL, (ComponentActivity) currentActivity,
checkoutEventProcessor);
});
}
Expand All @@ -104,13 +104,13 @@ public void preload(String checkoutURL) {
Activity currentActivity = getCurrentActivity();

if (currentActivity instanceof ComponentActivity) {
ShopifyCheckoutSheetKit.preload(checkoutURL, (ComponentActivity) currentActivity);
ShopifyCheckoutKit.preload(checkoutURL, (ComponentActivity) currentActivity);
}
}

@ReactMethod
public void invalidateCache() {
ShopifyCheckoutSheetKit.invalidate();
ShopifyCheckoutKit.invalidate();
}

@ReactMethod(isBlockingSynchronousMethod = true)
Expand All @@ -128,7 +128,7 @@ public WritableMap getConfig() {
public void setConfig(ReadableMap config) {
Context context = getReactApplicationContext();

ShopifyCheckoutSheetKit.configure(configuration -> {
ShopifyCheckoutKit.configure(configuration -> {
if (config.hasKey("preloading")) {
configuration.setPreloading(new Preloading(config.getBoolean("preloading")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import Foundation
import PassKit
import React
import ShopifyCheckoutSheetKit
import ShopifyCheckoutKit
import SwiftUI
import UIKit

Expand Down Expand Up @@ -127,7 +127,6 @@ class RCTAcceleratedCheckoutButtonsView: UIView {
}

@objc var onFail: RCTBubblingEventBlock?
@objc var onComplete: RCTBubblingEventBlock?
@objc var onCancel: RCTBubblingEventBlock?
@objc var onRenderStateChange: RCTBubblingEventBlock?
@objc var onShouldRecoverFromError: RCTDirectEventBlock?
Expand Down Expand Up @@ -253,9 +252,6 @@ class RCTAcceleratedCheckoutButtonsView: UIView {

private func attachEventListeners(to buttons: AcceleratedCheckoutButtons) -> AcceleratedCheckoutButtons {
return buttons
.onComplete { [weak self] event in
self?.handleCheckoutCompleted(event)
}
.onFail { [weak self] error in
self?.handleCheckoutFailed(error)
}
Expand All @@ -265,9 +261,6 @@ class RCTAcceleratedCheckoutButtonsView: UIView {
.onRenderStateChange { [weak self] state in
self?.handleRenderStateChange(state)
}
.onClickLink { [weak self] url in
self?.handleClickLink(url)
}
}

private func updateView() {
Expand Down Expand Up @@ -347,10 +340,6 @@ class RCTAcceleratedCheckoutButtonsView: UIView {

// MARK: - Event Handlers

private func handleCheckoutCompleted(_ event: CheckoutCompletedEvent) {
onComplete?(ShopifyEventSerialization.serialize(checkoutCompletedEvent: event))
}

private func handleCheckoutFailed(_ error: CheckoutError) {
onFail?(ShopifyEventSerialization.serialize(checkoutError: error))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
*/

import Foundation
import ShopifyCheckoutSheetKit
import ShopifyCheckoutKit

/**
* Shared event serialization utilities for converting ShopifyCheckoutSheetKit events
* Shared event serialization utilities for converting ShopifyCheckoutKit events
* to React Native compatible dictionaries.
*/
internal enum ShopifyEventSerialization {
Expand Down Expand Up @@ -59,13 +59,6 @@ internal enum ShopifyEventSerialization {
}
}

/**
* Converts a CheckoutCompletedEvent to a React Native compatible dictionary.
*/
static func serialize(checkoutCompletedEvent event: CheckoutCompletedEvent) -> [String: Any] {
return encodeToJSON(from: event)
}

static func serialize(clickEvent url: URL) -> [String: URL] {
return ["url": url]
}
Expand Down Expand Up @@ -103,14 +96,6 @@ internal enum ShopifyEventSerialization {
]
}

case let .configurationError(message, code, recoverable):
return [
"__typename": "ConfigurationError",
"message": message,
"code": code.rawValue,
"recoverable": recoverable
]

case let .sdkError(underlying, recoverable):
return [
"__typename": "InternalError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ @interface RCT_EXTERN_MODULE (RCTAcceleratedCheckoutButtonsManager, RCTViewManag
*/
RCT_EXPORT_VIEW_PROPERTY(onFail, RCTBubblingEventBlock)

/**
* Emitted when checkout completes successfully. Payload contains order details.
*/
RCT_EXPORT_VIEW_PROPERTY(onComplete, RCTBubblingEventBlock)

/**
* Emitted when checkout is cancelled by the buyer.
*/
Expand Down
Loading
Loading