Skip to content

Commit

Permalink
Feat/new interop (#1856)
Browse files Browse the repository at this point in the history
* feat: migrate js interop

* feat: pre release version

* add launch mode with disabled websecurity for testing

* add dev releases for publishing

* Stripe web element integration (#1790)

* feat: implement default values and new layout porperties web element

* feat: add apple pay recurring payment options

* feat: add apple pay deferred payment to web element

* feat add auto reload paymentoptions

---------

Co-authored-by: Remon <[email protected]>

* fix remarks

---------

Co-authored-by: Jaime Blasco <[email protected]>
Co-authored-by: Remon <[email protected]>
  • Loading branch information
3 people authored Jul 25, 2024
1 parent afc9eb7 commit 7434db9
Show file tree
Hide file tree
Showing 77 changed files with 5,334 additions and 1,626 deletions.
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"request": "launch",
"type": "dart",
},
{
"name": "example no web security",
"cwd": "example",
"request": "launch",
"type": "dart",
"args": [
"--web-browser-flag",
"--disable-web-security",
]
},
{
"name": "Stripe.js web tests",
"request": "launch",
Expand Down
1 change: 0 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_stripe_web/flutter_stripe_web.dart';
import 'package:web/web.dart' as web;

import 'stripe_checkout_web.dart';
String getUrlPort() => web.window.location.port;

String getReturnUrl() => web.window.location.href;

Future<void> pay() async {
await WebStripe.instance.confirmPaymentElement(
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: 'none'

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.0.0"

dependencies:
Expand All @@ -16,7 +16,7 @@ dependencies:
http: ^1.1.0
font_awesome_flutter: ^10.6.0
platform: ^3.0.0

web: ^0.5.1

dev_dependencies:
integration_test:
Expand Down
8 changes: 4 additions & 4 deletions packages/stripe_js/lib/src/api/converters/js_converter.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:stripe_js/stripe_api.dart';

class ElementsConverter extends JSConverter<Elements> {
const ElementsConverter();
}

class JSConverter<T> implements JsonConverter<T, dynamic> {
const JSConverter();

Expand All @@ -15,6 +11,10 @@ class JSConverter<T> implements JsonConverter<T, dynamic> {
dynamic toJson(dynamic object) => object;
}

class ElementsConverter extends JSConverter<Elements> {
const ElementsConverter();
}

class ElementConverter extends JSConverter<Element> {
const ElementConverter();
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/stripe_js/lib/src/api/core/error.freezed.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/stripe_js/lib/src/api/elements/element.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
abstract class Element {}
extension type const Element._(Object o) implements Object {}

abstract class Elements {}
extension type const Elements._(Object o) implements Object {}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7434db9

Please sign in to comment.