Skip to content
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

Google Pay updates #948

Merged
merged 31 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9e2ea02
play payments updates
atavism Nov 15, 2023
36d5adc
Add check isPlayVersion
atavism Nov 15, 2023
a69f8b3
skip play check
atavism Nov 16, 2023
2526084
Add play checkout page
atavism Nov 17, 2023
c73de2c
Add play checkout page
atavism Nov 17, 2023
0035c65
clean-ups
atavism Nov 17, 2023
abe92a6
show dialog after successful payment
atavism Nov 17, 2023
942b778
clean-ups, show loading spinner submitting payment
atavism Nov 17, 2023
cba139d
Add plan step and enter email text
atavism Nov 17, 2023
03c05d3
Add Flexible
atavism Nov 17, 2023
c2ca1db
show price summary
atavism Nov 18, 2023
88b60f9
Add com.android.vending.BILLING permission
atavism Nov 18, 2023
94bd4d7
Add logging
atavism Nov 18, 2023
b597be7
Add logging
atavism Nov 18, 2023
be9353d
Remove use of ProgressDialog and some clean-ups
atavism Nov 19, 2023
3166c20
Remove use of ProgressDialog and some clean-ups
atavism Nov 19, 2023
4285003
Update Google Play billing client
atavism Nov 20, 2023
73558f9
Add liblantern-all
atavism Nov 20, 2023
adee5c4
Update go.sum
atavism Nov 20, 2023
a6a5fec
Update golang.org/x/mobile/cmd/gomobile
atavism Nov 20, 2023
f6d2c18
run go mod tidy
atavism Nov 20, 2023
3497f7b
Update go.sum
atavism Nov 20, 2023
c640801
set GOPRIVATE var
atavism Nov 20, 2023
42763e7
formatting
atavism Nov 21, 2023
80fa5ff
code review updates
atavism Nov 21, 2023
eaad573
Fix typo, do not append currency in-app billing
atavism Nov 22, 2023
6066723
fix typo, run ktlint
atavism Nov 22, 2023
de426e6
fix typo, run ktlint
atavism Nov 22, 2023
c339c78
Add setState and do not push page do pop
jigar-f Nov 22, 2023
6bb32ee
Simplify method and fix error message.
jigar-f Nov 22, 2023
6c4fb02
Removed billing-ktx since its not needed.
jigar-f Nov 23, 2023
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
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
run: |
git config --global url."https://${{ secrets.GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Run Unit tests
env:
GOPRIVATE: github.com/getlantern
run: |
go test -failfast -coverprofile=profile.cov ./...
- name: Install goveralls
Expand Down
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

// Google Play libraries
implementation 'com.android.billingclient:billing:6.0.1'
implementation 'com.android.billingclient:billing:6.1.0'
implementation 'com.android.billingclient:billing-ktx:6.1.0'
implementation 'com.google.android.gms:play-services-base:18.2.0'

// lib that simplifies event bus communication between activities, fragments, threads, services, etc
Expand Down
4 changes: 2 additions & 2 deletions android/app/libs/liblantern-all.aar
Git LFS file not shown
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

<permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class SessionModel(
)

