title: strip publishabe key on multiple projects
body: <p>I just started working with stripe, and im stuck on this issue for a week now, I have obtained the live publishable key and the secret key, after I add the card details I get the error :
  <strong>please note: the key is also used in one of our IOS projects as well,The API works fine on IOS but fails on android, I even tested it on postman, and the card gets added. I'm not sure if I have missed something in the code or it's the server issue. your help is greatly appreciated!</strong></p>
  <pre><code>&lt;-- 500 Internal Server Error https://ABCD.com/api/user/card (988ms)
      Date: Fri, 11 Dec 2020 08:57:31 GMT
  D/OkHttp: Server: Apache
      Cache-Control: no-cache, private
      X-RateLimit-Limit: 60
  D/OkHttp: X-RateLimit-Remaining: 59
  D/OkHttp: Vary: Authorization
      Connection: close
      Transfer-Encoding: chunked
  D/OkHttp: Content-Type: application/json
  D/OkHttp: {&quot;error&quot;:&quot;Your card was declined.&quot;}
  </code></pre>
  <p>as I read through the stripe documentation it says the 500 errors are from the Stripe server-side.</p>
  <p><strong>here is the activity which calls and fetches the response:
  the function addCardToAccount() is coded to add a card and send the data to the server i.e the card number and stripe token, I fetch the correct token and card number but it fails and doesn't return a successful response.it goes in the else loop and returns &quot;your card has been declined&quot;</strong></p>
  <pre><code>public class AddCardActivity extends AppCompatActivity {
  
      String Card_Token = &quot;&quot;;
      String Card_Number=&quot;&quot;;
      CustomDialog customDialog;
  
      static final Pattern CODE_PATTERN = Pattern
              .compile(&quot;([0-9]{0,4})|([0-9]{4}-)+|([0-9]{4}-[0-9]{0,4})+&quot;);
      @BindView(R.id.card_form)
      CardForm cardForm;
      @BindView(R.id.addCard)
      Button addCard;
      @BindView(R.id.activity_add_card)
      LinearLayout activityAddCard;
      Context context;
      Activity activity;
      ApiInterface apiInterface = ApiClient.getRetrofit().create(ApiInterface.class);
      @BindView(R.id.toolbar)
      Toolbar toolbar;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  //        setTheme(R.style.Mytheme);
          setContentView(R.layout.activity_add_card);
          ButterKnife.bind(this);
          context = AddCardActivity.this;
          activity = AddCardActivity.this;
          setSupportActionBar(toolbar);
          toolbar.setNavigationIcon(R.drawable.ic_back);
          toolbar.setNavigationOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  onBackPressed();
              }
          });
          cardForm.cardRequired(true)
                  .expirationRequired(true)
                  .cvvRequired(true)
                  .postalCodeRequired(false)
                  .mobileNumberRequired(false)
                  .actionLabel(&quot;Add CardDetails&quot;)
                  .setup(activity);
  
          addCard.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  customDialog = new CustomDialog(context);
                  customDialog.setCancelable(false);
                  if (customDialog != null)
                      customDialog.show();
                  if (cardForm.getCardNumber() == null || cardForm.getExpirationMonth() == null || cardForm.getExpirationYear() == null || cardForm.getCvv() == null) {
                      if ((customDialog != null) &amp;&amp; (customDialog.isShowing()))
                          customDialog.dismiss();
                      displayMessage(context.getResources().getString(R.string.enter_card_details));
                  } else {
                      if (cardForm.getCardNumber().equals(&quot;&quot;) || cardForm.getExpirationMonth().equals(&quot;&quot;) || cardForm.getExpirationYear().equals(&quot;&quot;) || cardForm.getCvv().equals(&quot;&quot;)) {
                          if ((customDialog != null) &amp;&amp; (customDialog.isShowing()))
                              customDialog.dismiss();
                          displayMessage(context.getResources().getString(R.string.enter_card_details));
                      } else {
                          final String cardNumber = cardForm.getCardNumber();
                          int month = Integer.parseInt(cardForm.getExpirationMonth());
                          int year = Integer.parseInt(cardForm.getExpirationYear());
                          String cvv = cardForm.getCvv();
                          Utils.print(&quot;MyTest&quot;, &quot;CardDetails Number: &quot; + cardNumber +
                                  &quot;Month: &quot; + month + &quot; Year: &quot; + year);
  
                          final Card card = new Card(cardNumber, month, year, cvv);
                          try {
                              Stripe stripe = new Stripe(AddCardActivity.this, BuildConfigure.STRIPE_PK);
                              stripe.createToken(
                                      card,
                                      new TokenCallback() {
                                          public void onSuccess(Token token) {
                                              // Send token to your server
                                              Utils.print(&quot;CardToken:&quot;, &quot; &quot; + token.getId());
                                              Log.e(&quot;Token&quot;, String.valueOf(token));
                                              Log.e(&quot;TokenID&quot;,token.getId());
                                              Utils.print(&quot;CardToken:&quot;, &quot; &quot; + token.getCard().getLast4());
                                              Card_Token = token.getId();
                                              Card_Number=card.getNumber();
                                             Long card_number= Long.parseLong(Card_Number);
                                              addCardToAccount(Card_Token,Card_Number);
                                          }
  
                                          public void onError(Exception error) {
                                              // Show localized error message
                                              displayMessage(context.getResources().getString(R.string.enter_card_details));
                                              if ((customDialog != null) &amp;&amp; (customDialog.isShowing()))
                                                  customDialog.dismiss();
                                          }
                                      }
                              );
                          } catch (Exception e) {
                              e.printStackTrace();
                              if ((customDialog != null) &amp;&amp; (customDialog.isShowing()))
                                  customDialog.dismiss();
                          }
                      }
  
                  }
              }
          });
  
      }
  
  
  public void addCardToAccount(final String cardToken, final String cardNumber) {
      Log.e(&quot;stripe_token&quot;, cardToken);
      Log.e(&quot;cardNumber&quot;, String.valueOf(cardNumber));
      Call&lt;Message&gt; call = apiInterface.addCard(cardToken,cardNumber);
      call.enqueue(new Callback&lt;Message&gt;() {
          @Override
          public void onResponse(@NonNull Call&lt;Message&gt; call, @NonNull Response&lt;Message&gt; response) {
              customDialog.dismiss();
              if (response.isSuccessful()) {
                  Toast.makeText(context, &quot;&quot; + response.body().getMessage(), Toast.LENGTH_SHORT).show();
                  finish();
              } else {
                  try {
                      JSONObject jObjError = new JSONObject(response.errorBody().string());
                      Toast.makeText(context, jObjError.optString(&quot;error&quot;), Toast.LENGTH_LONG).show();
                  } catch (Exception e) {
                      Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show();
                  }
              }
          }
  
          @Override
          public void onFailure(@NonNull Call&lt;Message&gt; call, @NonNull Throwable t) {
              Toast.makeText(AddCardActivity.this, &quot;Something went wrong&quot;, Toast.LENGTH_SHORT).show();
              customDialog.dismiss();
              Toast.makeText(context, &quot;Something went wrong&quot;, Toast.LENGTH_SHORT).show();
          }
      });
  
  }
  </code></pre>
  <p>}</p>
  <p><strong>and the API is:</strong></p>
  <pre><code>   @FormUrlEncoded
  @POST(&quot;api/user/card&quot;)
  Call&lt;Message&gt; addCard(@Field(&quot;stripe_token&quot;) String stripeToken, @Field(&quot;number&quot;) String cardNumber );
  </code></pre>