title: Stripe where do I go from here?
body: <p>I am attempting to Implement stripe payments in my application, by allowing the user to pay by entering card information inside the stripe multicardinput widget. I am having a difficult time with the server part, so far i have successfully followed the guideline from stripe official docs, here <a href="https://stripe.com/docs/payments/accept-a-payment?platform=android&amp;ui=custom" rel="nofollow noreferrer">https://stripe.com/docs/payments/accept-a-payment?platform=android&amp;ui=custom</a> but I am unsure as to where to go from here, I don't understand the server part. Can someone assist me on what the next step should be?</p>
  <pre><code>public class  payment_activity extends AppCompatActivity {
  
  
      private static final String BACKEND_URL = &quot;http://10.0.2.2:4242/&quot;;
      CardInputWidget cardInputWidget;
      Button payButton;
      private OkHttpClient httpClient;
      static ProgressDialog progressDialog;
      private String paymentIntentClientSecret;
      private PaymentLauncher paymentLauncher;
      // we need paymentIntentClientSecret to start transaction
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_payment);
          cardInputWidget = findViewById(R.id.cardInputWidget);
          payButton = findViewById(R.id.payButton);
          progressDialog = new ProgressDialog(this);
          progressDialog.setTitle(&quot;Transaction in progress&quot;);
          progressDialog.setCancelable(false);
          httpClient = new OkHttpClient();
  
  
  
          final PaymentConfiguration paymentConfiguration
                  = PaymentConfiguration.getInstance(getApplicationContext());
          paymentLauncher = PaymentLauncher.Companion.create(
                  this,
                  paymentConfiguration.getPublishableKey(),
                  paymentConfiguration.getStripeAccountId(),
                  this::onPaymentResult
          );
  
  
          // Hook up the pay button to the card widget
          payButton.setOnClickListener((View view) -&gt; {
              final CardInputWidget cardInputWidget = view.findViewById(R.id.cardInputWidget);
              final PaymentMethodCreateParams params = cardInputWidget.getPaymentMethodCreateParams();
              if (params != null) {
                  final ConfirmPaymentIntentParams confirmParams =
                          ConfirmPaymentIntentParams.createWithPaymentMethodCreateParams(
                                  params,
                                  paymentIntentClientSecret
                          );
                  paymentLauncher.confirm(confirmParams);
              }
          });
  
  
      }
  
      private void onPaymentResult(PaymentResult paymentResult) {
          String message = &quot;&quot;;
          if (paymentResult instanceof PaymentResult.Completed) {
              message = &quot;Completed!&quot;;
          } else if (paymentResult instanceof PaymentResult.Canceled) {
              message = &quot;Canceled!&quot;;
          } else if (paymentResult instanceof PaymentResult.Failed) {
              // This string comes from the PaymentIntent's error message.
              // See here: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-last_payment_error-message
              message = &quot;Failed: &quot;
                      + ((PaymentResult.Failed) paymentResult).getThrowable().getMessage();
          }
  
  
          Log.i(&quot;paymentResult&quot;, message);
      }
  
  
  
  
  
  
  
  
  
  
  
  
  }
  
  
  
  
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;@color/white&quot;&gt;
  
      &lt;androidx.appcompat.widget.Toolbar
          android:id=&quot;@+id/toolbar3&quot;
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:background=&quot;@color/app_theme&quot;
          android:minHeight=&quot;?attr/actionBarSize&quot;
          android:theme=&quot;?attr/actionBarTheme&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/imageView4&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginStart=&quot;16dp&quot;
          app:layout_constraintBottom_toBottomOf=&quot;@+id/toolbar3&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:srcCompat=&quot;@drawable/ic_baseline_arrow_back_24&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView12&quot;
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginStart=&quot;16dp&quot;
          android:gravity=&quot;center&quot;
          android:text=&quot;Billing&quot;
          android:textSize=&quot;17sp&quot;
  
          android:textStyle=&quot;bold&quot;
          app:layout_constraintBottom_toBottomOf=&quot;@+id/toolbar3&quot;
          app:layout_constraintStart_toEndOf=&quot;@+id/imageView4&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:layout_constraintVertical_bias=&quot;0.484&quot; /&gt;
  
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:id=&quot;@+id/bottom_navigation&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:background=&quot;@color/white&quot;
  
  
          app:itemIconSize=&quot;40dp&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/toolbar3&quot;
          app:menu=&quot;@menu/payment_menu&quot; /&gt;
  
      &lt;androidx.core.widget.NestedScrollView
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;0dp&quot;
          android:fillViewport=&quot;true&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/bottom_navigation&quot;&gt;
  
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;&gt;
  
  
              &lt;EditText
                  android:id=&quot;@+id/nameEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;16dp&quot;
  
                  android:layout_marginRight=&quot;12dp&quot;
  
                  android:drawablePadding=&quot;10dp&quot;
                  android:hint=&quot;Name&quot;
                  android:inputType=&quot;textPersonName&quot;
  
                  android:paddingLeft=&quot;15dp&quot;
                  android:paddingRight=&quot;15dp&quot;
                  android:textColor=&quot;@color/hintColor&quot;
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.041&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/textView28&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/textView28&quot; /&gt;
  
              &lt;EditText
                  android:id=&quot;@+id/addressEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
  
                  android:layout_marginTop=&quot;20dp&quot;
                  android:drawablePadding=&quot;10dp&quot;
                  android:hint=&quot;Address&quot;
  
                  android:inputType=&quot;textPersonName&quot;
                  android:paddingLeft=&quot;15dp&quot;
                  android:paddingRight=&quot;15dp&quot;
                  android:textColor=&quot;@color/hintColor&quot;
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;@+id/nameEt&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.0&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/nameEt&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/nameEt&quot; /&gt;
  
              &lt;EditText
                  android:id=&quot;@+id/cityEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;40dp&quot;
                  android:layout_marginTop=&quot;20dp&quot;
                  android:ems=&quot;10&quot;
  
                  android:hint=&quot;City&quot;
                  android:inputType=&quot;textPersonName&quot;
                  android:paddingLeft=&quot;15dp&quot;
  
  
                  android:textColor=&quot;@color/hintColor&quot;
  
  
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;@+id/addressEt&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.0&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/addressEt&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/addressEt&quot; /&gt;
  
              &lt;EditText
                  android:id=&quot;@+id/stateEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;28dp&quot;
  
                  android:ems=&quot;10&quot;
                  android:hint=&quot;State&quot;
  
                  android:inputType=&quot;textPersonName&quot;
                  android:paddingLeft=&quot;15dp&quot;
                  android:textColor=&quot;@color/hintColor&quot;
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.0&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/zipEt&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/zipEt&quot; /&gt;
  
              &lt;EditText
                  android:id=&quot;@+id/countryEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;16dp&quot;
                  android:ems=&quot;10&quot;
  
                  android:hint=&quot;Country&quot;
  
  
                  android:inputType=&quot;textPersonName&quot;
                  android:paddingLeft=&quot;15dp&quot;
                  android:textColor=&quot;@color/hintColor&quot;
  
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;@+id/cityEt&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.0&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/cityEt&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/cityEt&quot; /&gt;
  
              &lt;EditText
                  android:id=&quot;@+id/zipEt&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;20dp&quot;
                  android:ems=&quot;10&quot;
                  android:hint=&quot;Zip&quot;
                  android:inputType=&quot;textPersonName&quot;
                  android:paddingLeft=&quot;15dp&quot;
  
  
                  android:textColorHint=&quot;@color/hintColor&quot;
                  app:backgroundTint=&quot;@color/hintColor&quot;
                  app:layout_constraintEnd_toEndOf=&quot;@+id/countryEt&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.0&quot;
                  app:layout_constraintStart_toStartOf=&quot;@+id/countryEt&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/countryEt&quot; /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/textView&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;36dp&quot;
                  android:text=&quot;Billing Information&quot;
                  android:textColor=&quot;@color/hintColor&quot;
                  android:textSize=&quot;18sp&quot;
                  android:textStyle=&quot;bold&quot;
  
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.089&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/textView28&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;36dp&quot;
                  android:text=&quot;Shipping Adress&quot;
  
                  android:textColor=&quot;@color/hintColor&quot;
                  android:textSize=&quot;18sp&quot;
                  android:textStyle=&quot;bold&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.11&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/cardInputWidget&quot; /&gt;
  
  
              &lt;androidx.appcompat.widget.AppCompatButton
                  android:id=&quot;@+id/payButton&quot;
                  android:layout_width=&quot;355dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginHorizontal=&quot;10dp&quot;
                  android:background=&quot;@drawable/custom_button&quot;
                  android:text=&quot;Pay($90.35)&quot;
                  app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/stateEt&quot; /&gt;
  
              &lt;com.stripe.android.view.CardMultilineWidget
                  android:id=&quot;@+id/cardInputWidget&quot;
                  android:layout_width=&quot;0dp&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_margin=&quot;20dp&quot;
                  android:theme=&quot;@style/StripeDefaultTheme&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/textView&quot; /&gt;
  
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  
      &lt;/androidx.core.widget.NestedScrollView&gt;
  
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>