"submitGooglePlayPayment" -> paymentsUtil.submitGooglePlayPayment(
call.argument("email")!!,
call.argument("planID")!!,
result,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ open class LanternApp : Application() {

LanternProxySelector(session)

if (session.isPlayVersion) inAppBilling = InAppBilling(this)
inAppBilling = InAppBilling(this)

lanternHttpClient = LanternHttpClient()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.getlantern.lantern.util

import android.app.Activity
import android.app.ProgressDialog
import androidx.annotation.NonNull
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.BillingResult
Expand All @@ -28,9 +27,6 @@ class PaymentsUtil(private val activity: Activity) {

private val session: LanternSessionManager = LanternApp.getSession()

@JvmField
protected var dialog: ProgressDialog? = null

public fun submitStripePayment(
planID: String,
email: String,
Expand All @@ -48,7 +44,6 @@ class PaymentsUtil(private val activity: Activity) {
cvc,
)
val stripe: Stripe = Stripe(activity, session.stripePubKey()!!)
dialog = createDialog(activity.resources.getString(R.string.processing_payment))
stripe.createCardToken(
card,
callback = object : ApiResultCallback<Token> {
Expand All @@ -63,7 +58,6 @@ class PaymentsUtil(private val activity: Activity) {
}

override fun onError(@NonNull error: Exception) {
dialog?.dismiss()
Logger.error(TAG, "Error submitting to Stripe: $error")
methodCallResult.error(
"errorSubmittingToStripe",
Expand All @@ -74,7 +68,6 @@ class PaymentsUtil(private val activity: Activity) {
},
)
} catch (t: Throwable) {
dialog?.dismiss()
Logger.error(TAG, "Error submitting to Stripe", t)
methodCallResult.error(
"errorSubmittingToStripe",
Expand Down Expand Up @@ -129,22 +122,28 @@ class PaymentsUtil(private val activity: Activity) {
}
}

// getPlanYear splits the given plan ID by hyphen and returns the year the given startas with
private fun getPlanYear(planID: String): String {
var plan = planID
val parts = planID.split("-").toTypedArray()
if (parts.size > 0) {
atavism marked this conversation as resolved.
Show resolved Hide resolved
plan = parts[0]
Logger.debug(TAG, "Updated plan to have ID ${plan}")
}
return plan
}

// Handles Google Play transactions
fun submitGooglePlayPayment(planID: String, methodCallResult: MethodChannel.Result) {
fun submitGooglePlayPayment(email: String, planID: String, methodCallResult: MethodChannel.Result) {
val inAppBilling = LanternApp.getInAppBilling()

if (inAppBilling == null) {
Logger.error(TAG, "Missing inAppBilling")
methodCallResult.error(
"unknownError",
activity.resources.getString(R.string.error_making_purchase),
null,
)
return
}
val currency = LanternApp.getSession().planByID(planID)?.let {
it.currency
} ?: "usd"
val plan = getPlanYear(planID)
Logger.debug(TAG, "Starting in-app purchase for plan with ID ${plan}")
inAppBilling.startPurchase(
activity,
planID,
plan,
object : PurchasesUpdatedListener {
override fun onPurchasesUpdated(
billingResult: BillingResult,
Expand Down Expand Up @@ -178,8 +177,8 @@ class PaymentsUtil(private val activity: Activity) {
}

sendPurchaseRequest(
planID,
"",
plan + "-" + currency,
email,
tokens[0],
PaymentProvider.GooglePlay,
methodCallResult,
Expand Down Expand Up @@ -243,16 +242,6 @@ class PaymentsUtil(private val activity: Activity) {
}
}

private fun createDialog(message: String): ProgressDialog {
return ProgressDialog.show(
activity,
message,
"",
true,
false,
)
}

private fun sendPurchaseRequest(
planID: String,
email: String,
Expand Down Expand Up @@ -302,7 +291,6 @@ class PaymentsUtil(private val activity: Activity) {
object : ProCallback {

override fun onSuccess(response: Response?, result: JsonObject?) {
dialog?.dismiss()
session.linkDevice()
session.setIsProUser(true)
Logger.e(TAG, "Purchase Completed: $response")
Expand All @@ -312,7 +300,6 @@ class PaymentsUtil(private val activity: Activity) {

override fun onFailure(t: Throwable?, error: ProError?) {
Logger.e(TAG, "Error with purchase request: $error")
dialog?.dismiss()
methodCallResult.error(
"errorMakingPurchase",
activity.getString(
Expand Down
3 changes: 3 additions & 0 deletions assets/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ msgstr "months"
msgid "enter_email"
msgstr "Enter Email"

msgid "enter_email_to_complete_purchase"
msgstr "Enter email to complete purchase"

msgid "error_fetching_plans"
msgstr "Error fetching plans, please restart Lantern and try again."

Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ require (
github.com/getlantern/replica v0.14.1
github.com/gorilla/mux v1.8.0
github.com/stretchr/testify v1.8.3
golang.org/x/mobile v0.0.0-20221110043201-43a038452099
golang.org/x/net v0.11.0
golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da
golang.org/x/net v0.18.0
nhooyr.io/websocket v1.8.7
)

Expand Down Expand Up @@ -297,14 +297,14 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.55.0 // indirect
Expand Down
34 changes: 17 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+
github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/flashlight/v7 v7.6.14 h1:Ic/B+JUWufpvtf1LSwGntQR9U/SHTg8U/Ypje0ZSw1M=
github.com/getlantern/flashlight/v7 v7.6.14 h1:J+JpTAvHn73MkP9MooD7/8g/mm2o4ojqjwKOUfEILmY=
github.com/getlantern/flashlight/v7 v7.6.14/go.mod h1:tMY6W9caWMCsFSqKAr0VPoUtmxIFM5um1yidEiNnN9M=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI=
Expand Down Expand Up @@ -1246,8 +1246,8 @@ golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1278,8 +1278,8 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20221110043201-43a038452099 h1:aIu0lKmfdgtn2uTj7JI2oN4TUrQvgB+wzTPO23bCKt8=
golang.org/x/mobile v0.0.0-20221110043201-43a038452099/go.mod h1:aAjjkJNdrh3PMckS4B10TGS2nag27cbKR1y2BpUxsiY=
golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da h1:gS9sVMAeHM+gVBmM9bTM6vUi/NHv58O3QzJ3vjjN84M=
golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da/go.mod h1:IEceR0jfVklLJXrbUe90rfdAFAYDW0SQwKl4qvO1GBQ=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
Expand All @@ -1289,8 +1289,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1347,8 +1347,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -1369,8 +1369,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1443,8 +1443,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand All @@ -1467,8 +1467,8 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -1527,8 +1527,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
6 changes: 5 additions & 1 deletion lib/common/session_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,13 @@ class SessionModel extends Model {
}).then((value) => value as String);
}

Future<void> submitGooglePlay(String planID) async {
Future<void> submitPlayPayment(
String planID,
String email,
) async {
return methodChannel
.invokeMethod('submitGooglePlayPayment', <String, dynamic>{
'email': email,
'planID': planID,
}).then((value) => value as String);
}
Expand Down
6 changes: 6 additions & 0 deletions lib/core/router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ class AppRouter extends $AppRouter {
transitionsBuilder: defaultTransition,
durationInMilliseconds: defaultTransitionMillis,
reverseDurationInMilliseconds: defaultTransitionMillis),
CustomRoute(
page: PlayCheckout.page,
path: '/playcheckout',
transitionsBuilder: defaultTransition,
durationInMilliseconds: defaultTransitionMillis,
reverseDurationInMilliseconds: defaultTransitionMillis),
CustomRoute(
page: Checkout.page,
path: '/checkout',
Expand Down
Loading
Loading