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

Add Fragment support to payment confirmation/authentication flow #1289

Merged
merged 1 commit into from
Aug 2, 2019
Merged
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
2 changes: 1 addition & 1 deletion example/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
android:name=".activity.PaymentAuthActivity" />

<activity
android:name=".activity.PaymentSessionFromFragmentActivity" />
android:name=".activity.FragmentExampesActivity" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ android {

buildTypes {
debug {
minifyEnabled true
minifyEnabled false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

mshafrir-stripe marked this conversation as resolved.
Show resolved Hide resolved
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
Expand All @@ -9,5 +10,4 @@
android:orientation="vertical"
android:id="@+id/root">


</LinearLayout>
26 changes: 26 additions & 0 deletions example/res/layout/launch_payment_session_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
android:orientation="vertical"
android:id="@+id/root">

<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="invisible"
style="?android:attr/progressBarStyleHorizontal"
/>

<Button
android:id="@+id/launch_payment_session"
android:enabled="false"
Expand All @@ -19,4 +28,21 @@
android:text="@string/payment_session_select_payment"
/>

<Button
android:id="@+id/launch_payment_auth"
android:enabled="true"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/example_vertical_spacing"
android:text="@string/launch_payment_auth"
/>

<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:typeface="monospace"
android:layout_marginTop="40dp"/>

</LinearLayout>
5 changes: 3 additions & 2 deletions example/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<string name="launch_customer_session">Customer Session</string>
<string name="launch_pay_with_google">Pay with Google</string>
<string name="launch_payment_session">Payment Session</string>
<string name="launch_payment_session_from_fragment">Payment Session from Fragment</string>
<string name="launch_payment_session_from_fragment">Fragment Examples</string>
<string name="pollingSource">Polling for source changes&#8230;</string>
<string name="save">Save</string>
<string name="saverx">Save Rx</string>
Expand Down Expand Up @@ -91,7 +91,8 @@
<string name="pay_with_google">Pay with Google</string>

<!-- Payment Auth example -->
<string name="launch_payment_auth_example">Payment Auth Example</string>
<string name="payment_auth_example">Payment Auth Example</string>
<string name="launch_payment_auth">Launch Payment Auth Flow</string>
<string name="buy">Buy!</string>
<string name="setup">Buy in the Future!</string>
<string name="payment_intent_status">PaymentIntent status: %s</string>
Expand Down
Loading